diff options
Diffstat (limited to 'src/back-sch.c')
-rw-r--r-- | src/back-sch.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/back-sch.c b/src/back-sch.c index d0ed323..dd6f92d 100644 --- a/src/back-sch.c +++ b/src/back-sch.c @@ -1448,10 +1448,7 @@ backend_search_cb(Slapi_PBlock *pb) /* If during search of some sets we staged additional lookups, perform them. */ if (cbdata.staged != NULL) { /* Allocate buffer to be used for getpwnam_r/getgrnam_r requests */ - cbdata.nsswitch_buffer_len = MAX(sysconf(_SC_GETPW_R_SIZE_MAX), sysconf(_SC_GETGR_R_SIZE_MAX)); - if (cbdata.nsswitch_buffer_len == -1) { - cbdata.nsswitch_buffer_len = 16384; - } + cbdata.nsswitch_buffer_len = MAX(16384, MAX(sysconf(_SC_GETPW_R_SIZE_MAX), sysconf(_SC_GETGR_R_SIZE_MAX))); cbdata.nsswitch_buffer = malloc(cbdata.nsswitch_buffer_len); /* Go over the list of staged requests and retrieve entries. * It is important to perform the retrieval *without* holding any locks to the map cache */ |