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
commit7b695de799ec47d008ed93b25da9266cfb6d6da1 (patch)
tree4af9ee1f1c7e35c57920a545d9f3fcb9d482399f /pw/pwupd.c
parent843cda19dd69e914697e0dd976f67480bdd94a1d (diff)
downloadpw-darwin-7b695de799ec47d008ed93b25da9266cfb6d6da1.tar.gz
pw-darwin-7b695de799ec47d008ed93b25da9266cfb6d6da1.tar.zst
pw-darwin-7b695de799ec47d008ed93b25da9266cfb6d6da1.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);