diff options
author | Luke Leighton <lkcl@samba.org> | 1998-12-03 17:41:14 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-12-03 17:41:14 +0000 |
commit | f3787515d67b80a91786cfdd2fd2fb5972b4b094 (patch) | |
tree | d2eba077da9ad5218d817d20f35de9a4cebcdbd2 /source3/smbd | |
parent | 8d08fb732349e50d287aa864fbf57ecc51b55562 (diff) | |
download | samba-f3787515d67b80a91786cfdd2fd2fb5972b4b094.tar.gz samba-f3787515d67b80a91786cfdd2fd2fb5972b4b094.tar.bz2 samba-f3787515d67b80a91786cfdd2fd2fb5972b4b094.zip |
moved get_unixgroups it will be needed by the unix instance of the group
DB API
(This used to be commit ef58e48bc9af338ed6c734205d4faf82371284ac)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/password.c | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/source3/smbd/password.c b/source3/smbd/password.c index ed47e6d3e5..8718e75c3b 100644 --- a/source3/smbd/password.c +++ b/source3/smbd/password.c @@ -150,55 +150,6 @@ char *validated_username(uint16 vuid) } -/**************************************************************************** -Setup the groups a user belongs to. -****************************************************************************/ -int get_unixgroups(char *user, uid_t uid, gid_t gid, int *p_ngroups, gid_t **p_groups) -{ - int i,ngroups; - gid_t grp = 0; - gid_t *groups = NULL; - - if (-1 == initgroups(user,gid)) - { - if (getuid() == 0) - { - DEBUG(0,("Unable to initgroups!\n")); - if (gid < 0 || gid > 16000 || uid < 0 || uid > 16000) - { - DEBUG(0,("This is probably a problem with the account %s\n", user)); - } - } - return -1; - } - - ngroups = sys_getgroups(0,&grp); - if (ngroups <= 0) - { - ngroups = 32; - } - - if((groups = (gid_t *)malloc(sizeof(gid_t)*ngroups)) == NULL) - { - DEBUG(0,("get_unixgroups malloc fail !\n")); - return -1; - } - - ngroups = sys_getgroups(ngroups,groups); - - (*p_ngroups) = ngroups; - (*p_groups) = groups; - - DEBUG( 3, ( "%s is in %d groups: ", user, ngroups ) ); - for (i = 0; i < ngroups; i++ ) - { - DEBUG( 3, ( "%s%d", (i ? ", " : ""), (int)groups[i] ) ); - } - DEBUG( 3, ( "\n" ) ); - - return 0; -} - /**************************************************************************** register a uid/name pair as being valid and that a valid password |