/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
*
* Copyright (c) 2004-2005, Novell, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* * The copyright holder's name is not used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#include "ldap_main.h"
#include "kdb_ldap.h"
#include "ldap_services.h"
#include "ldap_err.h"
#include <libintl.h> /* Solaris Kerberos */
#if defined(HAVE_EDIRECTORY)
/*
* create the service object from Directory
*/
{
int i=0, j=0;
/* validate the input parameter */
goto cleanup;
}
GET_HANDLE();
/* identify the class that the object should belong to. This depends on the servicetype */
strval[0] = "krbService";
realmattr = "krbKdcServers";
realmattr = "krbAdmServers";
realmattr = "krbPwdServers";
} else {
realmattr = "krbKdcServers";
}
goto cleanup;
goto cleanup;
}
goto cleanup;
if (mask & LDAP_SERVICE_SERVICEFLAG) {
service->krbserviceflags)) != 0)
goto cleanup;
}
if (mask & LDAP_SERVICE_HOSTSERVER) {
service->krbhostservers)) != 0)
goto cleanup;
} else {
goto cleanup;
}
}
if (mask & LDAP_SERVICE_REALMREFERENCE) {
unsigned int realmmask=0;
/* check for the validity of the values */
}
service->krbrealmreferences)) != 0)
goto cleanup;
} else {
goto cleanup;
}
}
/* ldap add operation */
goto cleanup;
}
/*
* If the service created has realm/s associated with it, then the realm should be updated
* to have a reference to the service object just created.
*/
if (mask & LDAP_SERVICE_REALMREFERENCE) {
for (i=0; service->krbrealmreferences[i]; ++i) {
"Error adding 'krbRealmReferences' to %s: ",
service->krbrealmreferences[i]);
/* delete service object, status ignored intentionally */
goto cleanup;
}
}
}
if (rdns)
return st;
}
/*
* modify the service object from Directory
*/
{
int i=0, j=0, count=0;
/* validate the input parameter */
goto cleanup;
}
GET_HANDLE();
if (mask & LDAP_SERVICE_SERVICEFLAG) {
service->krbserviceflags)) != 0)
goto cleanup;
}
if (mask & LDAP_SERVICE_HOSTSERVER) {
service->krbhostservers)) != 0)
goto cleanup;
} else {
goto cleanup;
}
}
if (mask & LDAP_SERVICE_REALMREFERENCE) {
unsigned int realmmask=0;
/* check for the validity of the values */
for (j=0; service->krbrealmreferences[j]; ++j) {
}
service->krbrealmreferences)) != 0)
goto cleanup;
/* get the attribute of the realm to be set */
realmattr = "krbKdcServers";
realmattr = "krbAdmservers";
realmattr = "krbPwdServers";
else
realmattr = "krbKdcServers";
/* read the existing list of krbRealmreferences. this will needed */
0,
attr,
0,
NULL,
NULL,
NULL,
0,
&result)) != LDAP_SUCCESS) {
goto cleanup;
}
if (ent) {
goto cleanup;
}
}
} else {
goto cleanup;
}
}
/* ldap modify operation */
goto cleanup;
}
/*
* If the service modified had realm/s associations changed, then the realm should be
* updated to reflect the changes.
*/
if (mask & LDAP_SERVICE_REALMREFERENCE) {
/* get the count of the new list of krbrealmreferences */
for (i=0; service->krbrealmreferences[i]; ++i)
;
/* make a new copy of the krbrealmreferences */
goto cleanup;
goto cleanup;
/* see if some of the attributes have to be deleted */
if (oldrealmrefs) {
/* update the dn represented by the attribute that is to be deleted */
for (i=0; oldrealmrefs[i]; ++i)
goto cleanup;
}
}
/* see if some of the attributes have to be added */
for (i=0; newrealmrefs[i]; ++i)
goto cleanup;
}
}
if (oldrealmrefs) {
for (i=0; oldrealmrefs[i]; ++i)
free (oldrealmrefs[i]);
free (oldrealmrefs);
}
if (newrealmrefs) {
for (i=0; newrealmrefs[i]; ++i)
free (newrealmrefs[i]);
free (newrealmrefs);
}
return st;
}
{
GET_HANDLE();
if (st != 0) {
}
/* NOTE: This should be removed now as the backlinks are going off in OpenLDAP */
/* time to delete krbrealmreferences. This is only for OpenLDAP */
#ifndef HAVE_EDIRECTORY
{
int i=0;
if (service) {
if (service->krbrealmreferences) {
attr = "krbkdcservers";
attr = "krbadmservers";
attr = "krbpwdservers";
for (i=0; service->krbrealmreferences[i]; ++i) {
}
}
}
}
#endif
return st;
}
/*
* This function lists service objects from Directory
*/
char ***services)
{
}
/*
* This function reads the service object from Directory
*/
{
/* validate the input parameter */
goto cleanup;
}
GET_HANDLE();
*omask = 0;
/* the policydn object should be of the krbService object class */
/* Initialize service structure */
goto cleanup;
}
/* allocate tl_data structure to store MASK information */
goto cleanup;
}
}
goto cleanup;
}
goto cleanup;
}
for (i=0; values[i]; ++i) {
break;
}
break;
}
break;
}
}
}
}
if (st != 0) {
} else {
}
return st;
}
/*
* This function frees the krb5_ldap_service_params structure members.
*/
{
int i=0;
return 0;
if (service->krbrealmreferences) {
for (i=0; service->krbrealmreferences[i]; ++i)
}
if (service->krbhostservers) {
for (i=0; service->krbhostservers[i]; ++i)
}
}
return 0;
}
{
GET_HANDLE();
goto cleanup;
if (st) {
}
return st;
}
#endif