[SSSD] [PATCH] Set file descriptor limits in pac responder

Sumit Bose sbose at redhat.com
Thu Jul 5 16:36:30 UTC 2012


On Thu, Jul 05, 2012 at 11:28:31AM -0400, Stephen Gallagher wrote:
> On Thu, 2012-07-05 at 13:15 +0200, Sumit Bose wrote:
> > Hi,
> > 
> > the pac responser does not honor the file descriptor limits option. This
> > patch adds it.
> 
> 
> Nack. You are checking for the fd_limit value in the [nss] section
> (CONFDB_NSS_CONF_ENTRY) but you want to be checking the [pac] section.

ah, sorry, I remembered to change the default, but forgot about this.
New version attached.

bye,
Sumit
-------------- next part --------------
From e9e6805237f6b6dc01a86c31f6c74db7c44d2ab8 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Mon, 2 Jul 2012 14:28:03 +0200
Subject: [PATCH] Set file descriptor limits in pac responder

---
 src/responder/pac/pacsrv.c |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/responder/pac/pacsrv.c b/src/responder/pac/pacsrv.c
index b21bb96..db6e6b4 100644
--- a/src/responder/pac/pacsrv.c
+++ b/src/responder/pac/pacsrv.c
@@ -44,6 +44,7 @@
 #include "sbus/sbus_client.h"
 
 #define SSS_PAC_PIPE_NAME "pac"
+#define DEFAULT_PAC_FD_LIMIT 8192
 
 struct sbus_method monitor_pac_methods[] = {
     { MON_CLI_METHOD_PING, monitor_common_pong },
@@ -122,6 +123,7 @@ int pac_process_init(TALLOC_CTX *mem_ctx,
     struct pac_ctx *pac_ctx;
     int ret, max_retries;
     enum idmap_error_code err;
+    int fd_limit;
 
     pac_ctx = talloc_zero(mem_ctx, struct pac_ctx);
     if (!pac_ctx) {
@@ -167,6 +169,19 @@ int pac_process_init(TALLOC_CTX *mem_ctx,
         return EFAULT;
     }
 
+    /* Set up file descriptor limits */
+    ret = confdb_get_int(pac_ctx->rctx->cdb,
+                         CONFDB_PAC_CONF_ENTRY,
+                         CONFDB_SERVICE_FD_LIMIT,
+                         DEFAULT_PAC_FD_LIMIT,
+                         &fd_limit);
+    if (ret != EOK) {
+        DEBUG(SSSDBG_FATAL_FAILURE,
+              ("Failed to set up file descriptor limit\n"));
+        return ret;
+    }
+    responder_set_fd_limit(fd_limit);
+
     DEBUG(SSSDBG_TRACE_FUNC, ("PAC Initialization complete\n"));
 
     return EOK;
-- 
1.7.7.6



More information about the sssd-devel mailing list