/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <lber.h>
#include <ldap.h>
#include <syslog.h>
#include "fedfs_impl.h"
typedef struct cb_param {
char *mech;
char *authid;
char *authzid;
char *passwd;
char *realm;
} cb_param_t;
/*ARGSUSED*/
static int
{
case SASL_CB_GETREALM:
break;
case SASL_CB_AUTHNAME:
break;
case SASL_CB_PASS:
break;
case SASL_CB_USER:
break;
case SASL_CB_NOECHOPROMPT:
case SASL_CB_ECHOPROMPT:
default:
break;
}
if (ret) {
/*
* No need to do strdup(ret), the data is always
* available in 'defaults' and libldap won't
* free it either. strdup(ret) causes memory
* leak.
*/
} else {
}
interact++;
}
return (LDAP_SUCCESS);
}
LDAP *
{
#ifdef DEBUG
#endif
/*
* Honor the "force_loopback" property if set
*/
if (fedfs_use_loopback() == 1)
host = "localhost";
else
/*
* See what info we have in SMF
*/
}
/*
* If we need encryption, set it up globally.
*/
certpath);
if (rc != LDAP_SUCCESS) {
#ifdef DEBUG
#endif
"ldap_set_option(CERT) failed: %s\n",
goto out;
}
#ifdef DEBUG
else {
}
#endif
}
/*
* Authentication needs some thinking about admin user
*/
/* 5 = strlen("dn: ") + 1 */
if (digest_md5_name == NULL)
goto out;
}
else
/*
* Figure out what we want to do if we get to SASL bind
*/
if (sec == FEDFS_SEC_NONE) {
prefix = "ldap";
do_starttls = 0;
} else if (port == LDAPS_PORT) {
prefix = "ldaps";
do_starttls = 0;
} else {
prefix = "ldap";
do_starttls = 1;
}
goto out;
#ifdef DEBUG
#endif
/*
* Get a handle to an LDAP connection to host:port
*/
if (rc != LDAP_SUCCESS) {
#ifdef DEBUG
#endif
goto out;
}
#ifdef DEBUG
#endif
/*
* We like LDAPv3.
*/
/*
* Start TLS negotiation now if we want it.
*/
if (do_starttls) {
if (rc != LDAP_SUCCESS) {
#ifdef DEBUG
#endif
(void) ldap_unbind(ld);
goto out;
}
#ifdef DEBUG
else {
}
#endif
}
/*
* Try simple bind first, nice for anonymous access.
*/
if (rc != LDAP_SUCCESS) {
#ifdef DEBUG
#endif
}
#ifdef DEBUG
else
#endif
if (rc == LDAP_SUCCESS)
goto out;
/*
* Try SASL bind next.
*/
if (rc != LDAP_SUCCESS) {
#ifdef DEBUG
#endif
"ldap_sasl_interactive_bind_s() failed: %s\n",
}
#ifdef DEBUG
else
#endif
if (rc == LDAP_SUCCESS)
goto out;
(void) ldap_unbind(ld);
goto retry;
}
out:
return (ld);
}
void
{
int i;
return;
for (i = 0; attrs[i]; i++) {
}
}
static int
{
int i;
return (-1);
for (i = 0; i < (num - 1); i++) {
return (-1);
}
}
return (0);
}
static char **
{
char **vals;
return (NULL);
return (NULL);
if (val1)
if (val2)
return (vals);
}
static void
{
int i;
for (i = 0; i < num; i++)
}
static char **
{
int len, n = 0;
s = annotations;
do {
t = s;
s = strchr(t, ',');
if (s != NULL) {
len = s - t;
s++;
} else
if (r == NULL) {
return (NULL);
}
result = r;
return (NULL);
}
} while (s != NULL);
*num = n;
return (result);
}
LDAPMod **
{
int i = 0, n, anum = 0;
char **asplit;
return (NULL);
if (annotations != NULL)
n = 4 + (anum > 0);
return (NULL);
return (NULL);
if (anum > 0) {
}
return (attrs);
}
LDAPMod **
{
int i = 0, n, anum = 0;
int xplen;
char *xpath;
char **asplit;
return (NULL);
if (annotations != NULL)
if (xplen == 0)
return (NULL);
n = 27 + (anum > 0);
return (NULL);
return (NULL);
if (anum > 0) {
}
return (attrs);
}
char *
{
}