-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We weren't decrementing the count of in-progress authentication
request child processes when they completed successfully. With
this patch, we will now guarantee that the process count is
accurate and that queued requests will be started when a slot is
freed up.

Fixes https://fedorahosted.org/sssd/ticket/660

- -- 
Stephen Gallagher
RHCE 804006346421761

Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkzi8xAACgkQeiVVYja6o6NNCACeIvmDO996YhUrA+qMXJ0K0ftn
6rgAn3k72jNZRSz2OQQec/0RUblGYQ+D
=mdnh
-----END PGP SIGNATURE-----
From e2439746c54489af0c57bade6694ae48ebb01b6c Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Tue, 16 Nov 2010 16:05:50 -0500
Subject: [PATCH] Fix authentication queue code for proxy auth

We weren't decrementing the count of in-progress authentication
request child processes when they completed successfully. With
this patch, we will now guarantee that the process count is
accurate and that queued requests will be started when a slot is
freed up.
---
 src/providers/proxy/proxy_auth.c |   24 ++++++++++++------------
 1 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/providers/proxy/proxy_auth.c b/src/providers/proxy/proxy_auth.c
index 64b38cbedf30d0989f9517763e8281abb67958d8..b0a53ac136b486a74ffe47e83f8477172561aaf0 100644
--- a/src/providers/proxy/proxy_auth.c
+++ b/src/providers/proxy/proxy_auth.c
@@ -720,24 +720,24 @@ static void proxy_child_done(struct tevent_req *req)
     talloc_zfree(req);
     if (ret != EOK) {
         /* Pam child failed */
-        client_ctx->auth_ctx->running--;
         proxy_reply(client_ctx->be_req, DP_ERR_FATAL, ret,
                     "PAM child failed");
+        return;
+    }
 
-        /* Start the next auth in the queue, if any */
-        imm = tevent_create_immediate(client_ctx->be_req->be_ctx->ev);
-        if (imm == NULL) {
-            DEBUG(1, ("tevent_create_immediate failed.\n"));
-            return;
-        }
-
-        tevent_schedule_immediate(imm,
-                                  client_ctx->be_req->be_ctx->ev,
-                                  run_proxy_child_queue,
-                                  client_ctx->auth_ctx);
+    /* Start the next auth in the queue, if any */
+    client_ctx->auth_ctx->running--;
+    imm = tevent_create_immediate(client_ctx->be_req->be_ctx->ev);
+    if (imm == NULL) {
+        DEBUG(1, ("tevent_create_immediate failed.\n"));
         return;
     }
 
+    tevent_schedule_immediate(imm,
+                              client_ctx->be_req->be_ctx->ev,
+                              run_proxy_child_queue,
+                              client_ctx->auth_ctx);
+
     /* Check if we need to save the cached credentials */
     if ((pd->cmd == SSS_PAM_AUTHENTICATE || pd->cmd == SSS_PAM_CHAUTHTOK) &&
             pd->pam_status == PAM_SUCCESS &&
-- 
1.7.3.2

Attachment: 0001-Fix-authentication-queue-code-for-proxy-auth.patch.sig
Description: PGP signature

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to