diff options
author | Ralf Haferkamp <rhafer@suse.de> | 2011-08-04 15:38:47 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-08-11 13:19:42 -0400 |
commit | 2a644650a1063e8710939299c2a8dbcd7f7460ec (patch) | |
tree | 834b31d9c6783cc3f9a11261ccb8c27977d91f52 /src/util/sss_ldap.c | |
parent | 37b8834d38492c5a8e7ef4f131a0ff3f455276dd (diff) | |
download | sssd-2a644650a1063e8710939299c2a8dbcd7f7460ec.tar.gz sssd-2a644650a1063e8710939299c2a8dbcd7f7460ec.tar.xz sssd-2a644650a1063e8710939299c2a8dbcd7f7460ec.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
Diffstat (limited to 'src/util/sss_ldap.c')
-rw-r--r-- | src/util/sss_ldap.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/util/sss_ldap.c b/src/util/sss_ldap.c index 601885b41..bff7c8dca 100644 --- a/src/util/sss_ldap.c +++ b/src/util/sss_ldap.c @@ -258,20 +258,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)); |