diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-02 04:17:57 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2014-08-02 06:08:18 +0200 |
commit | 96a291d11f884b18356ba8ef4b12b82d658d8d04 (patch) | |
tree | 8ad328375c4b1754e69cd38ee4e2e13d60c28525 /src/config.c | |
parent | e63fe3b8d058bed15d65728f8e9a7e4093040028 (diff) | |
download | fastd-96a291d11f884b18356ba8ef4b12b82d658d8d04.tar fastd-96a291d11f884b18356ba8ef4b12b82d658d8d04.zip |
Add support for Mac OS X
Diffstat (limited to 'src/config.c')
-rw-r--r-- | src/config.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/config.c b/src/config.c index f2a6dab..18ef34c 100644 --- a/src/config.c +++ b/src/config.c @@ -439,11 +439,17 @@ static void configure_user(void) { if (getgrouplist(conf.user, conf.gid, NULL, &ngroups) < 0) { /* the user has supplementary groups */ - conf.groups = fastd_new0_array(ngroups, gid_t); - if (getgrouplist(conf.user, conf.gid, conf.groups, &ngroups) < 0) + GROUPLIST_TYPE groups[ngroups]; + + if (getgrouplist(conf.user, conf.gid, groups, &ngroups) < 0) exit_errno("getgrouplist"); conf.n_groups = ngroups; + conf.groups = fastd_new_array(ngroups, gid_t); + + int i; + for (i = 0; i < ngroups; i++) + conf.groups[i] = groups[i]; } } } |