xauth_ldap_config
xauth_ldap_config.pver = $2;
xauth_ldap_config.debug = $2;
xauth_ldap_config.timeout = $2;
if (xauth_ldap_config.uri != NULL)
vfree(xauth_ldap_config.uri);
xauth_ldap_config.uri = vdup($2);
if (xauth_ldap_config.host != NULL)
vfree(xauth_ldap_config.host);
xauth_ldap_config.host = vdup($2);
xauth_ldap_config.port = $2;
xauth_ldap_config.tls = $2;
if (xauth_ldap_config.base != NULL)
vfree(xauth_ldap_config.base);
xauth_ldap_config.base = vdup($2);
xauth_ldap_config.subtree = $2;
if (xauth_ldap_config.bind_dn != NULL)
vfree(xauth_ldap_config.bind_dn);
xauth_ldap_config.bind_dn = vdup($2);
if (xauth_ldap_config.bind_pw != NULL)
vfree(xauth_ldap_config.bind_pw);
xauth_ldap_config.bind_pw = vdup($2);
if (xauth_ldap_config.attr_user != NULL)
vfree(xauth_ldap_config.attr_user);
xauth_ldap_config.attr_user = vdup($2);
if (xauth_ldap_config.attr_addr != NULL)
vfree(xauth_ldap_config.attr_addr);
xauth_ldap_config.attr_addr = vdup($2);
if (xauth_ldap_config.attr_mask != NULL)
vfree(xauth_ldap_config.attr_mask);
xauth_ldap_config.attr_mask = vdup($2);
if (xauth_ldap_config.attr_group != NULL)
vfree(xauth_ldap_config.attr_group);
xauth_ldap_config.attr_group = vdup($2);
if (xauth_ldap_config.attr_member != NULL)
vfree(xauth_ldap_config.attr_member);
xauth_ldap_config.attr_member = vdup($2);
strcpy(atlist[0],xauth_ldap_config.attr_addr->v);
strcpy(atlist[1],xauth_ldap_config.attr_mask->v);
if (xauth_ldap_config.base != NULL)
basedn = xauth_ldap_config.base->v;
if (xauth_ldap_config.subtree)
bv = ldap_get_values_len(ld, le, xauth_ldap_config.attr_addr->v);
bv = ldap_get_values_len(ld, le, xauth_ldap_config.attr_mask->v);
tmplen += strlen(xauth_ldap_config.host->v);
xauth_ldap_config.host->v,
xauth_ldap_config.port );
struct xauth_ldap_config xauth_ldap_config;
&xauth_ldap_config.pver);
if (xauth_ldap_config.tls) {
if ((xauth_ldap_config.bind_dn != NULL)&&
(xauth_ldap_config.bind_pw != NULL))
cred.bv_val = xauth_ldap_config.bind_pw->v;
xauth_ldap_config.bind_dn->v, NULL, &cred,
tmplen += strlen(xauth_ldap_config.attr_group->v);
tmplen += strlen(xauth_ldap_config.attr_member->v);
xauth_ldap_config.attr_group->v, grp,
xauth_ldap_config.attr_member->v, udn);
if (xauth_ldap_config.base != NULL)
basedn = xauth_ldap_config.base->v;
if (xauth_ldap_config.subtree)
xauth_ldap_config.pver = 3;
xauth_ldap_config.debug = 0;
xauth_ldap_config.timeout = -1;
xauth_ldap_config.uri = NULL;
xauth_ldap_config.host = NULL;
xauth_ldap_config.port = LDAP_PORT;
xauth_ldap_config.tls = 0;
xauth_ldap_config.base = NULL;
xauth_ldap_config.subtree = 0;
xauth_ldap_config.bind_dn = NULL;
xauth_ldap_config.bind_pw = NULL;
xauth_ldap_config.auth_type = LDAP_AUTH_SIMPLE;
xauth_ldap_config.attr_user = NULL;
xauth_ldap_config.attr_addr = NULL;
xauth_ldap_config.attr_mask = NULL;
xauth_ldap_config.attr_group = NULL;
xauth_ldap_config.attr_member = NULL;
xauth_ldap_config.host = vmalloc(tmplen);
if (xauth_ldap_config.host == NULL)
memcpy(xauth_ldap_config.host->v, LDAP_DFLT_HOST, tmplen);
xauth_ldap_config.attr_user = vmalloc(tmplen);
if (xauth_ldap_config.attr_user == NULL)
memcpy(xauth_ldap_config.attr_user->v, LDAP_DFLT_USER, tmplen);
xauth_ldap_config.attr_addr = vmalloc(tmplen);
if (xauth_ldap_config.attr_addr == NULL)
memcpy(xauth_ldap_config.attr_addr->v, LDAP_DFLT_ADDR, tmplen);
xauth_ldap_config.attr_mask = vmalloc(tmplen);
if (xauth_ldap_config.attr_mask == NULL)
memcpy(xauth_ldap_config.attr_mask->v, LDAP_DFLT_MASK, tmplen);
xauth_ldap_config.attr_group = vmalloc(tmplen);
if (xauth_ldap_config.attr_group == NULL)
memcpy(xauth_ldap_config.attr_group->v, LDAP_DFLT_GROUP, tmplen);
xauth_ldap_config.attr_member = vmalloc(tmplen);
if (xauth_ldap_config.attr_member == NULL)
memcpy(xauth_ldap_config.attr_member->v, LDAP_DFLT_MEMBER, tmplen);
if (xauth_ldap_config.uri != NULL) {
tmplen = strlen(xauth_ldap_config.uri->v);
sprintf(init,"%s", xauth_ldap_config.uri->v);
tmplen += strlen(xauth_ldap_config.host->v);
xauth_ldap_config.host->v,
xauth_ldap_config.port );
ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, &xauth_ldap_config.debug);
ber_set_option(NULL, LBER_OPT_DEBUG_LEVEL, &xauth_ldap_config.debug);
&xauth_ldap_config.pver)) != LDAP_OPT_SUCCESS) {
xauth_ldap_config.pver,
if (xauth_ldap_config.timeout > 0) {
timeout1.tv_sec = xauth_ldap_config.timeout;
xauth_ldap_config.timeout,
if (xauth_ldap_config.tls) {
if ((xauth_ldap_config.bind_dn != NULL)&&
(xauth_ldap_config.bind_pw != NULL))
cred.bv_val = xauth_ldap_config.bind_pw->v;
xauth_ldap_config.bind_dn->v, LDAP_SASL_SIMPLE, &cred,
tmplen = strlen(xauth_ldap_config.attr_user->v);
xauth_ldap_config.attr_user->v, usr);
tmplen = strlen(xauth_ldap_config.attr_addr->v) + 1;
tmplen = strlen(xauth_ldap_config.attr_mask->v) + 1;
extern struct xauth_ldap_config xauth_ldap_config;