[shadow-utils] fix bugs in merge_group_entries()
Tomáš Mráz
tmraz at fedoraproject.org
Tue Jan 29 13:18:04 UTC 2013
commit 778c4c228d29d248a3f3d4e30c350cd1a981d450
Author: Tomas Mraz <tmraz at fedoraproject.org>
Date: Tue Jan 29 14:17:57 2013 +0100
fix bugs in merge_group_entries()
shadow-4.1.5.1-merge-group.patch | 27 +++++++++++++++++++++++++++
shadow-utils.spec | 7 ++++++-
2 files changed, 33 insertions(+), 1 deletions(-)
---
diff --git a/shadow-4.1.5.1-merge-group.patch b/shadow-4.1.5.1-merge-group.patch
new file mode 100644
index 0000000..f5cea10
--- /dev/null
+++ b/shadow-4.1.5.1-merge-group.patch
@@ -0,0 +1,27 @@
+diff -up shadow-4.1.5.1/lib/groupio.c.merge-group shadow-4.1.5.1/lib/groupio.c
+--- shadow-4.1.5.1/lib/groupio.c.merge-group 2011-02-16 21:32:24.000000000 +0100
++++ shadow-4.1.5.1/lib/groupio.c 2013-01-29 13:56:43.049275513 +0100
+@@ -330,12 +330,12 @@ static /*@null@*/struct commonio_entry *
+
+ /* Concatenate the 2 lines */
+ new_line_len = strlen (gr1->line) + strlen (gr2->line) +1;
+- new_line = (char *)malloc ((new_line_len + 1) * sizeof(char*));
++ new_line = (char *)malloc (new_line_len + 1);
+ if (NULL == new_line) {
+ errno = ENOMEM;
+ return NULL;
+ }
+- snprintf(new_line, new_line_len, "%s\n%s", gr1->line, gr2->line);
++ snprintf(new_line, new_line_len + 1, "%s\n%s", gr1->line, gr2->line);
+ new_line[new_line_len] = '\0';
+
+ /* Concatenate the 2 list of members */
+@@ -353,7 +353,7 @@ static /*@null@*/struct commonio_entry *
+ members++;
+ }
+ }
+- new_members = (char **)malloc ( (members+1) * sizeof(char*) );
++ new_members = (char **)calloc (members+1, sizeof(char*));
+ if (NULL == new_members) {
+ free (new_line);
+ errno = ENOMEM;
diff --git a/shadow-utils.spec b/shadow-utils.spec
index e47c351..d654df3 100644
--- a/shadow-utils.spec
+++ b/shadow-utils.spec
@@ -1,7 +1,7 @@
Summary: Utilities for managing accounts and shadow password files
Name: shadow-utils
Version: 4.1.5.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Epoch: 2
URL: http://pkg-shadow.alioth.debian.org/
Source0: http://pkg-shadow.alioth.debian.org/releases/shadow-%{version}.tar.bz2
@@ -15,6 +15,7 @@ Patch3: shadow-4.1.5-uflg.patch
Patch6: shadow-4.1.5.1-selinux.patch
Patch7: shadow-4.1.5-2ndskip.patch
Patch8: shadow-4.1.5.1-backup-mode.patch
+Patch9: shadow-4.1.5.1-merge-group.patch
License: BSD and GPLv2+
Group: System Environment/Base
BuildRequires: libselinux-devel >= 1.25.2-1
@@ -50,6 +51,7 @@ are used for managing group accounts.
%patch6 -p1 -b .selinux
%patch7 -p1 -b .2ndskip
%patch8 -p1 -b .backup-mode
+%patch9 -p1 -b .merge-group
iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8
cp -f doc/HOWTO.utf8 doc/HOWTO
@@ -203,6 +205,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man8/vigr.8*
%changelog
+* Tue Jan 29 2013 Tomas Mraz <tmraz at redhat.com> - 2:4.1.5.1-3
+- fix bugs in merge_group_entries()
+
* Fri Jan 11 2013 Tomas Mraz <tmraz at redhat.com> - 2:4.1.5.1-2
- /etc/default is owned by glibc-common now (#894194)
More information about the scm-commits
mailing list