Read the commit message for more info.

This was causing troubles when I wanted the pam responder to close connection to a client immediately, right after a request is finished.

This code has been in SSSD for years. Simo, as you are the original author, can you review it please?
From 7c49fe46a3fbce1433ad1680a2e12335542706ed Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrez...@redhat.com>
Date: Thu, 4 Oct 2012 11:42:59 +0200
Subject: [PATCH 1/3] do not check for POLLERR, POLLHUP, POLLNVAL when reading
 data

According to the poll manpage, those error are valid only for
output only.

This cause troubles when we send data to a pipe and close the
file descriptor before data is read. The pipe is still readable,
but POLLHUP is detected and we fail to read them.

For example, this may cause a user beeing unable to log in.
---
 src/sss_client/common.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/src/sss_client/common.c b/src/sss_client/common.c
index 5b17515930ce05217d700fa1cf38e3f82182bb49..99cd500d5f0973babfe00561d85b77183122de7b 100644
--- a/src/sss_client/common.c
+++ b/src/sss_client/common.c
@@ -235,9 +235,6 @@ static enum sss_status sss_cli_recv_rep(enum sss_cli_command cmd,
             *errnop = ETIME;
             break;
         case 1:
-            if (pfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
-                *errnop = EPIPE;
-            }
             if (!(pfd.revents & POLLIN)) {
                 *errnop = EBUSY;
             }
-- 
1.7.6.5

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

Reply via email to