1 /* 2 * lib/kdb/kdb_ldap/ldap_misc.h 3 * 4 * Copyright (c) 2004-2005, Novell, Inc. 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions are met: 9 * 10 * * Redistributions of source code must retain the above copyright notice, 11 * this list of conditions and the following disclaimer. 12 * * Redistributions in binary form must reproduce the above copyright 13 * notice, this list of conditions and the following disclaimer in the 14 * documentation and/or other materials provided with the distribution. 15 * * The copyright holder's name is not used to endorse or promote products 16 * derived from this software without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31 /* 32 * Copyright 2007 Sun Microsystems, Inc. All rights reserved. 33 * Use is subject to license terms. 34 */ 35 36 #ifndef _HAVE_LDAP_MISC_H 37 #define _HAVE_LDAP_MISC_H 1 38 39 #pragma ident "%Z%%M% %I% %E% SMI" 40 41 #include "ldap_services.h" 42 43 /* misc functions */ 44 45 krb5_error_code 46 updateAttribute (LDAP *, char *, char *, char *); 47 48 krb5_error_code 49 deleteAttribute (LDAP *, char *, char *, char *); 50 51 krb5_error_code 52 populateServers(LDAP *, char **, char ***, char *, char **); 53 54 krb5_error_code 55 disjoint_members(char **, char **); 56 57 krb5_error_code 58 is_principal_in_realm(krb5_ldap_context *, krb5_const_principal); 59 60 krb5_error_code 61 checkattributevalue(LDAP *, char *, char *, char **, int *); 62 63 krb5_error_code 64 krb5_get_attributes_mask(krb5_context, krb5_db_entry *, unsigned int *); 65 66 krb5_error_code 67 krb5_get_princ_type(krb5_context, krb5_db_entry *, int *); 68 69 krb5_error_code 70 krb5_get_princ_count(krb5_context, krb5_db_entry *, int *); 71 72 krb5_error_code 73 krb5_get_linkdn(krb5_context, krb5_db_entry *, char ***); 74 75 krb5_error_code 76 krb5_get_userdn(krb5_context, krb5_db_entry *, char **); 77 78 krb5_error_code 79 krb5_get_containerdn(krb5_context, krb5_db_entry *, char **); 80 81 krb5_error_code 82 store_tl_data(krb5_tl_data *, int, void *); 83 84 krb5_error_code 85 decode_tl_data(krb5_tl_data *, int, void **); 86 87 krb5_error_code 88 is_principal_in_realm(krb5_ldap_context *, krb5_const_principal); 89 90 krb5_error_code 91 krb5_get_subtree_info(krb5_ldap_context *, char ***, unsigned int *); 92 93 krb5_error_code 94 krb5_ldap_read_server_params(krb5_context , char *, int); 95 96 krb5_error_code 97 krb5_ldap_free_server_params(krb5_ldap_context *); 98 99 krb5_error_code 100 copy_arrays(char **, char ***, int); 101 102 krb5_error_code 103 krb5_ldap_list(krb5_context, char ***, char *, char *); 104 105 krb5_error_code 106 krb5_ldap_get_value(LDAP *, LDAPMessage *, char *, int *); 107 108 krb5_error_code 109 krb5_ldap_get_string(LDAP *, LDAPMessage *, char *, char **, krb5_boolean *); 110 111 krb5_error_code 112 krb5_ldap_get_strings(LDAP *, LDAPMessage *, char *, char ***, krb5_boolean *); 113 114 krb5_error_code 115 krb5_ldap_get_time(LDAP *, LDAPMessage *, char *, krb5_timestamp *, krb5_boolean *); 116 117 krb5_error_code 118 krb5_add_member(LDAPMod ***, int *); 119 120 krb5_error_code 121 krb5_add_str_mem_ldap_mod(LDAPMod ***, char *, int, char **); 122 123 krb5_error_code 124 krb5_add_ber_mem_ldap_mod(LDAPMod ***, char *, int, struct berval **); 125 126 krb5_error_code 127 krb5_add_int_arr_mem_ldap_mod(LDAPMod ***, char *, int, int *); 128 129 krb5_error_code 130 krb5_add_int_mem_ldap_mod(LDAPMod ***, char *, int , int); 131 132 krb5_error_code 133 krb5_ldap_free_mod_array(LDAPMod **); 134 135 krb5_error_code 136 krb5_ldap_get_reference_count (krb5_context, char *, char *, int *, LDAP *); 137 138 krb5_error_code 139 krb5_ldap_policydn_to_name (krb5_context, char *, char **); 140 141 krb5_error_code 142 krb5_ldap_name_to_policydn (krb5_context, char *, char **); 143 144 krb5_error_code 145 krb5_ldap_get_db_opt(char *, char **, char **); 146 147 krb5_error_code 148 populate_krb5_db_entry(krb5_context context, 149 krb5_ldap_context *ldap_context, 150 LDAP *ld, 151 LDAPMessage *ent, 152 krb5_const_principal princ, 153 krb5_db_entry *entry); 154 155 #endif 156