- I don't think we care about portability of this code to versions prior to 2.2 anymore. - Fix some broken indentation.
Actually the #define's related to this can go away too; use of HAVE_PWDB_C is removed by this, and HAVE_PWDB_U is unused since r242349. Index: pwupd.c =================================================================== --- pwupd.c (revision 264991) +++ pwupd.c (working copy) @@ -45,9 +45,6 @@ #include "pwupd.h" -#define HAVE_PWDB_C 1 -#define HAVE_PWDB_U 1 - static char pathpwd[] = _PATH_PWD; static char * pwpath = pathpwd; @@ -114,20 +111,15 @@ /* * 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 rc = pwdb("-C", (char *)NULL); /* Check only */ if (rc == 0) { -#else - { /* No -C */ -#endif int pfd, tfd; struct passwd *pw = NULL; struct passwd *old_pw = NULL; - if (pwd != NULL) - pw = pw_dup(pwd); + if (pwd != NULL) + pw = pw_dup(pwd); if (user != NULL) old_pw = GETPWNAM(user);
Created attachment 143610 [details] Updated patch Upload updated patch as attachment.
A commit references this bug: Author: bapt Date: Fri Jun 20 10:34:33 UTC 2014 New revision: 267669 URL: http://svnweb.freebsd.org/changeset/base/267669 Log: Removed compatibility with pre FreeBSD 2.2 pw_mkdb command Fix some broken indentattion PR: 189173 Submitted by: fullermd@over-yonder.net MFC after: 1 week Changes: head/usr.sbin/pw/pwupd.c