]> granicus.if.org Git - shadow/commitdiff
Avoid variables with the name of a type.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 29 Dec 2007 14:52:35 +0000 (14:52 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 29 Dec 2007 14:52:35 +0000 (14:52 +0000)
ChangeLog
src/newusers.c

index 4acb86e8c1b619ebdd5776a4d1b38e8eac7e6464..a6dfe87f5ae224e156fcb917943bf2e03c414021 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        pam API was already checked. No need to validate it again.
        * src/newusers.c: Avoid implicit brackets.
        * src/newusers.c: Avoid assignments in comparisons.
+       * src/newusers.c: Avoid variables with the name of a type.
 
 2007-12-29  Nicolas François  <nicolas.francois@centraliens.net>
 
index dad58361dfaae82b5d9847e8fb7b6284c0e34010..80ddac9ec48ec834fb02f7bc71011f708d204114 100644 (file)
@@ -256,7 +256,7 @@ static int add_user (const char *name, const char *uid, uid_t * nuid, gid_t gid)
        return !pw_update (&pwent);
 }
 
-static void update_passwd (struct passwd *pwd, const char *passwd)
+static void update_passwd (struct passwd *pwd, const char *password)
 {
        void *crypt_arg = NULL;
        if (crypt_method != NULL) {
@@ -266,9 +266,9 @@ static void update_passwd (struct passwd *pwd, const char *passwd)
        }
 
        if ((crypt_method != NULL) && (0 == strcmp(crypt_method, "NONE"))) {
-               pwd->pw_passwd = (char *)passwd;
+               pwd->pw_passwd = (char *)password;
        } else {
-               pwd->pw_passwd = pw_encrypt (passwd,
+               pwd->pw_passwd = pw_encrypt (password,
                                             crypt_make_salt (crypt_method,
                                                              crypt_arg));
        }
@@ -277,7 +277,7 @@ static void update_passwd (struct passwd *pwd, const char *passwd)
 /*
  * add_passwd - add or update the encrypted password
  */
-static int add_passwd (struct passwd *pwd, const char *passwd)
+static int add_passwd (struct passwd *pwd, const char *password)
 {
        const struct spwd *sp;
        struct spwd spent;
@@ -294,7 +294,7 @@ static int add_passwd (struct passwd *pwd, const char *passwd)
         * harder since there are zillions of things to do ...
         */
        if (!is_shadow) {
-               update_passwd (pwd, passwd);
+               update_passwd (pwd, password);
                return 0;
        }
 
@@ -305,7 +305,7 @@ static int add_passwd (struct passwd *pwd, const char *passwd)
        sp = spw_locate (pwd->pw_name);
        if (NULL != sp) {
                spent = *sp;
-               spent.sp_pwdp = pw_encrypt (passwd,
+               spent.sp_pwdp = pw_encrypt (password,
                                            crypt_make_salt (crypt_method,
                                                             crypt_arg));
                return !spw_update (&spent);
@@ -318,7 +318,7 @@ static int add_passwd (struct passwd *pwd, const char *passwd)
         * the password set someplace else.
         */
        if (strcmp (pwd->pw_passwd, "x") != 0) {
-               update_passwd (pwd, passwd);
+               update_passwd (pwd, password);
                return 0;
        }
 
@@ -327,7 +327,7 @@ static int add_passwd (struct passwd *pwd, const char *passwd)
         * shadow password file entry.
         */
        spent.sp_namp = pwd->pw_name;
-       spent.sp_pwdp = pw_encrypt (passwd,
+       spent.sp_pwdp = pw_encrypt (password,
                                    crypt_make_salt (crypt_method, crypt_arg));
        spent.sp_lstchg = time ((time_t *) 0) / SCALE;
        spent.sp_min = getdef_num ("PASS_MIN_DAYS", 0);