summaryrefslogtreecommitdiffstats
path: root/pw/pwupd.c
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>1996-12-09 23:55:27 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>1996-12-09 23:55:27 +0000
commita8af085a741562fec1e32f338ba723232832f523 (patch)
tree412f12f7649d44ca0c0ba886eac54ab8d1821cd0 /pw/pwupd.c
parent6329584bf610f8d5f44eed0d0c51f3df949807a1 (diff)
downloadpw-darwin-a8af085a741562fec1e32f338ba723232832f523.tar.gz
pw-darwin-a8af085a741562fec1e32f338ba723232832f523.tar.zst
pw-darwin-a8af085a741562fec1e32f338ba723232832f523.zip
Upgrade from the author, reflecting all my wishes resulting out of the
sysinstall use of this tool (plus some bug fixes). 2.2 candidate... Submitted by: David Nugent <davidn@nserver.usn.blaze.net.au>
Diffstat (limited to 'pw/pwupd.c')
-rw-r--r--pw/pwupd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pw/pwupd.c b/pw/pwupd.c
index e13ce5f..43e0968 100644
--- a/pw/pwupd.c
+++ b/pw/pwupd.c
@@ -45,6 +45,8 @@
#include "pwupd.h"
+#define HAVE_PWDB_C 1
+
static int
pwdb(char *arg,...)
{
@@ -114,8 +116,13 @@ pw_update(struct passwd * pwd, char const * user, int mode)
/*
* First, let's check the see if the database is alright
+ * Note: -c is only available in FreeBSD 2.2 and above
*/
+#ifdef HAVE_PWDB_C
if (pwdb("-c", NULL) == 0) { /* Check only */
+#else
+ { /* No -c */
+#endif
char pfx[32];
char pwbuf[MAXPWLINE];
int l = sprintf(pfx, "%s:", user);