fix groupmems issues (#459825)

This commit is contained in:
Peter Vrabec 2008-09-02 08:46:52 +00:00
parent edcb9d8b59
commit 87ffe9ce68
2 changed files with 36 additions and 1 deletions

30
shadow-4.1.2-gmSEGV.patch Normal file
View file

@ -0,0 +1,30 @@
diff -up shadow-4.1.2/src/groupmems.c.gmSEGV shadow-4.1.2/src/groupmems.c
--- shadow-4.1.2/src/groupmems.c.gmSEGV 2008-04-22 22:05:11.000000000 +0200
+++ shadow-4.1.2/src/groupmems.c 2008-09-02 08:30:52.000000000 +0200
@@ -95,7 +95,7 @@ static char *whoami (void)
}
}
-static void addtogroup (char *user, char **members)
+static char **addtogroup (char *user, char **members)
{
int i;
@@ -109,6 +109,8 @@ static void addtogroup (char *user, char
members = (char **) realloc (members, sizeof (char *) * (i+2));
members[i] = user;
members[i + 1] = NULL;
+
+ return members;
}
static void rmfromgroup (char *user, char **members)
@@ -285,7 +287,7 @@ int main (int argc, char **argv)
grp = (struct group *) gr_locate (name);
if (NULL != adduser) {
- addtogroup (adduser, grp->gr_mem);
+ grp->gr_mem = addtogroup (adduser, grp->gr_mem);
gr_update (grp);
} else if (NULL != deluser) {
rmfromgroup (deluser, grp->gr_mem);

View file

@ -5,7 +5,7 @@
Summary: Utilities for managing accounts and shadow password files Summary: Utilities for managing accounts and shadow password files
Name: shadow-utils Name: shadow-utils
Version: 4.1.2 Version: 4.1.2
Release: 4%{?dist} Release: 5%{?dist}
Epoch: 2 Epoch: 2
URL: http://pkg-shadow.alioth.debian.org/ URL: http://pkg-shadow.alioth.debian.org/
Source0: ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-%{version}.tar.bz2 Source0: ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-%{version}.tar.bz2
@ -16,6 +16,7 @@ Patch0: shadow-4.1.2-redhat.patch
Patch1: shadow-4.1.2-goodname.patch Patch1: shadow-4.1.2-goodname.patch
Patch2: shadow-4.1.2-selinux.patch Patch2: shadow-4.1.2-selinux.patch
Patch3: shadow-4.1.2-sysAccountDownhill.patch Patch3: shadow-4.1.2-sysAccountDownhill.patch
Patch4: shadow-4.1.2-gmSEGV.patch
License: BSD License: BSD
Group: System Environment/Base Group: System Environment/Base
@ -44,6 +45,7 @@ are used for managing group accounts.
%patch1 -p1 -b .goodname %patch1 -p1 -b .goodname
%patch2 -p1 -b .selinux %patch2 -p1 -b .selinux
%patch3 -p1 -b .sysAccountDownhill %patch3 -p1 -b .sysAccountDownhill
%patch4 -p1 -b .gmSEGV
rm po/*.gmo rm po/*.gmo
@ -184,6 +186,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/vigr.8* %{_mandir}/man8/vigr.8*
%changelog %changelog
* Thu Sep 02 2008 Peter Vrabec <pvrabec@redhat.com> 2:4.1.2-5
- fix groupmems issues (#459825)
* Mon Jul 28 2008 Peter Vrabec <pvrabec@redhat.com> 2:4.1.2-4 * Mon Jul 28 2008 Peter Vrabec <pvrabec@redhat.com> 2:4.1.2-4
- fix configure options (#456748) - fix configure options (#456748)