summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2014-09-19 13:33:10 +0200
committerKarolin Seeger <kseeger@samba.org>2014-09-27 23:12:49 +0200
commit7bbf54d232e7a43833520a3eebda05fcdf8dca27 (patch)
treeddce8409abb0a13326becaa66c2683e98641ca7d /nsswitch
parentbcc891287b9bde839af8514062360afc0bbcca81 (diff)
downloadsamba-7bbf54d232e7a43833520a3eebda05fcdf8dca27.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 (cherry picked from commit 7f59711f076e98ece099f6b38ff6da8c80fa6d5e) Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org> Autobuild-Date(v4-1-test): Sat Sep 27 23:12:49 CEST 2014 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/winbind_nss_linux.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/nsswitch/winbind_nss_linux.c b/nsswitch/winbind_nss_linux.c
index 8d66a740a6..70ede3edbd 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) {