]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
* src/chgpasswd.c: Fix typo sp -> sg. sg_namp -> sg_name
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Jul 2011 01:46:23 +0000 (01:46 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sat, 30 Jul 2011 01:46:23 +0000 (01:46 +0000)
* src/chgpasswd.c: Always update the group file when SHADOWGRP is
not enabled.

ChangeLog
src/chgpasswd.c

index b8e5ab4cf664666ee90ca41f4f4caf4a00022ce2..09fd11e1a3d1866e0a619e3a9924f6662a9c2f79 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-30  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/chgpasswd.c: Fix typo sp -> sg. sg_namp -> sg_name
+       * src/chgpasswd.c: Always update the group file when SHADOWGRP is
+       not enabled.
+
 2011-07-30  Nicolas François  <nicolas.francois@centraliens.net>
 
        * src/newgrp.c: Fix typo in notreached annotation.
index 40ec53d47b09060d183465786b5c56e51e2100c5..e110fed6d1e66d5fc2b659fcbb1394c587980316 100644 (file)
@@ -450,7 +450,7 @@ int main (int argc, char **argv)
                newpwd = cp;
                if (   (!eflg)
                    && (   (NULL == crypt_method)
-                       || (0 != strcmp(crypt_method, "NONE")))) {
+                       || (0 != strcmp (crypt_method, "NONE")))) {
                        void *arg = NULL;
                        if (md5flg) {
                                crypt_method = "MD5";
@@ -461,7 +461,7 @@ int main (int argc, char **argv)
                        }
 #endif
                        cp = pw_encrypt (newpwd,
-                                        crypt_make_salt(crypt_method, arg));
+                                        crypt_make_salt (crypt_method, arg));
                }
 
                /*
@@ -486,15 +486,15 @@ int main (int argc, char **argv)
                         */
                        sg = sgr_locate (name);
 
-                       if (   (NULL == sp)
-                           && (strcmp (pw->pw_passwd,
+                       if (   (NULL == sg)
+                           && (strcmp (gr->gr_passwd,
                                        SHADOW_PASSWD_STRING) == 0)) {
                                static char *empty = NULL;
                                /* If the password is set to 'x' in
                                 * group, but there are no entries in
                                 * gshadow, create one.
                                 */
-                               newsg.sg_namp   = name;
+                               newsg.sg_name   = name;
                                /* newsg.sg_passwd = NULL; will be set later */
                                newsg.sg_adm    = &empty;
                                newsg.sg_mem    = dup_list (gr->gr_mem);
@@ -514,9 +514,10 @@ int main (int argc, char **argv)
                        newsg = *sg;
                        newsg.sg_passwd = cp;
                }
-#endif
                if (   (NULL == sg)
-                   || (strcmp (gr->gr_passwd, SHADOW_PASSWD_STRING) != 0)) {
+                   || (strcmp (gr->gr_passwd, SHADOW_PASSWD_STRING) != 0))
+#endif
+               {
                        newgr = *gr;
                        newgr.gr_passwd = cp;
                }
@@ -536,9 +537,10 @@ int main (int argc, char **argv)
                                continue;
                        }
                }
-#endif
                if (   (NULL == sg)
-                   || (strcmp (gr->gr_passwd, SHADOW_PASSWD_STRING) != 0)) {
+                   || (strcmp (gr->gr_passwd, SHADOW_PASSWD_STRING) != 0))
+#endif
+               {
                        if (gr_update (&newgr) == 0) {
                                fprintf (stderr,
                                         _("%s: line %d: failed to prepare the new %s entry '%s'\n"),