* src/chgpasswd.c: Fix typo sp -> sg. sg_namp -> sg_name
* src/chgpasswd.c: Always update the group file when SHADOWGRP is not enabled.
This commit is contained in:
parent
934bfa5969
commit
f8d47df43b
|
@ -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>
|
2011-07-30 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* src/newgrp.c: Fix typo in notreached annotation.
|
* src/newgrp.c: Fix typo in notreached annotation.
|
||||||
|
|
|
@ -486,15 +486,15 @@ int main (int argc, char **argv)
|
||||||
*/
|
*/
|
||||||
sg = sgr_locate (name);
|
sg = sgr_locate (name);
|
||||||
|
|
||||||
if ( (NULL == sp)
|
if ( (NULL == sg)
|
||||||
&& (strcmp (pw->pw_passwd,
|
&& (strcmp (gr->gr_passwd,
|
||||||
SHADOW_PASSWD_STRING) == 0)) {
|
SHADOW_PASSWD_STRING) == 0)) {
|
||||||
static char *empty = NULL;
|
static char *empty = NULL;
|
||||||
/* If the password is set to 'x' in
|
/* If the password is set to 'x' in
|
||||||
* group, but there are no entries in
|
* group, but there are no entries in
|
||||||
* gshadow, create one.
|
* gshadow, create one.
|
||||||
*/
|
*/
|
||||||
newsg.sg_namp = name;
|
newsg.sg_name = name;
|
||||||
/* newsg.sg_passwd = NULL; will be set later */
|
/* newsg.sg_passwd = NULL; will be set later */
|
||||||
newsg.sg_adm = ∅
|
newsg.sg_adm = ∅
|
||||||
newsg.sg_mem = dup_list (gr->gr_mem);
|
newsg.sg_mem = dup_list (gr->gr_mem);
|
||||||
|
@ -514,9 +514,10 @@ int main (int argc, char **argv)
|
||||||
newsg = *sg;
|
newsg = *sg;
|
||||||
newsg.sg_passwd = cp;
|
newsg.sg_passwd = cp;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if ( (NULL == sg)
|
if ( (NULL == sg)
|
||||||
|| (strcmp (gr->gr_passwd, SHADOW_PASSWD_STRING) != 0)) {
|
|| (strcmp (gr->gr_passwd, SHADOW_PASSWD_STRING) != 0))
|
||||||
|
#endif
|
||||||
|
{
|
||||||
newgr = *gr;
|
newgr = *gr;
|
||||||
newgr.gr_passwd = cp;
|
newgr.gr_passwd = cp;
|
||||||
}
|
}
|
||||||
|
@ -536,9 +537,10 @@ int main (int argc, char **argv)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
if ( (NULL == sg)
|
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) {
|
if (gr_update (&newgr) == 0) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_("%s: line %d: failed to prepare the new %s entry '%s'\n"),
|
_("%s: line %d: failed to prepare the new %s entry '%s'\n"),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user