Subject: | krb5-1.6-pre: fix warnings/ improve 64bit compatibility in the ldap plugin |
fix some "implicite declaration" and "differ in signedness"
warnings. Improve 64bit compatibility.
warnings. Improve 64bit compatibility.
#
# fix some "implicite declaration" and "differ in signedness"
# warnings. Improve 64bit compatibility.
#
--- src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
+++ src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c 2006/10/17 11:18:38
@@ -32,11 +32,15 @@
#include "kdb_ldap.h"
#include "ldap_misc.h"
#include "ldap_err.h"
+#include "ldap_handle.h"
#ifdef NEED_STRPTIME_PROTO
extern char *strptime (const char *, const char *, struct tm *);
#endif
+/* forward declaration */
+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
@@ -550,7 +554,7 @@
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;
@@ -573,7 +577,7 @@
free (reallocptr);
return ENOMEM;
}
- curr = (char *) (tl_data->tl_data_contents + currlen);
+ curr = (unsigned char *) (tl_data->tl_data_contents + currlen);
/* store the tl_type value */
memset(curr, tl_type, 1);
@@ -604,7 +608,7 @@
free (reallocptr);
return ENOMEM;
}
- curr = (char *) (tl_data->tl_data_contents + currlen);
+ curr = (unsigned char *) (tl_data->tl_data_contents + currlen);
/* store the tl_type value */
memset(curr, tl_type, 1);
@@ -1587,7 +1591,8 @@
krb5_error_code
krb5_ldap_get_reference_count (krb5_context context, char *dn, char *refattr,
int *count, LDAP *ld) {
- int i, ntrees, st = 0, tempst = 0, gothandle = 0;
+ int st = 0, tempst = 0, gothandle = 0;
+ unsigned int i, ntrees;
char *refcntattr[2];
char *filter = NULL;
char **subtree = NULL, *ptr = NULL;
--- src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c
+++ src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c 2006/10/17 11:19:00
@@ -32,6 +32,7 @@
#include "ldap_realm.h"
#include "ldap_principal.h"
#include "ldap_err.h"
+#include "ldap_pwd_policy.h"
#define END_OF_LIST -1
char *realm_attributes[] = {"krbSearchScope","krbSubTrees", "krbPrincContainerRef",
@@ -99,7 +100,7 @@
* 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, unsigned int len)
{
int i, count;
char *out, *ptr;
--- src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h
+++ src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h 2006/10/17 11:19:14
@@ -101,4 +101,7 @@
krb5_error_code
krb5_ldap_delete_realm_1(krb5_context, char *, char **);
+char *
+ldap_filter_correct (char *in, unsigned int len);
+
#endif
# fix some "implicite declaration" and "differ in signedness"
# warnings. Improve 64bit compatibility.
#
--- src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c
+++ src/plugins/kdb/ldap/libkdb_ldap/ldap_misc.c 2006/10/17 11:18:38
@@ -32,11 +32,15 @@
#include "kdb_ldap.h"
#include "ldap_misc.h"
#include "ldap_err.h"
+#include "ldap_handle.h"
#ifdef NEED_STRPTIME_PROTO
extern char *strptime (const char *, const char *, struct tm *);
#endif
+/* forward declaration */
+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
@@ -550,7 +554,7 @@
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;
@@ -573,7 +577,7 @@
free (reallocptr);
return ENOMEM;
}
- curr = (char *) (tl_data->tl_data_contents + currlen);
+ curr = (unsigned char *) (tl_data->tl_data_contents + currlen);
/* store the tl_type value */
memset(curr, tl_type, 1);
@@ -604,7 +608,7 @@
free (reallocptr);
return ENOMEM;
}
- curr = (char *) (tl_data->tl_data_contents + currlen);
+ curr = (unsigned char *) (tl_data->tl_data_contents + currlen);
/* store the tl_type value */
memset(curr, tl_type, 1);
@@ -1587,7 +1591,8 @@
krb5_error_code
krb5_ldap_get_reference_count (krb5_context context, char *dn, char *refattr,
int *count, LDAP *ld) {
- int i, ntrees, st = 0, tempst = 0, gothandle = 0;
+ int st = 0, tempst = 0, gothandle = 0;
+ unsigned int i, ntrees;
char *refcntattr[2];
char *filter = NULL;
char **subtree = NULL, *ptr = NULL;
--- src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c
+++ src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.c 2006/10/17 11:19:00
@@ -32,6 +32,7 @@
#include "ldap_realm.h"
#include "ldap_principal.h"
#include "ldap_err.h"
+#include "ldap_pwd_policy.h"
#define END_OF_LIST -1
char *realm_attributes[] = {"krbSearchScope","krbSubTrees", "krbPrincContainerRef",
@@ -99,7 +100,7 @@
* 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, unsigned int len)
{
int i, count;
char *out, *ptr;
--- src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h
+++ src/plugins/kdb/ldap/libkdb_ldap/ldap_realm.h 2006/10/17 11:19:14
@@ -101,4 +101,7 @@
krb5_error_code
krb5_ldap_delete_realm_1(krb5_context, char *, char **);
+char *
+ldap_filter_correct (char *in, unsigned int len);
+
#endif