extern char *strptime (const char *, const char *, struct tm *);
#endif
+static krb5_error_code
+remove_overlapping_subtrees(char **listin, char **listop, int *subtcount,
+ int sscope);
+
/* Linux (GNU Libc) provides a length-limited variant of strdup.
But all the world's not Linux. */
#undef strndup
krb5_ldap_context *ldap_context;
krb5_const_principal searchfor;
{
- int defrealmlen=0;
+ size_t defrealmlen=0;
char *defrealm=NULL;
#define FIND_MAX(a,b) ((a) > (b) ? (a) : (b))
void *value;
{
unsigned int currlen=0, tldatalen=0;
- char *curr=NULL;
+ unsigned char *curr=NULL;
void *reallocptr=NULL;
tl_data->tl_data_type = KDB_TL_USER_INFO;
free (reallocptr);
return ENOMEM;
}
- curr = (char *) (tl_data->tl_data_contents + currlen);
+ curr = (tl_data->tl_data_contents + currlen);
/* store the tl_type value */
memset(curr, tl_type, 1);
free (reallocptr);
return ENOMEM;
}
- curr = (char *) (tl_data->tl_data_contents + currlen);
+ curr = (tl_data->tl_data_contents + currlen);
/* store the tl_type value */
memset(curr, tl_type, 1);
krb5_ldap_get_reference_count (krb5_context context, char *dn, char *refattr,
int *count, LDAP *ld)
{
- int i, st = 0, tempst = 0, gothandle = 0;
- unsigned int ntrees;
+ int st = 0, tempst = 0, gothandle = 0;
+ unsigned int i, ntrees;
char *refcntattr[2];
char *filter = NULL;
char **subtree = NULL, *ptr = NULL;
refcntattr [0] = refattr;
refcntattr [1] = NULL;
- ptr = ldap_filter_correct (dn, strlen (dn));
+ ptr = ldap_filter_correct (dn);
if (ptr == NULL) {
st = ENOMEM;
goto cleanup;
}
len = strlen (ldap_context->lrparams->realmdn);
- ptr = ldap_filter_correct (name, strlen (name));
+ ptr = ldap_filter_correct (name);
if (ptr == NULL) {
st = ENOMEM;
goto cleanup;
}
/* remove overlapping and repeated subtree entries from the list of subtrees */
-krb5_error_code
+static krb5_error_code
remove_overlapping_subtrees(char **listin, char **listop, int *subtcount, int sscope)
{
int slen=0, k=0, j=0, lendiff=0;
* Function to remove all special characters from a string (rfc2254).
* Use whenever exact matching is to be done ...
*/
-char *ldap_filter_correct (unsigned char *in, unsigned int len)
+char *ldap_filter_correct (char *in)
{
- int i, count;
+ size_t i, count;
char *out, *ptr;
+ size_t len = strlen(in);
for (i = 0, count = 0; i < len; i++)
switch (in[i]) {
char *attr[] = {"krbprincipalname", NULL}, *realm=NULL, filter[256];
krb5_ldap_context lcontext;
- realm = ldap_filter_correct (lrealm, strlen (lrealm));
+ realm = ldap_filter_correct (lrealm);
assert (sizeof (filter) >= sizeof ("(krbprincipalname=)") +
strlen (realm) + 2 /* "*@" */ + 1);