r5481 - in glibc-package/trunk/debian: . patches patches/kfreebsd
Author: ps-guest
Date: 2013-02-05 14:59:09 +0000 (Tue, 05 Feb 2013)
New Revision: 5481
Added:
glibc-package/trunk/debian/patches/kfreebsd/local-initgroups-order.diff
Modified:
glibc-package/trunk/debian/changelog
glibc-package/trunk/debian/patches/series.kfreebsd-amd64
glibc-package/trunk/debian/patches/series.kfreebsd-i386
Log:
patches/kfreebsd/local-initgroups-order.diff: always put supplied extra gid as the first entry of group list in setgroups()
Modified: glibc-package/trunk/debian/changelog
===================================================================
--- glibc-package/trunk/debian/changelog 2013-02-04 13:10:53 UTC (rev 5480)
+++ glibc-package/trunk/debian/changelog 2013-02-05 14:59:09 UTC (rev 5481)
@@ -12,6 +12,10 @@
* debian/testsuite-checking/compare.sh: Disable failing the build on test
regressions to ease the pain of ongoing stable/security maintenance.
+ [ Petr Salinger ]
+ * patches/kfreebsd/local-initgroups-order.diff: always put supplied extra
+ gid as the first entry of group list in setgroups(). Closes: #699593.
+
-- Adam Conrad <adconrad@0c3.net> Sun, 30 Dec 2012 10:22:43 -0700
eglibc (2.13-38) unstable; urgency=low
Added: glibc-package/trunk/debian/patches/kfreebsd/local-initgroups-order.diff
===================================================================
--- glibc-package/trunk/debian/patches/kfreebsd/local-initgroups-order.diff (rev 0)
+++ glibc-package/trunk/debian/patches/kfreebsd/local-initgroups-order.diff 2013-02-05 14:59:09 UTC (rev 5481)
@@ -0,0 +1,38 @@
+
+ setgroups(size, groups) changes egid on kfreebsd,
+ precisely groups[0] is the new egid
+
+ initgroups(user, gid) prepares the "groups" list
+ via internal_getgrouplist().
+ It puts supplied gid as the first entry in all but NSCD cases.
+ Fix the remaining NSCD case, see #698102, #699593.
+
+
+--- a/nscd/nscd_initgroups.c
++++ b/nscd/nscd_initgroups.c
+@@ -145,15 +145,23 @@
+ }
+
+ /* Check whether GROUP is part of the mix. If not, add it. */
++ /* The GROUP have to be in the first entry */
+ if (retval >= 0)
+ {
+ int cnt;
++ gid_t sg, tg;
++ sg = group;
+ for (cnt = 0; cnt < retval; ++cnt)
+- if ((*groupsp)[cnt] == group)
++ {
++ tg = (*groupsp)[cnt];
++ (*groupsp)[cnt] = sg;
++ if (tg == group)
+ break;
++ sg = tg;
++ }
+
+ if (cnt == retval)
+- (*groupsp)[retval++] = group;
++ (*groupsp)[retval++] = sg;
+ }
+
+ out_close:
Modified: glibc-package/trunk/debian/patches/series.kfreebsd-amd64
===================================================================
--- glibc-package/trunk/debian/patches/series.kfreebsd-amd64 2013-02-04 13:10:53 UTC (rev 5480)
+++ glibc-package/trunk/debian/patches/series.kfreebsd-amd64 2013-02-05 14:59:09 UTC (rev 5481)
@@ -10,3 +10,4 @@
kfreebsd/local-sysdeps.diff
kfreebsd/local-undef-glibc.diff
kfreebsd/local-use-thr-primitives.diff
+kfreebsd/local-initgroups-order.diff
Modified: glibc-package/trunk/debian/patches/series.kfreebsd-i386
===================================================================
--- glibc-package/trunk/debian/patches/series.kfreebsd-i386 2013-02-04 13:10:53 UTC (rev 5480)
+++ glibc-package/trunk/debian/patches/series.kfreebsd-i386 2013-02-05 14:59:09 UTC (rev 5481)
@@ -10,3 +10,4 @@
kfreebsd/local-sysdeps.diff
kfreebsd/local-undef-glibc.diff
kfreebsd/local-use-thr-primitives.diff
+kfreebsd/local-initgroups-order.diff
Reply to: