* NEWS, src/userdel.c: Fix segfault when userdel removes the

user's group.
This commit is contained in:
nekral-guest 2012-05-18 18:56:24 +00:00
parent f243d4077d
commit 17deaa39f5
3 changed files with 13 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2012-05-18 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/userdel.c: Fix segfault when userdel removes the
user's group.
2012-05-17 Nicolas François <nicolas.francois@centraliens.net>
* NEWS, src/login.c: Log in utmp / utmpx / wtmp also when PAM is

2
NEWS
View File

@ -5,6 +5,8 @@ shadow-4.1.5 -> shadow-4.1.5.1 UNRELEASED
- login
* Log into utmp(x) when PAM is enabled, but do not log into wtmp.
This complete pam_lastlog which logs into wtmp and in into utmp(x).
- userdel
* Fix segfault when userdel removes the user's group.
shadow-4.1.4.3 -> shadow-4.1.5 2012-02-12

View File

@ -333,22 +333,22 @@ static void remove_usergroup (void)
* We can remove this group, it is not the primary
* group of any remaining user.
*/
if (gr_remove (grp->gr_name) == 0) {
if (gr_remove (user_name) == 0) {
fprintf (stderr,
_("%s: cannot remove entry '%s' from %s\n"),
Prog, grp->gr_name, gr_dbname ());
Prog, user_name, gr_dbname ());
fail_exit (E_GRP_UPDATE);
}
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_GROUP, Prog,
"deleting group",
grp->gr_name, AUDIT_NO_ID,
user_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
SYSLOG ((LOG_INFO,
"removed group '%s' owned by '%s'\n",
grp->gr_name, user_name));
user_name, user_name));
#ifdef SHADOWGRP
if (sgr_locate (user_name) != NULL) {
@ -361,12 +361,12 @@ static void remove_usergroup (void)
#ifdef WITH_AUDIT
audit_logger (AUDIT_DEL_GROUP, Prog,
"deleting shadow group",
grp->gr_name, AUDIT_NO_ID,
user_name, AUDIT_NO_ID,
SHADOW_AUDIT_SUCCESS);
#endif /* WITH_AUDIT */
SYSLOG ((LOG_INFO,
"removed shadow group '%s' owned by '%s'\n",
grp->gr_name, user_name));
user_name, user_name));
}
#endif /* SHADOWGRP */