diff -urN base-passwd-3.4.1/Makefile.in base-passwd-3.4.1-freebsd/Makefile.in
--- base-passwd-3.4.1/Makefile.in	Tue Nov 30 14:27:22 1999
+++ base-passwd-3.4.1-freebsd/Makefile.in	Sat Apr 13 17:11:24 2002
@@ -5,7 +5,7 @@
 # Compilation tools
 CC		= @CC@
 CFLAGS		= @CFLAGS@ @DEFS@ -I.
-LDFLAGS		= @LDFLAGS@
+LDFLAGS		= @LDFLAGS@ @LIBS@
 
 # Other tools
 INSTALL		= @INSTALL@
diff -urN base-passwd-3.4.1/configure base-passwd-3.4.1-freebsd/configure
--- base-passwd-3.4.1/configure	Tue Nov 30 14:12:45 1999
+++ base-passwd-3.4.1-freebsd/configure	Sat Apr 13 17:06:40 2002
@@ -845,7 +845,7 @@
   for ac_dir in $ac_dummy; do
     test -z "$ac_dir" && ac_dir=.
     if test -f $ac_dir/$ac_word; then
-      ac_cv_prog_RM="rf -f"
+      ac_cv_prog_RM="rm -f"
       break
     fi
   done
@@ -914,6 +914,53 @@
   echo "$ac_t""no" 1>&6
 fi
 done
+
+echo $ac_n "checking for getspent in -lshadow""... $ac_c" 1>&6
+echo "configure:920: checking for getspent in -lshadow" >&5
+ac_lib_var=`echo shadow'_'getspent | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lshadow  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 928 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char getspent();
+
+int main() {
+getspent()
+; return 0; }
+EOF
+if { (eval echo configure:939: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+    ac_tr_lib=HAVE_LIB`echo shadow | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+  cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+  LIBS="-lshadow $LIBS"
+
+else
+  echo "$ac_t""no" 1>&6
+fi
 
 
 trap '' 1 2 15
diff -urN base-passwd-3.4.1/configure.in base-passwd-3.4.1-freebsd/configure.in
--- base-passwd-3.4.1/configure.in	Tue Nov 30 14:12:59 1999
+++ base-passwd-3.4.1-freebsd/configure.in	Sat Apr 13 17:06:36 2002
@@ -10,6 +10,7 @@
 
 dnl Scan for things we need
 AC_CHECK_FUNCS(putgrent)
+AC_CHECK_LIB(shadow,getspent)
 
 dnl Finally output everything
 AC_OUTPUT(Makefile)
diff -urN base-passwd-3.4.1/update-passwd.c base-passwd-3.4.1-freebsd/update-passwd.c
--- base-passwd-3.4.1/update-passwd.c	Sat Feb  9 18:46:14 2002
+++ base-passwd-3.4.1-freebsd/update-passwd.c	Sat Apr 13 17:53:45 2002
@@ -1125,6 +1125,10 @@
 	unlock_files();
 	return 4;
     }
+#if defined (__FreeBSD__) || defined (__NetBSD__)
+    if(spsync()!=0)
+	return 6;
+#endif
 
     if (!opt_nolock && !opt_dryrun)
 	if (!unlock_files())
