summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorGreg Hudson <ghudson@mit.edu>2012-11-17 20:19:43 -0500
committerGreg Hudson <ghudson@mit.edu>2012-12-20 11:35:42 -0500
commitcde9eaa11a8b7528c2ca736fceb746a847cc8688 (patch)
treeb3375f6143ba09e32c87fe6198da053100abec54 /src/plugins
parentbb76891f5386526bdf91bc790c614fc9296cb5fa (diff)
downloadkrb5-cde9eaa11a8b7528c2ca736fceb746a847cc8688.tar.gz
krb5-cde9eaa11a8b7528c2ca736fceb746a847cc8688.tar.xz
krb5-cde9eaa11a8b7528c2ca736fceb746a847cc8688.zip
Remove unused functions in the LDAP KDB module
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/Makefile.in2
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c74
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c247
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h18
-rw-r--r--src/plugins/kdb/ldap/libkdb_ldap/libkdb_ldap.exports1
5 files changed, 0 insertions, 342 deletions
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in b/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in
index 668f77329e..fd65da8cc2 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in
+++ b/src/plugins/kdb/ldap/libkdb_ldap/Makefile.in
@@ -9,10 +9,8 @@ PROG_RPATH=$(KRB5_LIBDIR)
# is keeping them separate important?
DEFINES = \
-Dkrb5_dbe_lookup_last_pwd_change=kdb_ldap_dbe_lookup_last_pwd_change \
- -Dkrb5_dbe_lookup_mod_princ_data=kdb_ldap_dbe_lookup_mod_princ_data \
-Dkrb5_dbe_lookup_tl_data=kdb_ldap_dbe_lookup_tl_data \
-Dkrb5_dbe_update_last_pwd_change=kdb_ldap_dbe_update_last_pwd_change \
- -Dkrb5_dbe_update_mod_princ_data=kdb_ldap_dbe_update_mod_princ_data \
-Dkrb5_dbe_update_tl_data=kdb_ldap_dbe_update_tl_data
DEFS=
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c b/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c
index dc1c4df27e..4cac857230 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/kdb_xdr.c
@@ -139,77 +139,3 @@ krb5_dbe_lookup_last_pwd_change(krb5_context context, krb5_db_entry *entry,
return(0);
}
-
-/* it seems odd that there's no function to remove a tl_data, but if
- I need one, I'll add one */
-
-krb5_error_code
-krb5_dbe_update_mod_princ_data(krb5_context context, krb5_db_entry *entry,
- krb5_timestamp mod_date,
- krb5_const_principal mod_princ)
-{
- krb5_tl_data tl_data;
-
- krb5_error_code retval = 0;
- krb5_octet * nextloc = 0;
- char * unparse_mod_princ = 0;
- unsigned int unparse_mod_princ_size;
-
- if ((retval = krb5_unparse_name(context, mod_princ,
- &unparse_mod_princ)))
- return(retval);
-
- unparse_mod_princ_size = strlen(unparse_mod_princ) + 1;
-
- if ((nextloc = (krb5_octet *) malloc(unparse_mod_princ_size + 4))
- == NULL) {
- free(unparse_mod_princ);
- return(ENOMEM);
- }
-
- tl_data.tl_data_type = KRB5_TL_MOD_PRINC;
- tl_data.tl_data_length = unparse_mod_princ_size + 4;
- tl_data.tl_data_contents = nextloc;
-
- /* Mod Date */
- krb5_kdb_encode_int32(mod_date, nextloc);
-
- /* Mod Princ */
- memcpy(nextloc+4, unparse_mod_princ, unparse_mod_princ_size);
-
- retval = krb5_dbe_update_tl_data(context, entry, &tl_data);
-
- free(unparse_mod_princ);
- free(nextloc);
-
- return(retval);
-}
-
-krb5_error_code
-krb5_dbe_lookup_mod_princ_data(krb5_context context, krb5_db_entry *entry,
- krb5_timestamp *mod_time,
- krb5_principal *mod_princ)
-{
- krb5_tl_data tl_data;
- krb5_error_code code;
-
- tl_data.tl_data_type = KRB5_TL_MOD_PRINC;
-
- if ((code = krb5_dbe_lookup_tl_data(context, entry, &tl_data)))
- return(code);
-
- if ((tl_data.tl_data_length < 5) ||
- (tl_data.tl_data_contents[tl_data.tl_data_length-1] != '\0'))
- return(KRB5_KDB_TRUNCATED_RECORD);
-
- /* Mod Date */
- krb5_kdb_decode_int32(tl_data.tl_data_contents, *mod_time);
-
- /* Mod Princ */
- if ((code = krb5_parse_name(context,
- (const char *) (tl_data.tl_data_contents+4),
- mod_princ)))
- return(code);
-
- return(0);
-}
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
index 55a8eb57e7..02e3b1862b 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
+++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
@@ -974,225 +974,6 @@ cleanup:
}
-/*
- * This function updates a single attribute with a single value of a
- * specified dn. This function is mainly used to update
- * krbRealmReferences, krbKdcServers, krbAdminServers... when KDC,
- * ADMIN, PASSWD servers are associated with some realms or vice
- * versa.
- */
-
-krb5_error_code
-updateAttribute(LDAP *ld, char *dn, char *attribute, char *value)
-{
- int st=0;
- LDAPMod modAttr, *mods[2]={NULL};
- char *values[2]={NULL};
-
- values[0] = value;
-
- /* data to update the {attr,attrval} combination */
- memset(&modAttr, 0, sizeof(modAttr));
- modAttr.mod_type = attribute;
- modAttr.mod_op = LDAP_MOD_ADD;
- modAttr.mod_values = values;
- mods[0] = &modAttr;
-
- /* ldap modify operation */
- st = ldap_modify_ext_s(ld, dn, mods, NULL, NULL);
-
- /* if the {attr,attrval} combination is already present return a success
- * LDAP_ALREADY_EXISTS is for single-valued attribute
- * LDAP_TYPE_OR_VALUE_EXISTS is for multi-valued attribute
- */
- if (st == LDAP_ALREADY_EXISTS || st == LDAP_TYPE_OR_VALUE_EXISTS)
- st = 0;
-
- if (st != 0) {
- st = set_ldap_error (0, st, OP_MOD);
- }
-
- return st;
-}
-
-/*
- * This function deletes a single attribute with a single value of a
- * specified dn. This function is mainly used to delete
- * krbRealmReferences, krbKdcServers, krbAdminServers... when KDC,
- * ADMIN, PASSWD servers are disassociated with some realms or vice
- * versa.
- */
-
-krb5_error_code
-deleteAttribute(LDAP *ld, char *dn, char *attribute, char *value)
-{
- krb5_error_code st=0;
- LDAPMod modAttr, *mods[2]={NULL};
- char *values[2]={NULL};
-
- values[0] = value;
-
- /* data to delete the {attr,attrval} combination */
- memset(&modAttr, 0, sizeof(modAttr));
- modAttr.mod_type = attribute;
- modAttr.mod_op = LDAP_MOD_DELETE;
- modAttr.mod_values = values;
- mods[0] = &modAttr;
-
- /* ldap modify operation */
- st = ldap_modify_ext_s(ld, dn, mods, NULL, NULL);
-
- /* if either the attribute or the attribute value is missing return a success */
- if (st == LDAP_NO_SUCH_ATTRIBUTE || st == LDAP_UNDEFINED_TYPE)
- st = 0;
-
- if (st != 0) {
- st = set_ldap_error (0, st, OP_MOD);
- }
-
- return st;
-}
-
-
-/*
- * This function takes in 2 string arrays, compares them to remove the
- * matching entries. The first array is the original list and the
- * second array is the modified list. Removing the matching entries
- * will result in a reduced array, where the left over first array
- * elements are the deleted entries and the left over second array
- * elements are the added entries. These additions and deletions has
- * resulted in the modified second array.
- */
-
-krb5_error_code
-disjoint_members(char **src, char **dest)
-{
- int i=0, j=0, slen=0, dlen=0;
-
- /* validate the input parameters */
- if (src == NULL || dest == NULL)
- return 0;
-
- /* compute the first array length */
- for (i=0;src[i]; ++i)
- ;
-
- /* return if the length is 0 */
- if (i==0)
- return 0;
-
- /* index of the last element and also the length of the array */
- slen = i-1;
-
- /* compute the second array length */
- for (i=0;dest[i]; ++i)
- ;
-
- /* return if the length is 0 */
- if (i==0)
- return 0;
-
- /* index of the last element and also the length of the array */
- dlen = i-1;
-
- /* check for the similar elements and delete them from both the arrays */
- for (i=0; src[i]; ++i) {
-
- for (j=0; dest[j]; ++j) {
-
- /* if the element are same */
- if (strcasecmp(src[i], dest[j]) == 0) {
- /*
- * If the matched element is in the middle, then copy
- * the last element to the matched index.
- */
- if (i != slen) {
- free (src[i]);
- src[i] = src[slen];
- src[slen] = NULL;
- } else {
- /*
- * If the matched element is the last, free it and
- * set it to NULL.
- */
- free (src[i]);
- src[i] = NULL;
- }
- /* reduce the array length by 1 */
- slen -= 1;
-
- /* repeat the same processing for the second array too */
- if (j != dlen) {
- free(dest[j]);
- dest[j] = dest[dlen];
- dest[dlen] = NULL;
- } else {
- free(dest[j]);
- dest[j] = NULL;
- }
- dlen -=1;
-
- /*
- * The source array is reduced by 1, so reduce the
- * index variable used for source array by 1. No need
- * to adjust the second array index variable as it is
- * reset while entering the inner loop.
- */
- i -= 1;
- break;
- }
- }
- }
- return 0;
-}
-
-/*
- * This function replicates the contents of the src array for later
- * use. Mostly the contents of the src array is obtained from a
- * ldap_search operation and the contents are required for later use.
- */
-
-krb5_error_code
-copy_arrays(char **src, char ***dest, int count)
-{
- krb5_error_code st=0;
- int i=0;
-
- /* validate the input parameters */
- if (src == NULL || dest == NULL)
- return 0;
-
- /* allocate memory for the dest array */
- *dest = (char **) calloc((unsigned) count+1, sizeof(char *));
- if (*dest == NULL) {
- st = ENOMEM;
- goto cleanup;
- }
-
- /* copy the members from src to dest array. */
- for (i=0; i < count && src[i] != NULL; ++i) {
- (*dest)[i] = strdup(src[i]);
- if ((*dest)[i] == NULL) {
- st = ENOMEM;
- goto cleanup;
- }
- }
-
-cleanup:
- /* in case of error free up everything and return */
- if (st != 0) {
- if (*dest != NULL) {
- for (i=0; (*dest)[i]; ++i) {
- free ((*dest)[i]);
- (*dest)[i] = NULL;
- }
- free (*dest);
- *dest = NULL;
- }
- }
- return st;
-}
-
static krb5_error_code
getepochtime(char *strtime, krb5_timestamp *epochtime)
{
@@ -1439,34 +1220,6 @@ format_d (int val)
}
krb5_error_code
-krb5_add_int_arr_mem_ldap_mod(LDAPMod ***mods, char *attribute, int op,
- int *value)
-{
- int i=0, j=0;
- krb5_error_code st=0;
-
- if ((st=krb5_add_member(mods, &i)) != 0)
- return st;
-
- (*mods)[i]->mod_type = strdup(attribute);
- if ((*mods)[i]->mod_type == NULL)
- return ENOMEM;
- (*mods)[i]->mod_op = op;
-
- for (j=0; value[j] != -1; ++j)
- ;
-
- (*mods)[i]->mod_values = malloc(sizeof(char *) * (j+1));
-
- for (j=0; value[j] != -1; ++j) {
- if (((*mods)[i]->mod_values[j] = format_d(value[j])) == NULL)
- return ENOMEM;
- }
- (*mods)[i]->mod_values[j] = NULL;
- return 0;
-}
-
-krb5_error_code
krb5_add_int_mem_ldap_mod(LDAPMod ***mods, char *attribute, int op, int value)
{
int i=0;
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h
index b1583d526b..c2d4b0ebed 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h
+++ b/src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.h
@@ -39,18 +39,6 @@
/* misc functions */
krb5_error_code
-updateAttribute (LDAP *, char *, char *, char *);
-
-krb5_error_code
-deleteAttribute (LDAP *, char *, char *, char *);
-
-krb5_error_code
-populateServers(LDAP *, char **, char ***, char *, char **);
-
-krb5_error_code
-disjoint_members(char **, char **);
-
-krb5_error_code
is_principal_in_realm(krb5_ldap_context *, krb5_const_principal);
krb5_error_code
@@ -93,9 +81,6 @@ krb5_error_code
krb5_ldap_free_server_params(krb5_ldap_context *);
krb5_error_code
-copy_arrays(char **, char ***, int);
-
-krb5_error_code
krb5_ldap_list(krb5_context, char ***, char *, char *);
krb5_error_code
@@ -120,9 +105,6 @@ krb5_error_code
krb5_add_ber_mem_ldap_mod(LDAPMod ***, char *, int, struct berval **);
krb5_error_code
-krb5_add_int_arr_mem_ldap_mod(LDAPMod ***, char *, int, int *);
-
-krb5_error_code
krb5_add_int_mem_ldap_mod(LDAPMod ***, char *, int , int);
krb5_error_code
diff --git a/src/plugins/kdb/ldap/libkdb_ldap/libkdb_ldap.exports b/src/plugins/kdb/ldap/libkdb_ldap/libkdb_ldap.exports
index b409f5884a..1467f5184c 100644
--- a/src/plugins/kdb/ldap/libkdb_ldap/libkdb_ldap.exports
+++ b/src/plugins/kdb/ldap/libkdb_ldap/libkdb_ldap.exports
@@ -37,7 +37,6 @@ krb5_ldap_free_server_context_params
krb5_ldap_free_krbcontainer_params
krb5_ldap_alloc
krb5_ldap_free
-disjoint_members
krb5_ldap_delete_realm_1
krb5_ldap_lock
krb5_ldap_unlock