Note: this patch has been removed in OpenWrt, we in Freetz however still need it as we still (have to) support uClibc versions prior to 0.9.30 --- coreutils/id.c +++ coreutils/id.c @@ -62,9 +62,12 @@ /* This is a NOEXEC applet. Be very careful! */ +#define HAVE_GETGROUPLIST 1 + #if !ENABLE_USE_BB_PWD_GRP #if defined(__UCLIBC__) && UCLIBC_VERSION < KERNEL_VERSION(0, 9, 30) -#error "Sorry, you need at least uClibc version 0.9.30 for id applet to build" +#undef HAVE_GETGROUPLIST +#define HAVE_GETGROUPLIST 0 #endif #endif @@ -125,7 +127,11 @@ /* 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) @@ -207,6 +213,7 @@ 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) */ @@ -233,6 +240,7 @@ } if (ENABLE_FEATURE_CLEAN_UP) free(groups); +#endif #if ENABLE_SELINUX if (is_selinux_enabled()) { if (getcon(&scontext) == 0)