shadow: backport a patch to make newgrp work

Backport a Debian patch to fix the reading of the
gshadow file in order to make newgrp work correctly.

(From OE-Core rev: 3ef8db6217f7c40a9eb063d21ce6f25b16d88d53)

Signed-off-by: Roy.Li <rongqing.li@windriver.com>

[sgw - tweaked commit message]
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Roy.Li 2013-08-20 15:02:49 +08:00 committed by Richard Purdie
parent 26e543cb21
commit 78de8222d6
2 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,36 @@
shadow: Fix parsing of gshadow entries
Upstream-Status: Backport [http://anonscm.debian.org/viewvc/pkg-shadow?view=revision&revision=3096]
newgrp command does not function properly.
Even with the valid password, it outputs: "'Invalid password'"
Signed-off-by: Roy.Li <rongqing.li@windriver.com>
2010-02-14 Michael Bunk <mb@computer-leipzig.com>
* NEWS, lib/gshadow.c: Fix parsing of gshadow entries.
diff -urpN a/lib/gshadow.c b/lib/gshadow.c
--- a/lib/gshadow.c 2013-07-11 10:18:15.745450428 +0800
+++ b/lib/gshadow.c 2013-07-11 10:17:30.465450280 +0800
@@ -222,6 +222,7 @@ void endsgent (void)
if (NULL == buf) {
return NULL;
}
+ buflen = BUFSIZ;
}
if (NULL == fp) {
@@ -229,9 +230,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)

View File

@ -24,6 +24,7 @@ SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \
file://shadow-update-pam-conf.patch \
file://shadow_fix_for_automake-1.12.patch \
file://slackware_fix_for_glib-2.17_crypt.patch \
file://fix-etc-gshadow-reading.patch \
"
SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"