From 8d9482059f10642c789fb668526996a1d2eafdb1 Mon Sep 17 00:00:00 2001 From: Peter Vrabec Date: Thu, 6 Jan 2011 09:41:43 +0100 Subject: [PATCH] fix Bug #665780 - fix gshadow functions from shadow utils - make shadow utils use gshadow functions from glibc --- shadow-4.1.4.2-gshadow.patch | 49 ++++++++++++++++++++++++++++++++++++ shadow-utils.spec | 9 ++++++- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 shadow-4.1.4.2-gshadow.patch diff --git a/shadow-4.1.4.2-gshadow.patch b/shadow-4.1.4.2-gshadow.patch new file mode 100644 index 0000000..6e4e911 --- /dev/null +++ b/shadow-4.1.4.2-gshadow.patch @@ -0,0 +1,49 @@ +diff -up shadow-4.1.4.2/configure.gshadow shadow-4.1.4.2/configure +--- shadow-4.1.4.2/configure.gshadow 2011-01-05 16:29:33.355695459 +0100 ++++ shadow-4.1.4.2/configure 2011-01-05 16:29:58.322687480 +0100 +@@ -18220,7 +18220,7 @@ cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + +- #include ++ #include + main() + { + struct sgrp *sg = sgetsgent("test:x::"); +diff -up shadow-4.1.4.2/lib/defines.h.gshadow shadow-4.1.4.2/lib/defines.h +--- shadow-4.1.4.2/lib/defines.h.gshadow 2011-01-05 16:29:21.914687787 +0100 ++++ shadow-4.1.4.2/lib/defines.h 2011-01-05 16:29:58.323739225 +0100 +@@ -134,6 +134,10 @@ char *strchr (), *strrchr (), *strtok () + * - /usr/include/shadow.h exists, but we use our own gshadow.h. + */ + #include ++#if defined(HAVE_SHADOWGRP) ++#include ++#define sg_name sg_namp ++#endif + #if defined(SHADOWGRP) && !defined(GSHADOW) + #include "gshadow_.h" + #endif +diff -up shadow-4.1.4.2/lib/gshadow.c.gshadow shadow-4.1.4.2/lib/gshadow.c +--- shadow-4.1.4.2/lib/gshadow.c.gshadow 2009-06-12 19:50:23.000000000 +0200 ++++ shadow-4.1.4.2/lib/gshadow.c 2011-01-05 16:28:55.207685148 +0100 +@@ -223,6 +223,7 @@ void endsgent (void) + if (NULL == buf) { + return NULL; + } ++ buflen = BUFSIZ; + } + + if (NULL == fp) { +@@ -230,9 +231,9 @@ void endsgent (void) + } + + #ifdef USE_NIS +- while (fgetsx (buf, (int) sizeof buf, fp) == buf) ++ while (fgetsx (buf, (int) buflen, fp) == buf) + #else +- if (fgetsx (buf, (int) sizeof buf, fp) == buf) ++ if (fgetsx (buf, (int) buflen, fp) == buf) + #endif + { + while ( ((cp = strrchr (buf, '\n')) == NULL) diff --git a/shadow-utils.spec b/shadow-utils.spec index a09e6d8..1afc5c5 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.4.2 -Release: 8%{?dist} +Release: 9%{?dist} Epoch: 2 URL: http://pkg-shadow.alioth.debian.org/ Source0: ftp://pkg-shadow.alioth.debian.org/pub/pkg-shadow/shadow-%{version}.tar.bz2 @@ -16,6 +16,7 @@ Patch5: shadow-4.1.4.2-semange.patch Patch6: shadow-4.1.4.2-acl.patch Patch7: shadow-4.1.4.2-underflow.patch Patch8: shadow-4.1.4.2-uflg.patch +Patch9: shadow-4.1.4.2-gshadow.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 .acl %patch7 -p1 -b .underflow %patch8 -p1 -b .uflg +%patch9 -p1 -b .gshadow iconv -f ISO88591 -t utf-8 doc/HOWTO > doc/HOWTO.utf8 cp -f doc/HOWTO.utf8 doc/HOWTO @@ -192,6 +194,11 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man8/vigr.8* %changelog +* Wed Jan 05 2011 Peter Vrabec - 2:4.1.4.2-9 +- fix gshadow functions from shadow utils +- make shadow utils use gshadow functions from glibc + Resolves: #665780 + * Tue Jul 20 2010 Peter Vrabec - 2:4.1.4.2-8 - fix pwck/grpck hang Resolves: #586322