diff options
author | Björn Jacke <bj@sernet.de> | 2015-09-10 14:35:32 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2015-09-15 13:32:29 +0200 |
commit | 68801fb888aec17427be08c4f4bea6aaf9a5d411 (patch) | |
tree | d30556b8d1a9d4c791c49266732565d8b901afeb /nsswitch | |
parent | f4bc73f8bcbac7f89b3f7d9a280948b4a07bf763 (diff) | |
download | samba-68801fb888aec17427be08c4f4bea6aaf9a5d411.tar.gz |
nss_winbind: fix hang on Solaris on big groups
The problem with large groups on Solaris in the the NSS winbind module is
Solaris wants the return value to be NSS_UNAVAIL if the buffer given is too
small for getgrnam_r. The current code return NSS_TRYAGAIN which causes
Solaris/Illumos to loop without trying to resize the buffer.
Thanks to Nathan Huff <nhuff@acm.org> for finding this out.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10365
Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Ralph Böhme <rb@sernet.de>
(cherry picked from commit d3e51b9cfe3d56530253571e020af72da1877044)
Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Sep 15 13:32:29 CEST 2015 on sn-devel-104
Diffstat (limited to 'nsswitch')
-rw-r--r-- | nsswitch/winbind_nss_solaris.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/nsswitch/winbind_nss_solaris.c b/nsswitch/winbind_nss_solaris.c index 1d0ac90227d..dfb87e3fdcb 100644 --- a/nsswitch/winbind_nss_solaris.c +++ b/nsswitch/winbind_nss_solaris.c @@ -259,6 +259,9 @@ _nss_winbind_getgrnam_solwrap(nss_backend_t* be, void* args) if(ret == NSS_STATUS_SUCCESS) NSS_ARGS(args)->returnval = (void*) result; + if (NSS_ARGS(args)->erange == ERANGE && ret == NSS_STATUS_TRYAGAIN) + return NSS_STATUS_UNAVAIL; + return ret; } @@ -278,6 +281,9 @@ _nss_winbind_getgrgid_solwrap(nss_backend_t* be, void* args) if(ret == NSS_STATUS_SUCCESS) NSS_ARGS(args)->returnval = (void*) result; + if (NSS_ARGS(args)->erange == ERANGE && ret == NSS_STATUS_TRYAGAIN) + return NSS_STATUS_UNAVAIL; + return ret; } |