[SSSD] [sssd PR#511][synchronized] Do not shutdown KCM/Secrets responders when activities are happening ...

2018-04-27 Thread fidencio
   URL: https://github.com/SSSD/sssd/pull/511
Author: fidencio
 Title: #511: Do not shutdown KCM/Secrets responders when activities are 
happening ...
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/511/head:pr511
git checkout pr511
From 1196a2dd39edeb432a62cf82a0d43e1f8eb3e0be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:20:31 +0100
Subject: [PATCH 1/8] SECRETS: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the secrets responder itself
and not by responder's common code, we have to take care of re-setting
the last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/secrets/secsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/secrets/secsrv_cmd.c b/src/responder/secrets/secsrv_cmd.c
index fa5970504..1b405a23e 100644
--- a/src/responder/secrets/secsrv_cmd.c
+++ b/src/responder/secrets/secsrv_cmd.c
@@ -588,6 +588,9 @@ static void sec_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From eeefb4889403f338d44716eceb2617319ce55e13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:24:05 +0100
Subject: [PATCH 2/8] KCM: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the kcm responder itself and
not by responder's common code, we have to take care of re-setting the
last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/kcm/kcmsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
index 728979da9..9061ff186 100644
--- a/src/responder/kcm/kcmsrv_cmd.c
+++ b/src/responder/kcm/kcmsrv_cmd.c
@@ -615,6 +615,9 @@ static void kcm_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From d899224d7e43a246b94ff930ac7da175d6a3bd42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 17:06:39 +0100
Subject: [PATCH 3/8] RESPONDER: Add sss_client_fd_handler()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently we have 3 functions to handle client fds:
- sec_fd_handler(): for secrets responder
- kcm_fd_handler(): for kcm responder
- client_fd_handler(): for all the others reponders

As those functions only differ by the functions used to handle sending
and receiving data to the fds, let's create a generic function that
receives the specific send_fn() and recv_fn() functions.

With this newly introduced function we'll be able to simply remove
duplicated code from those 3 handlers and just call
sss_client_fd_handler() from all of those.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/common/responder.h|  5 +
 src/responder/common/responder_common.c | 31 +++
 2 files changed, 36 insertions(+)

diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 9400e4b60..987a5d17d 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -197,6 +197,11 @@ typedef int (*connection_setup_t)(struct cli_ctx *cctx);
 
 int sss_connection_setup(struct cli_ctx *cctx);
 
+void sss_client_fd_handler(void *ptr,
+   void (*recv_fn) (struct cli_ctx *cctx),
+   void (*send_fn) (struct cli_ctx *cctx),
+   uint16_t flags);
+
 int sss_process_init(TALLOC_CTX *mem_ctx,
  struct tevent_context *ev,
  struct confdb_ctx *cdb,
diff --git 

[SSSD] [sssd PR#511][synchronized] Do not shutdown KCM/Secrets responders when activities are happening ...

2018-04-27 Thread fidencio
   URL: https://github.com/SSSD/sssd/pull/511
Author: fidencio
 Title: #511: Do not shutdown KCM/Secrets responders when activities are 
happening ...
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/511/head:pr511
git checkout pr511
From 1196a2dd39edeb432a62cf82a0d43e1f8eb3e0be Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:20:31 +0100
Subject: [PATCH 1/8] SECRETS: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the secrets responder itself
and not by responder's common code, we have to take care of re-setting
the last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/secrets/secsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/secrets/secsrv_cmd.c b/src/responder/secrets/secsrv_cmd.c
index fa5970504..1b405a23e 100644
--- a/src/responder/secrets/secsrv_cmd.c
+++ b/src/responder/secrets/secsrv_cmd.c
@@ -588,6 +588,9 @@ static void sec_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From eeefb4889403f338d44716eceb2617319ce55e13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:24:05 +0100
Subject: [PATCH 2/8] KCM: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the kcm responder itself and
not by responder's common code, we have to take care of re-setting the
last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/kcm/kcmsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
index 728979da9..9061ff186 100644
--- a/src/responder/kcm/kcmsrv_cmd.c
+++ b/src/responder/kcm/kcmsrv_cmd.c
@@ -615,6 +615,9 @@ static void kcm_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From d899224d7e43a246b94ff930ac7da175d6a3bd42 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 17:06:39 +0100
Subject: [PATCH 3/8] RESPONDER: Add sss_client_fd_handler()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently we have 3 functions to handle client fds:
- sec_fd_handler(): for secrets responder
- kcm_fd_handler(): for kcm responder
- client_fd_handler(): for all the others reponders

As those functions only differ by the functions used to handle sending
and receiving data to the fds, let's create a generic function that
receives the specific send_fn() and recv_fn() functions.

With this newly introduced function we'll be able to simply remove
duplicated code from those 3 handlers and just call
sss_client_fd_handler() from all of those.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/common/responder.h|  5 +
 src/responder/common/responder_common.c | 31 +++
 2 files changed, 36 insertions(+)

diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 9400e4b60..987a5d17d 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -197,6 +197,11 @@ typedef int (*connection_setup_t)(struct cli_ctx *cctx);
 
 int sss_connection_setup(struct cli_ctx *cctx);
 
+void sss_client_fd_handler(void *ptr,
+   void (*recv_fn) (struct cli_ctx *cctx),
+   void (*send_fn) (struct cli_ctx *cctx),
+   uint16_t flags);
+
 int sss_process_init(TALLOC_CTX *mem_ctx,
  struct tevent_context *ev,
  struct confdb_ctx *cdb,
diff --git 

[SSSD] [sssd PR#511][synchronized] Do not shutdown KCM/Secrets responders when activities are happening ...

2018-03-29 Thread fidencio
   URL: https://github.com/SSSD/sssd/pull/511
Author: fidencio
 Title: #511: Do not shutdown KCM/Secrets responders when activities are 
happening ...
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/511/head:pr511
git checkout pr511
From 5eb00fd032cf6393db6ee75a11e81b9192cf1247 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:20:31 +0100
Subject: [PATCH 1/6] SECRETS: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the secrets responder itself
and not by responder's common code, we have to take care of re-setting
the last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/secrets/secsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/secrets/secsrv_cmd.c b/src/responder/secrets/secsrv_cmd.c
index fa5970504..1b405a23e 100644
--- a/src/responder/secrets/secsrv_cmd.c
+++ b/src/responder/secrets/secsrv_cmd.c
@@ -588,6 +588,9 @@ static void sec_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From cd172dd8ba979b8fb029c487343d32a69f973afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:24:05 +0100
Subject: [PATCH 2/6] KCM: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the kcm responder itself and
not by responder's common code, we have to take care of re-setting the
last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/kcm/kcmsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
index 0b933f0b4..903c89417 100644
--- a/src/responder/kcm/kcmsrv_cmd.c
+++ b/src/responder/kcm/kcmsrv_cmd.c
@@ -588,6 +588,9 @@ static void kcm_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From 42d0f1ae4392f43d04740b3696e8b1d4d9429c03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 17:06:39 +0100
Subject: [PATCH 3/6] RESPONDER: Add sss_client_fd_handler()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently we have 3 functions to handle client fds:
- sec_fd_handler(): for secrets responder
- kcm_fd_handler(): for kcm responder
- client_fd_handler(): for all the others reponders

As those functions only differ by the functions used to handle sending
and receiving data to the fds, let's create a generic function that
receives the specific send_fn() and recv_fn() functions.

With this newly introduced function we'll be able to simply remove
duplicated code from those 3 handlers and just call
sss_client_fd_handler() from all of those.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/common/responder.h|  5 +
 src/responder/common/responder_common.c | 31 +++
 2 files changed, 36 insertions(+)

diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 9400e4b60..987a5d17d 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -197,6 +197,11 @@ typedef int (*connection_setup_t)(struct cli_ctx *cctx);
 
 int sss_connection_setup(struct cli_ctx *cctx);
 
+void sss_client_fd_handler(void *ptr,
+   void (*recv_fn) (struct cli_ctx *cctx),
+   void (*send_fn) (struct cli_ctx *cctx),
+   uint16_t flags);
+
 int sss_process_init(TALLOC_CTX *mem_ctx,
  struct tevent_context *ev,
  struct confdb_ctx *cdb,
diff --git 

[SSSD] [sssd PR#511][synchronized] Do not shutdown KCM/Secrets responders when activities are happening ...

2018-02-08 Thread fidencio
   URL: https://github.com/SSSD/sssd/pull/511
Author: fidencio
 Title: #511: Do not shutdown KCM/Secrets responders when activities are 
happening ...
Action: synchronized

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/511/head:pr511
git checkout pr511
From 5eb00fd032cf6393db6ee75a11e81b9192cf1247 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:20:31 +0100
Subject: [PATCH 1/8] SECRETS: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the secrets responder itself
and not by responder's common code, we have to take care of re-setting
the last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/secrets/secsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/secrets/secsrv_cmd.c b/src/responder/secrets/secsrv_cmd.c
index fa5970504..1b405a23e 100644
--- a/src/responder/secrets/secsrv_cmd.c
+++ b/src/responder/secrets/secsrv_cmd.c
@@ -588,6 +588,9 @@ static void sec_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From cd172dd8ba979b8fb029c487343d32a69f973afb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 13:24:05 +0100
Subject: [PATCH 2/8] KCM: reset last_request_time on any activity
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

As all the activities are being handled by the kcm responder itself and
not by responder's common code, we have to take care of re-setting the
last_request_time by ourselves here.

Without this patch, the responder would be shot down after reaching the
idle_timeout with activities happening or not.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/kcm/kcmsrv_cmd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/responder/kcm/kcmsrv_cmd.c b/src/responder/kcm/kcmsrv_cmd.c
index 0b933f0b4..903c89417 100644
--- a/src/responder/kcm/kcmsrv_cmd.c
+++ b/src/responder/kcm/kcmsrv_cmd.c
@@ -588,6 +588,9 @@ static void kcm_fd_handler(struct tevent_context *ev,
 errno_t ret;
 struct cli_ctx *cctx = talloc_get_type(ptr, struct cli_ctx);
 
+/* Always reset the responder idle timer on any activity */
+cctx->rctx->last_request_time = time(NULL);
+
 /* Always reset the idle timer on any activity */
 ret = reset_client_idle_timer(cctx);
 if (ret != EOK) {

From 42d0f1ae4392f43d04740b3696e8b1d4d9429c03 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= 
Date: Wed, 7 Feb 2018 17:06:39 +0100
Subject: [PATCH 3/8] RESPONDER: Add sss_client_fd_handler()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Currently we have 3 functions to handle client fds:
- sec_fd_handler(): for secrets responder
- kcm_fd_handler(): for kcm responder
- client_fd_handler(): for all the others reponders

As those functions only differ by the functions used to handle sending
and receiving data to the fds, let's create a generic function that
receives the specific send_fn() and recv_fn() functions.

With this newly introduced function we'll be able to simply remove
duplicated code from those 3 handlers and just call
sss_client_fd_handler() from all of those.

Resolves:
https://pagure.io/SSSD/sssd/issue/3633

Signed-off-by: Fabiano Fidêncio 
---
 src/responder/common/responder.h|  5 +
 src/responder/common/responder_common.c | 31 +++
 2 files changed, 36 insertions(+)

diff --git a/src/responder/common/responder.h b/src/responder/common/responder.h
index 9400e4b60..987a5d17d 100644
--- a/src/responder/common/responder.h
+++ b/src/responder/common/responder.h
@@ -197,6 +197,11 @@ typedef int (*connection_setup_t)(struct cli_ctx *cctx);
 
 int sss_connection_setup(struct cli_ctx *cctx);
 
+void sss_client_fd_handler(void *ptr,
+   void (*recv_fn) (struct cli_ctx *cctx),
+   void (*send_fn) (struct cli_ctx *cctx),
+   uint16_t flags);
+
 int sss_process_init(TALLOC_CTX *mem_ctx,
  struct tevent_context *ev,
  struct confdb_ctx *cdb,
diff --git