krb5_error_code
krb5_ldap_create_krbcontainer(krb5_context, const char *);
-krb5_error_code
-krb5_ldap_delete_krbcontainer(krb5_context, const char *);
-
#endif
krb5_ldap_server_handle *ldap_server_handle = NULL;
LDAPMessage *result = NULL;
- if (dn == NULL || refattr == NULL) {
- st = EINVAL;
- goto cleanup;
- }
-
SETUP_CONTEXT();
if (ld == NULL) {
GET_HANDLE();
krb5_clear_error_message(context);
/* validate the input parameters */
- if (policy == NULL || policy->name == NULL)
+ if (policy->name == NULL)
return EINVAL;
SETUP_CONTEXT();
krb5_clear_error_message(context);
/* validate the input parameters */
- if (policy == NULL || policy->name == NULL)
+ if (policy->name == NULL)
return EINVAL;
SETUP_CONTEXT();
/* Clear the global error string */
krb5_clear_error_message(context);
- /* validate the input parameters */
- if (pol_dn == NULL)
- return EINVAL;
-
*policy = NULL;
SETUP_CONTEXT();
GET_HANDLE();
/* Clear the global error string */
krb5_clear_error_message(context);
- /* validate the input parameters */
- if (name == NULL) {
- st = EINVAL;
- goto cleanup;
- }
-
st = krb5_ldap_name_to_policydn(context, name, &policy_dn);
if (st != 0)
goto cleanup;
/* Clear the global error string */
krb5_clear_error_message(context);
- /* validate the input parameters */
- if (policy == NULL)
- return EINVAL;
-
SETUP_CONTEXT();
GET_HANDLE();
SETUP_CONTEXT ();
- if (lrealm == NULL) {
- st = EINVAL;
- k5_setmsg(context, st, _("Realm information not available"));
- goto cleanup;
- }
-
if ((st=krb5_ldap_read_realm_params(context, lrealm, &rparam, &mask)) != 0)
goto cleanup;
if (mask == 0)
return 0;
- if (rparams == NULL) {
- st = EINVAL;
- return st;
- }
-
SETUP_CONTEXT ();
/* Check validity of arguments */
/* get ldap handle */
GET_HANDLE ();
- if (dn == NULL) {
- st = EINVAL;
- k5_setmsg(context, st, _("Kerberos Container information is missing"));
- goto cleanup;
- }
-
strval[0] = "krbContainer";
strval[1] = NULL;
if ((st=krb5_add_str_mem_ldap_mod(&mods, "objectclass", LDAP_MOD_ADD, strval)) != 0)
return(st);
}
-/*
- * Delete the Kerberos container in the Directory
- */
-
-krb5_error_code
-krb5_ldap_delete_krbcontainer(krb5_context context, const char *dn)
-{
- LDAP *ld=NULL;
- krb5_error_code st=0;
- kdb5_dal_handle *dal_handle=NULL;
- krb5_ldap_context *ldap_context=NULL;
- krb5_ldap_server_handle *ldap_server_handle=NULL;
-
- SETUP_CONTEXT ();
-
- /* get ldap handle */
- GET_HANDLE ();
-
- if (dn == NULL) {
- st = EINVAL;
- k5_setmsg(context, st, _("Kerberos Container information is missing"));
- goto cleanup;
- }
-
- /* delete the kerberos container */
- if ((st = ldap_delete_ext_s(ld, dn, NULL, NULL)) != LDAP_SUCCESS) {
- int ost = st;
- st = translate_ldap_error (st, OP_ADD);
- k5_setmsg(context, st, _("Kerberos Container delete FAILED: %s"),
- ldap_err2string(ost));
- goto cleanup;
- }
-
-cleanup:
-
- krb5_ldap_put_handle_to_pool(ldap_context, ldap_server_handle);
- return(st);
-}
-
-
/*
* Create Realm in eDirectory. This is used by kdb5_util
*/
SETUP_CONTEXT ();
/* Check input validity ... */
- if (ldap_context->container_dn == NULL ||
- rparams == NULL ||
- rparams->realm_name == NULL ||
- ((mask & LDAP_REALM_SUBTREE) && rparams->subtree == NULL) ||
- ((mask & LDAP_REALM_CONTREF) && rparams->containerref == NULL) ||
- 0) {
- st = EINVAL;
- return st;
- }
+ if (ldap_context->container_dn == NULL || rparams->realm_name == NULL ||
+ ((mask & LDAP_REALM_SUBTREE) && rparams->subtree == NULL) ||
+ ((mask & LDAP_REALM_CONTREF) && rparams->containerref == NULL))
+ return EINVAL;
/* get ldap handle */
GET_HANDLE ();
SETUP_CONTEXT ();
/* validate the input parameter */
- if (lrealm == NULL || ldap_context->container_dn == NULL) {
- st = EINVAL;
- goto cleanup;
- }
+ if (ldap_context->container_dn == NULL)
+ return EINVAL;
/* get ldap handle */
GET_HANDLE ();
krb5_ldap_server_handle *ldap_server_handle=NULL;
/* validate the input parameters */
- if (policy == NULL || policy->policy == NULL) {
- st = EINVAL;
- k5_setmsg(context, st, _("Ticket Policy Name missing"));
- goto cleanup;
- }
+ if (policy->policy == NULL)
+ return EINVAL;
SETUP_CONTEXT();
GET_HANDLE();
krb5_ldap_server_handle *ldap_server_handle=NULL;
/* validate the input parameters */
- if (policy == NULL || policy->policy==NULL) {
- st = EINVAL;
- k5_setmsg(context, st, _("Ticket Policy Name missing"));
- goto cleanup;
- }
+ if (policy->policy == NULL)
+ return EINVAL;
SETUP_CONTEXT();
GET_HANDLE();
krb5_ldap_context *ldap_context=NULL;
krb5_ldap_server_handle *ldap_server_handle=NULL;
- /* validate the input parameters */
- if (policyname == NULL || policy == NULL) {
- st = EINVAL;
- k5_setmsg(context, st, _("Ticket Policy Object information missing"));
- goto cleanup;
- }
-
SETUP_CONTEXT();
GET_HANDLE();
krb5_ldap_context *ldap_context=NULL;
krb5_ldap_server_handle *ldap_server_handle=NULL;
- if (policyname == NULL) {
- st = EINVAL;
- k5_prependmsg(context, st, _("Ticket Policy Object DN missing"));
- goto cleanup;
- }
-
-
SETUP_CONTEXT();
GET_HANDLE();
# * Out-of-memory error conditions
# * Handling of failures from slapd (including krb5_retry_get_ldap_handle)
# * Handling of servers which don't support mod-increment
-# * krb5_ldap_delete_krbcontainer (only happens if krb5_ldap_create fails)
success('LDAP and DB2 KDB tests')