diff --git a/ChangeLog b/ChangeLog index b4cdb85a..5530983b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2011-08-14 Nicolas François + + * src/chgpasswd.c, src/chpasswd.c, src/newusers.c: Replace cflg by + a test on crypt_method. + 2011-08-14 Nicolas François * libmisc/chowndir.c: Add splint annotations. diff --git a/src/chgpasswd.c b/src/chgpasswd.c index 3ba79b50..2aadf46a 100644 --- a/src/chgpasswd.c +++ b/src/chgpasswd.c @@ -58,7 +58,6 @@ * Global variables */ const char *Prog; -static bool cflg = false; static bool eflg = false; static bool md5flg = false; #ifdef USE_SHA_CRYPT @@ -66,6 +65,7 @@ static bool sflg = false; #endif static /*@null@*//*@observer@*/const char *crypt_method = NULL; +#define cflg (NULL != crypt_method) #ifdef USE_SHA_CRYPT static long sha_rounds = 5000; #endif @@ -174,7 +174,6 @@ static void process_flags (int argc, char **argv) long_options, &option_index)) != -1) { switch (c) { case 'c': - cflg = true; crypt_method = optarg; break; case 'e': diff --git a/src/chpasswd.c b/src/chpasswd.c index eb3bd873..b4515e61 100644 --- a/src/chpasswd.c +++ b/src/chpasswd.c @@ -55,7 +55,6 @@ * Global variables */ const char *Prog; -static bool cflg = false; static bool eflg = false; static bool md5flg = false; #ifdef USE_SHA_CRYPT @@ -63,6 +62,7 @@ static bool sflg = false; #endif /* USE_SHA_CRYPT */ static /*@null@*//*@observer@*/const char *crypt_method = NULL; +#define cflg (NULL != crypt_method) #ifdef USE_SHA_CRYPT static long sha_rounds = 5000; #endif /* USE_SHA_CRYPT */ @@ -170,7 +170,6 @@ static void process_flags (int argc, char **argv) usage (E_SUCCESS); /*@notreached@*/break; case 'c': - cflg = true; crypt_method = optarg; break; case 'e': diff --git a/src/newusers.c b/src/newusers.c index a88d9b77..fc90b2db 100644 --- a/src/newusers.c +++ b/src/newusers.c @@ -74,8 +74,8 @@ const char *Prog; static bool rflg = false; /* create a system account */ #ifndef USE_PAM -static bool cflg = false; static /*@null@*//*@observer@*/char *crypt_method = NULL; +#define cflg (NULL != crypt_method) #ifdef USE_SHA_CRYPT static bool sflg = false; static long sha_rounds = 5000; @@ -556,7 +556,6 @@ static void process_flags (int argc, char **argv) break; #ifndef USE_PAM case 'c': - cflg = true; crypt_method = optarg; break; #ifdef USE_SHA_CRYPT