summaryrefslogtreecommitdiff
path: root/nsswitch
diff options
context:
space:
mode:
authorBjörn Jacke <bj@sernet.de>2015-09-10 14:35:32 +0200
committerBjoern Jacke <bj@sernet.de>2015-09-11 00:34:30 +0200
commitd3e51b9cfe3d56530253571e020af72da1877044 (patch)
tree4a3beaa59e4a21cdf194f11b015487b9e668d57b /nsswitch
parenta997c7780e69117bcc18b43834275d9bb332c4ad (diff)
downloadsamba-d3e51b9cfe3d56530253571e020af72da1877044.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>
Diffstat (limited to 'nsswitch')
-rw-r--r--nsswitch/winbind_nss_solaris.c6
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;
}