More warning fixes for kauth
authorSimon Wilkinson <sxw@inf.ed.ac.uk>
Fri, 16 Oct 2009 22:15:52 +0000 (23:15 +0100)
committerDerrick Brashear <shadow|account-1000005@unknown>
Sun, 18 Oct 2009 13:14:13 +0000 (06:14 -0700)
Resolve more minor warnings from the kauth directory.

*) kaux_read takes an unsigned for the number of failures
*) The COUNT_REQ macro generates an unused variable (this_op)
*) kas is missing some headers
*) Add some more prototypes to kauth_internal.h
*) Add the standard boilerplate to kauth_internal.h
*) recvfrom takes a socklen_t * as its 6th argument

This make kaprocs.c, kaauxdb.c, kas.c, klog.c, and ka-forwarder.c
warning clean. Mark them as such.

Reviewed-on: http://gerrit.openafs.org/673
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

README.WARNINGS
src/kauth/Makefile.in
src/kauth/kaauxdb.c
src/kauth/kaprocs.c
src/kauth/kas.c
src/kauth/kaserver.c
src/kauth/kauth_internal.h
src/kauth/klog.c
src/kauth/krb_tf.c
src/kauth/krb_udp.c

index c954710..f6c40db 100644 (file)
@@ -59,15 +59,11 @@ butc/recoverDb.c     : all       : pointer target issues (XXX)
 butc/tcudbprocs.c    : all          : ubik_Call
 butc/dump.c         : all           : pointer types (XXX)
 comerr/error_table.c : all           : Autogenerated file with unused labels
-kauth/kaprocs.c             : all           : XXX
 kauth/kaserver.c     : all          : ExtendedCellInfo
-kauth/krb_udp.c      : all           : XXX
+kauth/krb_udp.c      : all           : "Value computed is not used" - wierd
 kauth/admin_tools.c  : all           : ubik_Call nonsense
 kauth/authclient.c   : strict-proto  : ubik_Call nonsense
                      : all          : ubik_Call nonsense
-kauth/kas.c          : all           : XXX
-kauth/klog.c         : all           : XXX
-kauth/ka-forwarder.c : all           : XXX
 libadmin/bos/afs_bosAdmin.c: all     : DES keys, time types, and const
 libadmin/kas/afs_kasAdmin.c: all     : Ubik_Call nonsense, DES keys
 libadmin/samples/rxstat_query_peer.c : all : util_RPCStatsStateGet types
index c408f47..79862e6 100644 (file)
@@ -98,12 +98,11 @@ kadatabase.o: kadatabase.c ${INCLS}
        ${CC} ${CFLAGS} -c ${srcdir}/kadatabase.c 
 
 kaprocs.o: kaprocs.c ${INCLS} kaport.h
-       ${CC} ${CFLAGS} @CFLAGS_NOERROR@ -c $<
+       ${CC} ${CFLAGS} -c $<
 
 authclient.o: authclient.c ${INCLS}
 
 kaauxdb.o: kaauxdb.c
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
 
 kaerrors.o: kaerrors.c
 
@@ -162,7 +161,7 @@ token.o: token.c ${INCLS}
 client.o: client.c ${INCLS} AFS_component_version_number.o
 
 kas.o: kas.c ${INCLS} AFS_component_version_number.o
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
+       $(CC) $(CFLAGS) -c $<
 
 admin_tools.o: admin_tools.c ${INCLS} kaport.h
        $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
@@ -180,7 +179,6 @@ klog: AFS_component_version_number.o kauth.h kautils.h libkauth.a $(LIBS) \
        ${CC} ${LDFLAGS} -o klog klog.o libkauth.a ${LIBS} ${XLIBS}
 
 klog.o: klog.c kauth.h kautils.h AFS_component_version_number.o
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
 
 klog.krb: kauth.h kautils.h libkauth.krb.a $(KLIBS) klog.o
        ${CC} ${LDFLAGS} -o klog.krb klog.o libkauth.krb.a ${KLIBS} ${XLIBS}
@@ -229,7 +227,6 @@ krb_udp: krb_udp.o libkauth.a $(KLIBS)
        ${CC} ${LDFLAGS} -o krb_udp krb_udp.o libkauth.a $(KLIBS)
 
 ka-forwarder.o: ka-forwarder.c
-       $(CC) $(CFLAGS) @CFLAGS_NOERROR@ -c $<
 
 ka-forwarder: ka-forwarder.o
        ${CC} -o $@ ${CFLAGS} ka-forwarder.o ${LIBS} ${XLIBS}
index 07eb668..09ba13f 100644 (file)
@@ -141,7 +141,7 @@ kaux_write(afs_int32 to, unsigned int nfailures, afs_uint32 lasttime)
 void
 kaux_inc(afs_int32 to, afs_uint32 locktime)
 {
-    int nfailures;
+    unsigned int nfailures;
     afs_uint32 lasttime, now;
 
     now = time(0);
index c2deadc..f675d05 100644 (file)
@@ -1486,7 +1486,7 @@ kamDeleteUser(struct rx_call *call, char *aname, char *ainstance)
     afs_int32 caller;
     afs_int32 to;
     struct kaentry tentry;
-    int nfailures;
+    unsigned int nfailures;
     afs_uint32 locktime;
 
     COUNT_REQ(DeleteUser);
@@ -2083,8 +2083,7 @@ afs_int32
 kamGetPassword(struct rx_call *call, char *name, EncryptionKey *password)
 {
     int code = KANOAUTH;
-    COUNT_REQ(GetPassword);
-
+    AFS_UNUSED COUNT_REQ(GetPassword);
 #ifdef GETPASSWORD
     {
        afs_int32 to;
@@ -2142,7 +2141,7 @@ kamGetRandomKey(struct rx_call *call, EncryptionKey *key)
 {
     int code;
 
-    COUNT_REQ(GetRandomKey);
+    AFS_UNUSED COUNT_REQ(GetRandomKey);
     if ((code = AwaitInitialization()))
        return code;
     code = des_random_key(EncryptionKey_to_cblock(key));
index 8cc7f3e..538d93e 100644 (file)
 #include <string.h>
 #include <afs/cellconfig.h>
 #include <afs/com_err.h>
+#include <afs/cmd.h>
 
 #include "kauth.h"
+#include "kauth_internal.h"
 #include "kautils.h"
 
 
index cce632e..1fae422 100644 (file)
@@ -45,6 +45,7 @@
 #include <ubik.h>
 #include <sys/stat.h>
 #include "kauth.h"
+#include "kauth_internal.h"
 #include "kautils.h"
 #include "kaserver.h"
 #include "kadatabase.h"
index 73058f3..795efc6 100644 (file)
@@ -1,3 +1,16 @@
+/*
+ * Copyright 2000, International Business Machines Corporation and others.
+ * All Rights Reserved.
+ *
+ * This software has been released under the terms of the IBM Public
+ * License.  For details, see the LICENSE file in the top-level source
+ * directory or online at http://www.openafs.org/dl/license10.html
+ */
+#ifndef AFS_SRC_KAUTH_INTERNAL_H
+#define AFS_SRC_KAUTH_INTERNAL_H
+
+/* admin_tools.c */
+extern afs_int32 ka_AdminInteractive(int cmd_argc, char *cmd_argv[]);
 
 /* kadatabase.c */
 extern void init_kadatabase(int initFlags);
@@ -7,6 +20,7 @@ extern afs_int32 ka_LookupKey(struct ubik_trans *tt,
                              afs_int32 *kvno,
                              struct ktc_encryptionKey *key);
 
+struct kaentry;
 extern afs_int32 FindBlock(struct ubik_trans *at, char *aname, 
                           char *ainstance, afs_int32 *toP, 
                           struct kaentry *tentry);
@@ -27,6 +41,16 @@ extern afs_int32 ka_NewKey(struct ubik_trans *tt, afs_int32 tentryaddr,
 
 extern int name_instance_legal(char *name, char *instance);
 
+/* kaprocs.c */
+struct ubik_trans;
+extern afs_int32 InitAuthServ(struct ubik_trans **, int, int *);
+
+/* krb_tf.c */
+extern afs_int32 krb_write_ticket_file(char *realm);
+
+/* krb_udp.c */
+extern afs_int32 init_krb_udp(void);
+
 static_inline unsigned char *
 EncryptionKey_to_cblock(EncryptionKey *key) {
     return (unsigned char *)key;
@@ -41,3 +65,5 @@ static_inline EncryptionKey *
 ktc_to_EncryptionKey(struct ktc_encryptionKey *key) {
     return (EncryptionKey *)key;
 }
+
+#endif
index 2402c4e..f227dec 100644 (file)
@@ -28,6 +28,7 @@
 #include <afs/cmd.h>
 #include "kauth.h"
 #include "kautils.h"
+#include "kauth_internal.h"
 #include "assert.h"
 
 
index 285205c..c8941cc 100644 (file)
@@ -63,6 +63,7 @@
 #include <afs/auth.h>
 #include "kauth.h"
 #include "kautils.h"
+#include "kauth_internal.h"
 
 #ifndef WORDS_BIGENDIAN
 /* This was taken from jhutz's patch for heimdal krb4. It only
index dad0a74..a8318dd 100644 (file)
@@ -43,6 +43,7 @@
 
 #include "kauth.h"
 #include "kautils.h"
+#include "kauth_internal.h"
 #include "kaserver.h"
 #include "prot.h"              /* protocol definitions */
 #include "kaport.h"
@@ -791,7 +792,7 @@ SocketListener(void *unused)
     fd_set rfds;
     struct timeval tv;
     struct packet packet;
-    int fromLen;
+    socklen_t fromLen;
     afs_int32 code;
 
     printf("Starting to listen for UDP packets\n");