svn rev #24703: trunk/src/lib/ crypto/builtin/enc_provider/ crypto/krb/ kadm5/ ...

ghudson@MIT.EDU ghudson at MIT.EDU
Mon Mar 14 16:34:59 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=24703
Commit By: ghudson
Log Message:
Resolve a few miscellaneous warnings.



Changed Files:
U   trunk/src/lib/crypto/builtin/enc_provider/aes.c
U   trunk/src/lib/crypto/krb/crypto_length.c
U   trunk/src/lib/kadm5/logger.c
U   trunk/src/lib/kadm5/misc_free.c
U   trunk/src/lib/kdb/kdb_convert.c
U   trunk/src/lib/kdb/kdb_log.c
U   trunk/src/lib/krb5/asn.1/asn1_k_decode_macros.h
U   trunk/src/lib/krb5/krb/bld_princ.c
U   trunk/src/lib/krb5/krb/chpw.c
U   trunk/src/lib/krb5/krb/get_creds.c
U   trunk/src/lib/krb5/krb/gic_pwd.c
U   trunk/src/lib/krb5/krb/ser_actx.c
U   trunk/src/lib/krb5/os/dnsglue.c
U   trunk/src/lib/krb5/os/sendto_kdc.c
Modified: trunk/src/lib/crypto/builtin/enc_provider/aes.c
===================================================================
--- trunk/src/lib/crypto/builtin/enc_provider/aes.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/crypto/builtin/enc_provider/aes.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -61,7 +61,7 @@
     int z;
     for (z = 0; z < BLOCK_SIZE/4; z++) {
         unsigned char *outptr = &out[z*4];
-        unsigned char *inptr = &in[z*4];
+        const unsigned char *inptr = &in[z*4];
         /*
          * Use unaligned accesses.  On x86, this will probably still be faster
          * than multiple byte accesses for unaligned data, and for aligned data

Modified: trunk/src/lib/crypto/krb/crypto_length.c
===================================================================
--- trunk/src/lib/crypto/krb/crypto_length.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/crypto/krb/crypto_length.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -42,7 +42,7 @@
         *size = 0;
         break;
     case KRB5_CRYPTO_TYPE_DATA:
-        *size = (size_t)~0; /* match Heimdal */
+        *size = (unsigned int)~0; /* match Heimdal */
         break;
     case KRB5_CRYPTO_TYPE_HEADER:
     case KRB5_CRYPTO_TYPE_PADDING:

Modified: trunk/src/lib/kadm5/logger.c
===================================================================
--- trunk/src/lib/kadm5/logger.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/kadm5/logger.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -200,7 +200,7 @@
 
     /* If reporting an error message, separate it. */
     if (code) {
-        char *emsg;
+        const char *emsg;
         outbuf[sizeof(outbuf) - 1] = '\0';
 
         emsg = krb5_get_error_message (err_context, code);

Modified: trunk/src/lib/kadm5/misc_free.c
===================================================================
--- trunk/src/lib/kadm5/misc_free.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/kadm5/misc_free.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -1,13 +1,8 @@
 /* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
 /*
  * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved
- *
- * $Header$
  */
 
-#if !defined(lint) && !defined(__CODECENTER__)
-static char *rcsid = "$Header$";
-#endif
 #include        <kadm5/admin.h>
 #include        <stdlib.h>
 #include        "server_internal.h"

Modified: trunk/src/lib/kdb/kdb_convert.c
===================================================================
--- trunk/src/lib/kdb/kdb_convert.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/kdb/kdb_convert.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -248,7 +248,8 @@
 static krb5_principal
 conv_princ_2db(krb5_context context, kdbe_princ_t *kdbe_princ)
 {
-    int i;
+    unsigned int i;
+    int j;
     krb5_principal princ;
     kdbe_data_t *components;
 
@@ -275,10 +276,10 @@
         princ->data[i].data = NULL;
     princ->length = (krb5_int32)kdbe_princ->k_components.k_components_len;
 
-    for (i = 0; i < princ->length; i++) {
-        princ->data[i].magic = components[i].k_magic;
-        set_from_utf8str(&princ->data[i], components[i].k_data);
-        if (princ->data[i].data == NULL)
+    for (j = 0; j < princ->length; j++) {
+        princ->data[j].magic = components[j].k_magic;
+        set_from_utf8str(&princ->data[j], components[j].k_data);
+        if (princ->data[j].data == NULL)
             goto error;
     }
 
@@ -822,7 +823,8 @@
 {
 
     kdb_incr_update_t *upd;
-    int i, j, k, cnt;
+    unsigned int i, j;
+    int k, cnt;
 
     if (updates == NULL)
         return;

Modified: trunk/src/lib/kdb/kdb_log.c
===================================================================
--- trunk/src/lib/kdb/kdb_log.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/kdb/kdb_log.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -19,6 +19,10 @@
 #include "kdb_log.h"
 #include "kdb5int.h"
 
+#ifndef MAP_FAILED
+#define MAP_FAILED ((void *)-1)
+#endif
+
 /*
  * This modules includes all the necessary functions that create and
  * modify the Kerberos principal update and header logs.
@@ -602,7 +606,7 @@
                                   PROT_READ+PROT_WRITE, MAP_SHARED, ulogfd, 0);
     }
 
-    if ((int)(ulog) == -1) {
+    if (ulog == MAP_FAILED) {
         /*
          * Can't map update log file to memory
          */
@@ -901,7 +905,7 @@
  */
 static int extend_file_to(int fd, uint_t new_size)
 {
-    int current_offset;
+    off_t current_offset;
     static const char zero[512] = { 0, };
 
     current_offset = lseek(fd, 0, SEEK_END);
@@ -911,7 +915,7 @@
         errno = EINVAL;
         return -1;
     }
-    while (current_offset < new_size) {
+    while (current_offset < (off_t)new_size) {
         int write_size, wrote_size;
         write_size = new_size - current_offset;
         if (write_size > 512)

Modified: trunk/src/lib/krb5/asn.1/asn1_k_decode_macros.h
===================================================================
--- trunk/src/lib/krb5/asn.1/asn1_k_decode_macros.h	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/asn.1/asn1_k_decode_macros.h	2011-03-14 20:34:59 UTC (rev 24703)
@@ -351,7 +351,7 @@
  * Like end_sequence_of(), but uses the different (non-shadowing)
  * variable names.
  */
-static asn1_error_code
+static inline asn1_error_code
 end_sequence_of_no_tagvars_helper(asn1buf *buf, asn1buf *seqbufp,
                                   int seqofindef)
 {

Modified: trunk/src/lib/krb5/krb/bld_princ.c
===================================================================
--- trunk/src/lib/krb5/krb/bld_princ.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/krb/bld_princ.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -151,21 +151,22 @@
                               va_list ap)
 {
     krb5_error_code retval = 0;
+    krb5_principal p;
+    char *first;
 
-    krb5_principal p = malloc(sizeof(krb5_principal_data));
-    if (!p) { retval = ENOMEM; }
+    p = malloc(sizeof(krb5_principal_data));
+    if (p == NULL)
+        return ENOMEM;
 
-    if (!retval) {
-        retval = krb5_build_principal_va(context, p, rlen, realm, ap);
-    }
-
-    if (!retval) {
-        *princ = p;
-    } else {
+    first = va_arg(ap, char *);
+    retval = krb5int_build_principal_va(context, p, rlen, realm, first, ap);
+    if (retval) {
         free(p);
+        return retval;
     }
 
-    return retval;
+    *princ = p;
+    return 0;
 }
 
 krb5_error_code KRB5_CALLCONV_C

Modified: trunk/src/lib/krb5/krb/chpw.c
===================================================================
--- trunk/src/lib/krb5/krb/chpw.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/krb/chpw.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -78,7 +78,7 @@
                     krb5_data *packet, int *result_code, krb5_data *result_data)
 {
     char *ptr;
-    int plen, vno;
+    unsigned int plen, vno;
     krb5_data ap_rep;
     krb5_ap_rep_enc_part *ap_rep_enc;
     krb5_error_code ret;

Modified: trunk/src/lib/krb5/krb/get_creds.c
===================================================================
--- trunk/src/lib/krb5/krb/get_creds.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/krb/get_creds.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -417,8 +417,6 @@
 static krb5_error_code
 complete(krb5_context context, krb5_tkt_creds_context ctx)
 {
-    krb5_error_code code;
-
     TRACE_TKT_CREDS_COMPLETE(context, ctx->reply_creds->server);
 
     /* Note the authdata we asked for in the output creds. */

Modified: trunk/src/lib/krb5/krb/gic_pwd.c
===================================================================
--- trunk/src/lib/krb5/krb/gic_pwd.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/krb/gic_pwd.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -62,7 +62,7 @@
             return(ret);
     }
 
-    if ((salt->length == -1 || salt->length == SALT_TYPE_AFS_LENGTH) && (salt->data == NULL)) {
+    if (salt->length == SALT_TYPE_AFS_LENGTH && salt->data == NULL) {
         if ((ret = krb5_principal2salt(context, client, &defsalt)))
             return(ret);
 

Modified: trunk/src/lib/krb5/krb/ser_actx.c
===================================================================
--- trunk/src/lib/krb5/krb/ser_actx.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/krb/ser_actx.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -230,7 +230,7 @@
 
             /* Convert to signed 32 bit integer */
             obuf32 = obuf;
-            if (kret == 0 && obuf != obuf32)
+            if (kret == 0 && obuf > KRB5_INT32_MAX)
                 kret = EINVAL;
             if (!kret)
                 (void) krb5_ser_pack_int32(obuf32, &bp, &remain);

Modified: trunk/src/lib/krb5/os/dnsglue.c
===================================================================
--- trunk/src/lib/krb5/os/dnsglue.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/os/dnsglue.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -184,8 +184,8 @@
         if (len < 0)
             return -1;
         ds->cur_ans++;
-        if (ds->nclass == ns_rr_class(rr)
-            && ds->ntype == ns_rr_type(rr)) {
+        if (ds->nclass == (int)ns_rr_class(rr)
+            && ds->ntype == (int)ns_rr_type(rr)) {
             *pp = ns_rr_rdata(rr);
             *lenp = ns_rr_rdlen(rr);
             return 0;

Modified: trunk/src/lib/krb5/os/sendto_kdc.c
===================================================================
--- trunk/src/lib/krb5/os/sendto_kdc.c	2011-03-14 19:12:18 UTC (rev 24702)
+++ trunk/src/lib/krb5/os/sendto_kdc.c	2011-03-14 20:34:59 UTC (rev 24703)
@@ -1125,8 +1125,6 @@
 
     e = 0;
     while (selstate->nfds > 0) {
-        unsigned int i;
-
         e = krb5int_cm_call_select(selstate, seltemp, &selret);
         if (e == EINTR)
             continue;




More information about the cvs-krb5 mailing list