aboutsummaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-05-18 14:38:08 +0100
committerRon Yorston <rmy@pobox.com>2015-05-18 14:38:08 +0100
commit4a9a7addbc23be8e7db385697678f53a9d0b96a1 (patch)
treeeaab6e7b36fac13da1f3d25f167c62912652ab87 /win32
parent10695d3d3472bb5ad7b9f5d9313f073fc67a8f1a (diff)
downloadbusybox-w32-4a9a7addbc23be8e7db385697678f53a9d0b96a1.tar.gz
busybox-w32-4a9a7addbc23be8e7db385697678f53a9d0b96a1.tar.bz2
busybox-w32-4a9a7addbc23be8e7db385697678f53a9d0b96a1.zip
mingw: provide fake getgroups and getgrouplist
This makes it possible to enable the id and groups applets, though the results they return are worthless.
Diffstat (limited to 'win32')
-rw-r--r--win32/mingw.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/win32/mingw.c b/win32/mingw.c
index 5847e0fa0..bb08647a6 100644
--- a/win32/mingw.c
+++ b/win32/mingw.c
@@ -648,6 +648,28 @@ struct group *getgrgid(gid_t gid UNUSED_PARAM)
648 return &g; 648 return &g;
649} 649}
650 650
651int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups)
652{
653 if ( *ngroups == 0 ) {
654 *ngroups = 1;
655 return -1;
656 }
657
658 *ngroups = 1;
659 groups[0] = DEFAULT_GID;
660 return 1;
661}
662
663int getgroups(int n, gid_t *groups)
664{
665 if ( n == 0 ) {
666 return 1;
667 }
668
669 groups[0] = DEFAULT_GID;
670 return 1;
671}
672
651int getlogin_r(char *buf, size_t len) 673int getlogin_r(char *buf, size_t len)
652{ 674{
653 char *name; 675 char *name;