summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pwupd.c
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1996-12-09 23:55:27 +0000
committerjoerg <joerg@FreeBSD.org>1996-12-09 23:55:27 +0000
commitcb39d6c9763eb9cc95aaba2fd326ec3d45637ab0 (patch)
treece8b42cd0211fd35f14b3373a929b693bb8bf1c0 /usr.sbin/pw/pwupd.c
parent4a198ee0cbf4e9939c2a6e9a0de4afd27158e394 (diff)
downloadFreeBSD-src-cb39d6c9763eb9cc95aaba2fd326ec3d45637ab0.zip
FreeBSD-src-cb39d6c9763eb9cc95aaba2fd326ec3d45637ab0.tar.gz
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 'usr.sbin/pw/pwupd.c')
-rw-r--r--usr.sbin/pw/pwupd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/usr.sbin/pw/pwupd.c b/usr.sbin/pw/pwupd.c
index e13ce5f..43e0968 100644
--- a/usr.sbin/pw/pwupd.c
+++ b/usr.sbin/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);
OpenPOWER on IntegriCloud