If the shadow group file is not present, do not try to locate the group
entry from /etc/gshadow, and set the password in /etc/group.
This commit is contained in:
parent
9aa40bb96d
commit
fd0b22cb55
@ -1,3 +1,9 @@
|
|||||||
|
2007-11-20 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
|
* src/chgpasswd.c: If the shadow group file is not present, do not
|
||||||
|
try to locate the group entry from /etc/gshadow, and set the
|
||||||
|
password in /etc/group.
|
||||||
|
|
||||||
2007-11-20 Nicolas François <nicolas.francois@centraliens.net>
|
2007-11-20 Nicolas François <nicolas.francois@centraliens.net>
|
||||||
|
|
||||||
* libmisc/obscure.c, libmisc/salt.c, src/passwd.c: Match DES, MD5,
|
* libmisc/obscure.c, libmisc/salt.c, src/passwd.c: Match DES, MD5,
|
||||||
|
@ -116,6 +116,9 @@ int main (int argc, char **argv)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const struct group *gr;
|
const struct group *gr;
|
||||||
|
#ifndef SHADOWGRP
|
||||||
|
struct group newgr;
|
||||||
|
#endif
|
||||||
int errors = 0;
|
int errors = 0;
|
||||||
int line = 0;
|
int line = 0;
|
||||||
int ok;
|
int ok;
|
||||||
@ -124,9 +127,6 @@ int main (int argc, char **argv)
|
|||||||
pam_handle_t *pamh = NULL;
|
pam_handle_t *pamh = NULL;
|
||||||
int retval;
|
int retval;
|
||||||
#endif
|
#endif
|
||||||
#ifndef SHADOWGRP
|
|
||||||
struct group newgr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
Prog = Basename (argv[0]);
|
Prog = Basename (argv[0]);
|
||||||
|
|
||||||
@ -336,7 +336,10 @@ int main (int argc, char **argv)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
|
if (is_shadow_grp)
|
||||||
sg = sgr_locate (name);
|
sg = sgr_locate (name);
|
||||||
|
else
|
||||||
|
sg = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -345,12 +348,15 @@ int main (int argc, char **argv)
|
|||||||
* date is set to the current date.
|
* date is set to the current date.
|
||||||
*/
|
*/
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
|
if (sg) {
|
||||||
newsg = *sg;
|
newsg = *sg;
|
||||||
newsg.sg_passwd = cp;
|
newsg.sg_passwd = cp;
|
||||||
#else
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
newgr = *gr;
|
newgr = *gr;
|
||||||
newgr.gr_passwd = cp;
|
newgr.gr_passwd = cp;
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The updated password file entry is then put back and will
|
* The updated password file entry is then put back and will
|
||||||
@ -358,10 +364,11 @@ int main (int argc, char **argv)
|
|||||||
* other entries have been updated as well.
|
* other entries have been updated as well.
|
||||||
*/
|
*/
|
||||||
#ifdef SHADOWGRP
|
#ifdef SHADOWGRP
|
||||||
|
if (sg)
|
||||||
ok = sgr_update (&newsg);
|
ok = sgr_update (&newsg);
|
||||||
#else
|
else
|
||||||
ok = gr_update (&newgr);
|
|
||||||
#endif
|
#endif
|
||||||
|
ok = gr_update (&newgr);
|
||||||
|
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
|
Loading…
Reference in New Issue
Block a user