source: trunk/package/busybox/patches/803-id_getgrouplist.patch @ 26738

Last change on this file since 26738 was 26738, checked in by nbd, 6 years ago

busybox: refresh patches

File size: 1.5 KB
  • coreutils/id.c

    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 b  
    1919 
    2020/* This is a NOEXEC applet. Be very careful! */ 
    2121 
     22#define HAVE_GETGROUPLIST 1 
     23 
    2224#if !ENABLE_USE_BB_PWD_GRP 
    2325#if defined(__UCLIBC_MAJOR__) && (__UCLIBC_MAJOR__ == 0) 
    2426#if (__UCLIBC_MINOR__ < 9) || (__UCLIBC_MINOR__ == 9 &&  __UCLIBC_SUBLEVEL__ < 30) 
    25 #error "Sorry, you need at least uClibc version 0.9.30 for id applet to build" 
     27#undef HAVE_GETGROUPLIST 
    2628#endif 
    2729#endif 
    2830#endif 
    static int get_groups(const char *userna 
    8486                /* If the user is a member of more than 
    8587                 * *n groups, then -1 is returned. Otherwise >= 0. 
    8688                 * (and no defined way of detecting errors?!) */ 
     89#if HAVE_GETGROUPLIST 
    8790                m = getgrouplist(username, rgid, groups, n); 
     91#else 
     92                *n = -1; 
     93#endif 
    8894                /* I guess *n < 0 might indicate error. Anyway, 
    8995                 * malloc'ing -1 bytes won't be good, so: */ 
    9096                //if (*n < 0) 
    int id_main(int argc UNUSED_PARAM, char  
    156162                        if (egid != rgid) 
    157163                                status |= print_group(egid, " "); 
    158164                } 
     165#if HAVE_GETGROUPLIST 
    159166                /* We are supplying largish buffer, trying 
    160167                 * to not run get_groups() twice. That might be slow 
    161168                 * ("user database in remote SQL server" case) */ 
    int id_main(int argc UNUSED_PARAM, char  
    183190                } 
    184191                if (ENABLE_FEATURE_CLEAN_UP) 
    185192                        free(groups); 
     193#endif 
    186194#if ENABLE_SELINUX 
    187195                if (is_selinux_enabled()) { 
    188196                        if (getcon(&scontext) == 0) 
Note: See TracBrowser for help on using the repository browser.