sss_ldap.c revision e96c468ed06c3378e2aee6992dabe926d79e1a2d
/*
Authors:
Sumit Bose <sbose@redhat.com>
Copyright (C) 2009 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdlib.h>
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
#include "config.h"
#include "util/sss_ldap.h"
{
int optret;
if (optret != LDAP_SUCCESS) {
return EINVAL;
}
return ENOMEM;
}
return EOK;
}
LDAPControl **ctrlp)
{
#ifdef HAVE_LDAP_CONTROL_CREATE
#else
return LDAP_PARAM_ERROR;
}
return LDAP_NO_MEMORY;
}
return LDAP_NO_MEMORY;
}
if (dupval == 0) {
} else {
return LDAP_NO_MEMORY;
}
}
}
return LDAP_SUCCESS;
#endif
}
inline const char *
{
}
#ifdef HAVE_LDAP_INIT_FD
struct sdap_async_sys_connect_state {
long old_flags;
int fd;
struct sockaddr_storage addr;
};
void *priv);
struct tevent_context *ev,
int fd,
{
struct tevent_req *req;
struct sdap_async_sys_connect_state *state;
long flags;
int ret;
if (flags == -1) {
return NULL;
}
struct sdap_async_sys_connect_state);
return NULL;
}
goto done;
}
goto done;
}
switch(ret) {
case EINPROGRESS:
case EINTR:
goto done;
}
return req;
break;
default:
}
done:
}
}
return req;
}
void *priv)
{
struct sdap_async_sys_connect_state);
/* I found the following comment in samba's lib/async_req/async_sock.c:
* Stevens, Network Programming says that if there's a
* successful connect, the socket is only writable. Upon an
* error, it's both readable and writable.
*/
goto done;
}
return;
}
}
done:
} else {
}
}
return;
}
{
return EOK;
}
{
int ret;
long flags;
int dummy = 1;
if (flags == -1) {
return ret;
}
if (flags == -1) {
return ret;
}
if (flags == -1) {
return ret;
}
if (flags == -1) {
return ret;
}
/* SO_KEEPALIVE and TCP_NODELAY are set by OpenLDAP client libraries but
* failures are ignored.*/
if (ret != 0) {
}
if (ret != 0) {
}
return EOK;
}
#endif
struct sss_ldap_init_state {
int sd;
const char *uri;
};
struct tevent_context *ev,
const char *uri,
struct sockaddr_storage *addr,
int addr_len)
{
struct tevent_req *req;
struct sss_ldap_init_state *state;
return NULL;
}
#ifdef HAVE_LDAP_INIT_FD
struct tevent_req *subreq;
goto fail;
}
goto fail;
}
goto fail;
}
return req;
fail:
#else
"will use ldap_initialize with uri [%s].\n", uri));
if (ret == LDAP_SUCCESS) {
} else {
if (ret == LDAP_SERVER_DOWN) {
} else {
}
}
#endif
return req;
}
#ifdef HAVE_LDAP_INIT_FD
{
struct tevent_req);
struct sss_ldap_init_state);
int ret;
int lret;
return;
}
/* Initialize LDAP handler */
if (lret != LDAP_SUCCESS) {
if (lret == LDAP_SERVER_DOWN) {
} else {
}
return;
}
return;
}
#endif
{
struct sss_ldap_init_state);
return EOK;
}