From 4a9a7addbc23be8e7db385697678f53a9d0b96a1 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Mon, 18 May 2015 14:38:08 +0100 Subject: mingw: provide fake getgroups and getgrouplist This makes it possible to enable the id and groups applets, though the results they return are worthless. --- win32/mingw.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'win32') 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) return &g; } +int getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups) +{ + if ( *ngroups == 0 ) { + *ngroups = 1; + return -1; + } + + *ngroups = 1; + groups[0] = DEFAULT_GID; + return 1; +} + +int getgroups(int n, gid_t *groups) +{ + if ( n == 0 ) { + return 1; + } + + groups[0] = DEFAULT_GID; + return 1; +} + int getlogin_r(char *buf, size_t len) { char *name; -- cgit v1.2.3-55-g6feb