Hello community, here is the log from the commit of package pwdutils checked in at Wed May 24 02:49:01 CEST 2006. -------- --- pwdutils/pwdutils.changes 2006-05-22 09:47:40.000000000 +0200 +++ pwdutils/pwdutils.changes 2006-05-23 14:29:22.000000000 +0200 @@ -1,0 +2,5 @@ +Tue May 23 14:28:09 CEST 2006 - kukuk@suse.de + +- Save pointer for group entry [#173696] + +------------------------------------------------------------------- New: ---- pwdutils-newgrp-bnc173696.diff ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pwdutils.spec ++++++ --- /var/tmp/diff_new_pack.z75Y24/_old 2006-05-24 02:48:47.000000000 +0200 +++ /var/tmp/diff_new_pack.z75Y24/_new 2006-05-24 02:48:47.000000000 +0200 @@ -17,7 +17,7 @@ Group: System/Base Autoreqprov: on Version: 3.0.7.1 -Release: 19 +Release: 20 Summary: Utilities to Manage User and Group Accounts PreReq: grep /bin/cp /bin/mv Requires: pam-modules @@ -43,6 +43,7 @@ Patch4: pam_login-3.31.diff Patch5: pam_login-3.31-suppress_hostname.patch Patch6: pwdutils-usermod-bnc177144.diff +Patch7: pwdutils-newgrp-bnc173696.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -78,6 +79,7 @@ popd %patch3 %patch6 +%patch7 chmod 755 src/tst-usermod %build @@ -214,6 +216,8 @@ %{_libdir}/pwdutils/liblog_audit.so.1* %changelog -n pwdutils +* Tue May 23 2006 - kukuk@suse.de +- Save pointer for group entry [#173696] * Mon May 22 2006 - kukuk@suse.de - Fix usermod -L/-U [#177144] * Fri May 19 2006 - kssingvo@suse.de ++++++ pwdutils-newgrp-bnc173696.diff ++++++ --- src/newgrp.c 13 Aug 2005 02:26:29 -0000 1.20 +++ src/newgrp.c 10 May 2006 12:36:12 -0000 @@ -204,28 +204,44 @@ { struct group *g; char **gp; + gid_t search_gid; + + /* grp will be no longer valid after setgrent() call. */ + search_gid = grp->gr_gid; + grp = NULL; /* Normally it is enough to check only, if the user is in grp->gr_mem. But some people split the groups into multiple - one with the same name, but different members. So we have + one with the same group ID, but different members. So we have to step through all group entries and search for the correct one. */ setgrent (); while (!is_member && (g = getgrent ()) != NULL) { - if (g->gr_gid != grp->gr_gid) + if (g->gr_gid != search_gid) continue; for (gp = g->gr_mem; *gp != NULL; gp++) { if (strcmp (pw->pw_name, *gp) == 0) { + grp = g; /* let point grp to the new group entry. */ is_member = 1; break; } } } - endgrent (); + /* endgrent (); */ /* Don't invalidate grp pointer. */ + if (grp == NULL) + { /* restore grp pointer, user is no member. */ + if ((grp = getgrgid (search_gid)) == NULL) + { + fprintf (stderr, + _("%s: failure to get group entry for %d.\n"), + program, search_gid); + return E_FAILURE; + } + } } if (!is_member && grp->gr_passwd && grp->gr_passwd[0] != '\0') ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de