summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRalf Haferkamp <rhafer@suse.de>2011-08-04 15:38:47 +0200
committerStephen Gallagher <sgallagh@redhat.com>2011-08-11 13:19:54 -0400
commit0e1075701d2a8fa15ead6164d9874a1f94142155 (patch)
treed31c5b11fe6c5cf92aba6e6a750375582e0f4ae7
parent174dd7cfef0dfb2a8aee6be54045d40bcac2294c (diff)
downloadsssd-0e1075701d2a8fa15ead6164d9874a1f94142155.tar.gz
sssd-0e1075701d2a8fa15ead6164d9874a1f94142155.tar.xz
sssd-0e1075701d2a8fa15ead6164d9874a1f94142155.zip
Allow the O_NONBLOCK flag to be reset correctly
sssd set the O_NONBLOCK flag on the LDAP socket twice. First in set_fd_flags_and_opts(). And the second time in sdap_async_sys_connect_send() after storing a backup in the local state structure. The backup is later used to restore the original flags (after connect() succeeded). As NONBLOCK was already set before it didn't correctly reset that flag. https://fedorahosted.org/sssd/ticket/952
-rw-r--r--src/util/sss_ldap.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c
index 1394b4d6c..761462ea0 100644
--- a/src/util/sss_ldap.c
+++ b/src/util/sss_ldap.c
@@ -266,20 +266,6 @@ static errno_t set_fd_flags_and_opts(int fd)
return ret;
}
- flags = fcntl(fd, F_GETFL, 0);
- if (flags == -1) {
- ret = errno;
- DEBUG(1, ("fcntl F_GETFL failed [%d][%s].\n", ret, strerror(ret)));
- return ret;
- }
-
- flags = fcntl(fd, F_SETFL, flags| O_NONBLOCK);
- if (flags == -1) {
- ret = errno;
- DEBUG(1, ("fcntl F_SETFL failed [%d][%s].\n", ret, strerror(ret)));
- return ret;
- }
-
/* SO_KEEPALIVE and TCP_NODELAY are set by OpenLDAP client libraries but
* failures are ignored.*/
ret = setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &dummy, sizeof(dummy));