summaryrefslogtreecommitdiffstats
path: root/package/busybox/patches/803-id_getgrouplist.patch
diff options
context:
space:
mode:
authornico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-05-25 17:15:39 +0000
committernico <nico@3c298f89-4303-0410-b956-a3cf2f4a3e73>2009-05-25 17:15:39 +0000
commite53ecb012ec4b2b87bb9ab35741241590b552a68 (patch)
tree0f3d3144dd3e93a0865e6f391a65a5cb6fad136a /package/busybox/patches/803-id_getgrouplist.patch
parent622eabc631f8dac5bc622d8fb28b1931a9684d7f (diff)
[package] busybox: update to v1.13.4 (closes: #4279)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@16063 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/busybox/patches/803-id_getgrouplist.patch')
-rw-r--r--package/busybox/patches/803-id_getgrouplist.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/package/busybox/patches/803-id_getgrouplist.patch b/package/busybox/patches/803-id_getgrouplist.patch
new file mode 100644
index 000000000..ddc89f269
--- /dev/null
+++ b/package/busybox/patches/803-id_getgrouplist.patch
@@ -0,0 +1,49 @@
+This patch disable supplementary groups handling in id with uClibc versions
+prior to v0.9.30, which are lacking the 'getgrouplist' function.
+
+Signed-off-by: Nicolas Thill <nico@openwrt.org>
+
+--- a/coreutils/id.c
++++ b/coreutils/id.c
+@@ -17,10 +17,12 @@
+
+ #include "libbb.h"
+
++#define HAVE_GETGROUPLIST 1
++
+ #if !ENABLE_USE_BB_PWD_GRP
+ #if defined(__UCLIBC_MAJOR__) && (__UCLIBC_MAJOR__ == 0)
+ #if (__UCLIBC_MINOR__ < 9) || (__UCLIBC_MINOR__ == 9 && __UCLIBC_SUBLEVEL__ < 30)
+-#error "Sorry, you need at least uClibc version 0.9.30 for id applet to build"
++#undef HAVE_GETGROUPLIST
+ #endif
+ #endif
+ #endif
+@@ -86,7 +88,11 @@ static int get_groups(const char *userna
+ /* If the user is a member of more than
+ * *n groups, then -1 is returned. Otherwise >= 0.
+ * (and no defined way of detecting errors?!) */
++#if HAVE_GETGROUPLIST
+ m = getgrouplist(username, rgid, groups, n);
++#else
++ *n = -1;
++#endif
+ /* I guess *n < 0 might indicate error. Anyway,
+ * malloc'ing -1 bytes won't be good, so: */
+ //if (*n < 0)
+@@ -160,6 +166,7 @@ int id_main(int argc UNUSED_PARAM, char
+ if (egid != rgid)
+ status |= print_group(egid, " ");
+ }
++#if HAVE_GETGROUPLIST
+ /* We are supplying largish buffer, trying
+ * to not run get_groups() twice. That might be slow
+ * ("user database in remote SQL server" case) */
+@@ -187,6 +194,7 @@ int id_main(int argc UNUSED_PARAM, char
+ }
+ if (ENABLE_FEATURE_CLEAN_UP)
+ free(groups);
++#endif
+ #if ENABLE_SELINUX
+ if (is_selinux_enabled()) {
+ if (getcon(&scontext) == 0)