Fix some small issues that caused compiler warnings, like uninitialized or unused variables or missing krb5 prototypes.

This commit is contained in:
Martin Nagy
2008-06-26 12:52:25 +02:00
committed by Simo Sorce
parent f5d9dd647f
commit 6cce2f45e8
4 changed files with 13 additions and 12 deletions

View File

@@ -30,6 +30,7 @@
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
#include <time.h> #include <time.h>
#define KRB5_PRIVATE 1
#include <krb5.h> #include <krb5.h>
#ifdef WITH_MOZLDAP #ifdef WITH_MOZLDAP
#include <mozldap/ldap.h> #include <mozldap/ldap.h>
@@ -95,7 +96,7 @@ static int get_enctypes(krb5_context krbctx, const char *str,
/* count */ /* count */
n = 0; n = 0;
p = t; p = t;
while (p = strchr(t, ',')) { while ((p = strchr(t, ','))) {
t = p+1; t = p+1;
n++; n++;
} }
@@ -239,7 +240,7 @@ static struct berval *create_key_control(krb5_keyblock *keys, int num_keys, cons
int filter_keys(krb5_context krbctx, krb5_keyblock *keys, int *num_keys, ber_int_t *enctypes) int filter_keys(krb5_context krbctx, krb5_keyblock *keys, int *num_keys, ber_int_t *enctypes)
{ {
int ret, i, j, k; int i, j, k;
k = *num_keys; k = *num_keys;
@@ -277,15 +278,12 @@ static int ldap_set_keytab(const char *servername,
{ {
int version; int version;
LDAP *ld = NULL; LDAP *ld = NULL;
BerElement *ctrl = NULL;
BerElement *sctrl = NULL; BerElement *sctrl = NULL;
struct berval *control = NULL; struct berval *control = NULL;
struct berval **ncvals;
char *ldap_base = NULL;
char *retoid = NULL; char *retoid = NULL;
struct berval *retdata = NULL; struct berval *retdata = NULL;
struct timeval tv; struct timeval tv;
LDAPMessage *entry, *res = NULL; LDAPMessage *res = NULL;
LDAPControl **srvctrl = NULL; LDAPControl **srvctrl = NULL;
LDAPControl *pprc = NULL; LDAPControl *pprc = NULL;
char *err = NULL; char *err = NULL;
@@ -293,7 +291,6 @@ static int ldap_set_keytab(const char *servername,
int ret, rc; int ret, rc;
int kvno, i; int kvno, i;
ber_tag_t rtag; ber_tag_t rtag;
struct berval bv;
ber_int_t *encs = NULL; ber_int_t *encs = NULL;
/* cant' return more than num_keys, sometimes less */ /* cant' return more than num_keys, sometimes less */

View File

@@ -1004,7 +1004,9 @@ pid_t handle_conn(struct socklist *sd)
int ret; int ret;
fromlen = sizeof(from); fromlen = sizeof(from);
mfd = 0;
tcp = 0; tcp = 0;
reqlen = 0;
/* receive request */ /* receive request */
if (sd->socktype == SOCK_STREAM) { if (sd->socktype == SOCK_STREAM) {
@@ -1305,7 +1307,7 @@ int main(int argc, char *argv[])
ret = getnameinfo(tifa->ifa_addr, sizeof(struct sockaddr_storage), ret = getnameinfo(tifa->ifa_addr, sizeof(struct sockaddr_storage),
host, sizeof(host), NULL, 0, NI_NUMERICHOST); host, sizeof(host), NULL, 0, NI_NUMERICHOST);
if (ret) { if (ret) {
syslog(LOG_ERR, "Error converting address (%d)", syslog(LOG_ERR, "Error converting address (%s)",
gai_strerror(ret)); gai_strerror(ret));
continue; continue;
} else { } else {
@@ -1319,7 +1321,7 @@ int main(int argc, char *argv[])
/* this shoud return 2 entries, one for UDP and one for TCP */ /* this shoud return 2 entries, one for UDP and one for TCP */
ret = getaddrinfo(host, "kpasswd", &hints, &ai); ret = getaddrinfo(host, "kpasswd", &hints, &ai);
if (ret) { if (ret) {
syslog(LOG_ERR, "Error getting address info (%d) for [%s]", syslog(LOG_ERR, "Error getting address info (%s) for [%s]",
gai_strerror(ret), host); gai_strerror(ret), host);
continue; continue;
} }

View File

@@ -371,7 +371,7 @@ static int dna_start(Slapi_PBlock * pb)
/** /**
* Load the config for our plug-in * Load the config for our plug-in
*/ */
dna_global_config = (struct configEntry *) dna_global_config = (PRCList *)
slapi_ch_calloc(1, sizeof(struct configEntry)); slapi_ch_calloc(1, sizeof(struct configEntry));
PR_INIT_CLIST(dna_global_config); PR_INIT_CLIST(dna_global_config);
@@ -973,7 +973,6 @@ static int dna_get_next_value(struct configEntry *config_entry,
PRUint64 setval = 0; PRUint64 setval = 0;
PRUint64 newval = 0; PRUint64 newval = 0;
PRUint64 maxval = -1; PRUint64 maxval = -1;
int result;
/* do update */ /* do update */
ret = slapi_search_internal_get_entry(dn, attrlist, &e, ret = slapi_search_internal_get_entry(dn, attrlist, &e,
@@ -1342,7 +1341,7 @@ static int dna_pre_op(Slapi_PBlock * pb, int modtype)
slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM,
"dna_pre_op: operation failure [%d]\n", ret); "dna_pre_op: operation failure [%d]\n", ret);
slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL); slapi_send_ldap_result(pb, ret, NULL, errstr, 0, NULL);
slapi_ch_free(&errstr); slapi_ch_free((void **)&errstr);
ret = DNA_FAILURE; ret = DNA_FAILURE;
} }

View File

@@ -63,6 +63,7 @@
#include <prio.h> #include <prio.h>
#include <ssl.h> #include <ssl.h>
#include <dirsrv/slapi-plugin.h> #include <dirsrv/slapi-plugin.h>
#define KRB5_PRIVATE 1
#include <krb5.h> #include <krb5.h>
#include <lber.h> #include <lber.h>
#include <time.h> #include <time.h>
@@ -121,6 +122,8 @@
#define KRB5P_SALT_SIZE 16 #define KRB5P_SALT_SIZE 16
void krb5int_c_free_keyblock_contents(krb5_context context, register krb5_keyblock *key);
static const char *ipapwd_def_encsalts[] = { static const char *ipapwd_def_encsalts[] = {
"des3-hmac-sha1:normal", "des3-hmac-sha1:normal",
/* "arcfour-hmac:normal", /* "arcfour-hmac:normal",