#pragma ident "%Z%%M% %I% %E% SMI"
/*
*
* 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.
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "ldap_main.h"
#include "ldap_realm.h"
#include "ldap_principal.h"
#include "ldap_krbcontainer.h"
#include "ldap_err.h"
#include <libintl.h>
/*
* ******************************************************************************
* DAL functions
* ******************************************************************************
*/
/*
* This function will create a krbcontainer and realm on the LDAP Server, with
* the specified attributes.
*/
{
int srv_cnt = 0;
int mask = 0;
#ifdef HAVE_EDIRECTORY
int i = 0, rightsmask = 0;
#endif
/* Clear the global error string */
if (ldap_context == NULL) {
goto cleanup;
}
/* populate ldap_context with ldap specific options */
goto cleanup;
}
if (ldap_context->bind_dn) {
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
if (ldap_context->max_server_conns) {
goto cleanup;
}
goto cleanup;
}
if (ldap_context->bind_pwd) {
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
srv_cnt++;
#ifdef HAVE_EDIRECTORY
goto cleanup;
}
goto cleanup;
}
} else {
unsigned int len=0;
goto cleanup;
}
len);
goto cleanup;
}
}
#endif
} else {
/* ignore hash argument. Might have been passed from create */
/*
* temporary is passed in when kdb5_util load without -update is done.
* This is unsupported by the LDAP plugin.
*/
gettext("creation of LDAP entries aborted, plugin requires -update argument"));
} else {
}
goto cleanup;
}
t_ptr++;
}
if (status) {
goto cleanup;
}
if (status) {
goto cleanup;
}
/* read the kerberos container */
/* Read the kerberos container location from configuration file */
if (ldap_context->conf_section) {
"ldap_kerberos_container_dn", NULL,
goto cleanup;
}
}
"ldap_kerberos_container_dn", NULL,
goto cleanup;
}
}
/* create the kerberos container */
if (status)
goto cleanup;
&(ldap_context->krbcontainer));
if (status) {
goto cleanup;
}
} else if (status) {
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
goto cleanup;
}
/* We just created the Realm container. Here starts our transaction tracking */
/* verify realm object */
&(ldap_context->lrparams),
&mask))) {
goto cleanup;
}
#ifdef HAVE_EDIRECTORY
(mask & LDAP_REALM_PASSWDSERVERS)) {
rightsmask =0;
goto cleanup;
}
}
}
rightsmask = 0;
goto cleanup;
}
}
}
rightsmask = 0;
goto cleanup;
}
}
}
}
#endif
/* If the krbcontainer/realm creation is not complete, do the roll-back here */
if ((krbcontainer_obj_created) && (!realm_obj_created)) {
int rc;
gettext("could not complete roll-back, error deleting Kerberos Container"));
}
/* should call krb5_ldap_free_krbcontainer_params() but can't */
if (rparams)
return(status);
}