summaryrefslogtreecommitdiffstats
path: root/src/responder/nss/nsssrv.c
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2012-02-17 12:14:39 -0500
committerStephen Gallagher <sgallagh@redhat.com>2012-06-22 11:34:18 -0400
commit4d90a42f5c3aa2956393d0bf21c22416ba01e03e (patch)
tree814f7435cd5a0df32dbc377fba633e5c57bb2ca4 /src/responder/nss/nsssrv.c
parent28ad2dd0b12e695cb5bd47a9d87db550ffff1067 (diff)
downloadsssd-1.5.1-54.el5.tar.gz
sssd-1.5.1-54.el5.tar.xz
sssd-1.5.1-54.el5.zip
RESPONDERS: Make the fd_limit setting configurablesssd-1.5.1-54.elfsssd-1.5.1-54.el5
This code will now attempt first to see if it has privilege to set the value as specified, and if not it will fall back to the previous behavior. So on systems with the CAP_SYS_RESOURCE capability granted to SSSD, it will be able to ignore the limits.conf hard limit. https://fedorahosted.org/sssd/ticket/1197
Diffstat (limited to 'src/responder/nss/nsssrv.c')
-rw-r--r--src/responder/nss/nsssrv.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/responder/nss/nsssrv.c b/src/responder/nss/nsssrv.c
index cfc6c588f..fafd64edd 100644
--- a/src/responder/nss/nsssrv.c
+++ b/src/responder/nss/nsssrv.c
@@ -259,6 +259,7 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
struct nss_ctx *nctx;
int ret, max_retries;
int hret;
+ int fd_limit;
nctx = talloc_zero(mem_ctx, struct nss_ctx);
if (!nctx) {
@@ -317,7 +318,17 @@ int nss_process_init(TALLOC_CTX *mem_ctx,
}
/* Set up file descriptor limits */
- responder_set_fd_limit(DEFAULT_NSS_FD_LIMIT);
+ ret = confdb_get_int(nctx->rctx->cdb, nctx->rctx,
+ CONFDB_NSS_CONF_ENTRY,
+ CONFDB_SERVICE_FD_LIMIT,
+ DEFAULT_NSS_FD_LIMIT,
+ &fd_limit);
+ if (ret != EOK) {
+ DEBUG(0,
+ ("Failed to set up file descriptor limit\n"));
+ return ret;
+ }
+ responder_set_fd_limit(fd_limit);
DEBUG(1, ("NSS Initialization complete\n"));