diff options
author | Andreas Schneider <asn@samba.org> | 2014-09-19 13:33:10 +0200 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2014-09-19 17:57:14 +0200 |
commit | 7f59711f076e98ece099f6b38ff6da8c80fa6d5e (patch) | |
tree | 9c18c6619f7fd0d8e8dbef09d100b516b65157e6 /nsswitch | |
parent | fe670be5c45e636788934fc45d45ee3c4c52bb50 (diff) | |
download | samba-7f59711f076e98ece099f6b38ff6da8c80fa6d5e.tar.gz |
nsswitch: Skip groups we were not able to map.
If we have configured the idmap_ad backend it is possible that the user
is in a group without a gid set. This will result in (uid_t)-1 as the
gid. We return this invalid gid to NSS which is wrong.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10824
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Sep 19 17:57:14 CEST 2014 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/winbind_nss_linux.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c index 8d66a740a69..70ede3edbd8 100644 --- a/nsswitch/winbind_nss_linux.c +++ b/nsswitch/winbind_nss_linux.c @@ -1101,6 +1101,11 @@ _nss_winbind_initgroups_dyn(char *user, gid_t group, long int *start, continue; } + /* Skip groups without a mapping */ + if (gid_list[i] == (uid_t)-1) { + continue; + } + /* Filled buffer ? If so, resize. */ if (*start == *size) { |