ptserver-warning-cleanup-20011005
authorNathan Neulinger <nneul@umr.edu>
Fri, 5 Oct 2001 22:07:17 +0000 (22:07 +0000)
committerDerrick Brashear <shadow@dementia.org>
Fri, 5 Oct 2001 22:07:17 +0000 (22:07 +0000)
clean up warnings in ptserver dir

src/ptserver/db_verify.c
src/ptserver/ptprocs.c
src/ptserver/ptserver.c
src/ptserver/ptuser.c
src/ptserver/ptutils.c
src/ptserver/readgroup.c
src/ptserver/readpwd.c
src/ptserver/testpt.c
src/ptserver/utils.c

index 3bddbe6..f41b03f 100644 (file)
@@ -26,6 +26,13 @@ RCSID("$Header$");
 #include <sys/file.h>
 #endif
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <errno.h>
 #include <fcntl.h>
 #include <afs/cellconfig.h>
index ac984c8..a102910 100644 (file)
@@ -25,9 +25,15 @@ RCSID("$Header$");
 #ifdef AFS_NT40_ENV 
 #include <winsock2.h>
 #else
-#include <strings.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include "ptserver.h"
 #include "pterror.h"
 #include "afs/audit.h"
@@ -107,9 +113,9 @@ afs_int32 WhoIsThis (acall, at, aid)
        goto done;                      /* no longer supported */
     }
     else if (code == 2) {              /* kad class */
-       if (code = rxkad_GetServerInfo
+       if ((code = rxkad_GetServerInfo
            (acall->conn, (afs_int32 *) 0, 0/*was &exp*/,
-            name, inst, tcell, (afs_int32 *) 0))
+            name, inst, tcell, (afs_int32 *) 0)))
            goto done;
 #if 0
        /* This test is unnecessary, since rxkad_GetServerInfo already check.
@@ -1153,10 +1159,11 @@ struct prcheckentry *aentry;
         ABORT_WITH(tt,PRPERM);
 
     aentry->flags = tentry.flags >> PRIVATE_SHIFT;
-    if (aentry->flags == 0)
+    if (aentry->flags == 0) {
        if (tentry.flags & PRGRP)
            aentry->flags = PRP_GROUP_DEFAULT >> PRIVATE_SHIFT;
        else aentry->flags = PRP_USER_DEFAULT >> PRIVATE_SHIFT;
+    }
     aentry->owner = tentry.owner;
     aentry->id = tentry.id;
     strncpy(aentry->name,tentry.name,PR_MAXNAMELEN);
@@ -1635,7 +1642,7 @@ static stolower(s)
 register char *s;
 {
     register int tc;
-    while (tc = *s) {
+    while ((tc = *s)) {
        if (isupper(tc)) *s = tolower(tc);
        s++;
     }
@@ -1656,7 +1663,7 @@ afs_int32 addWildCards(tt,alist,host)
     int size = 0, i, code;
     int added = 0;
  
-    while (host = (host & wild)) {
+    while ((host = (host & wild))) {
        wild = htonl ( ntohl(wild) << 8) ;
        iaddr.s_addr = host;
        code = NameToID(tt, inet_ntoa(iaddr),&hostid);
@@ -1678,7 +1685,7 @@ afs_int32 addWildCards(tt,alist,host)
        added +=  wlist.prlist_len;
        for (i=0; i< wlist.prlist_len; i++) {
            if (!inCPS(*alist,wlist.prlist_val[i]))
-               if (code = AddToPRList (alist, &size, wlist.prlist_val[i] )) {
+               if ((code = AddToPRList (alist, &size, wlist.prlist_val[i] ))) {
                    free(wlist.prlist_val);
                    return(code);
                }
@@ -1720,17 +1727,17 @@ afs_int32 WhoIsThisWithName(acall, at, aid, aname)
        int clen;
        extern char *pr_realmName;
 
-       if (code = rxkad_GetServerInfo
+       if ((code = rxkad_GetServerInfo
            (acall->conn, (afs_int32 *) 0, 0/*was &exp*/,
-            name, inst, tcell, (afs_int32 *) 0))
+            name, inst, tcell, (afs_int32 *) 0)))
            goto done;
        strncpy (vname, name, sizeof(vname));
-       if (ilen = strlen (inst)) {
+       if ((ilen = strlen(inst))) {
            if (strlen(vname) + 1 + ilen >= sizeof(vname)) goto done;
            strcat (vname, ".");
            strcat (vname, inst);
        }
-       if (clen = strlen (tcell)){
+       if ( (clen = strlen(tcell))) {
 
 #if    defined(AFS_ATHENA_STDENV) || defined(AFS_KERBREALM_ENV)
            static char local_realm[AFS_REALM_SZ] = "";
index b05ff9a..6195610 100644 (file)
@@ -25,6 +25,13 @@ RCSID("$Header$");
 #include <netdb.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/xdr.h>
 #include <rx/rx.h>
 #include <rx/rx_globals.h>
index cea872b..70b4839 100644 (file)
@@ -39,6 +39,13 @@ RCSID("$Header$");
 #include <netinet/in.h>
 #endif
 #include <stdio.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <rx/rxkad.h>
index 1b78fe4..6b9d52f 100644 (file)
@@ -19,8 +19,14 @@ RCSID("$Header$");
 #include <winsock2.h>
 #else
 #include <netinet/in.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
 #include <strings.h>
 #endif
+#endif
 #include <lock.h>
 #include <ubik.h>
 #include <rx/xdr.h>
@@ -104,7 +110,7 @@ static afs_int32 CorrectGroupName (ut, aname, cid, oid, cname)
        if (ntohl(tentry.flags) & PRGRP) {
            if ((tentry.count == 0) && !admin) return PRGROUPEMPTY;
            /* terminate prefix at colon if there is one */
-           if (prefix = strchr(tentry.name, ':')) *prefix = 0;
+           if ((prefix = strchr(tentry.name, ':'))) *prefix = 0;
        }
        prefix = tentry.name;
     }
@@ -126,7 +132,7 @@ static afs_int32 CorrectGroupName (ut, aname, cid, oid, cname)
     }
   done:
     /* check for legal name with either group rules or user rules */
-    if (suffix = strchr(cname, ':')) {
+    if ((suffix = strchr(cname, ':'))) {
        /* check for confusing characters */
        if (strchr(cname, '\n') ||      /* restrict so recreate can work */
            strchr(suffix+1, ':'))      /* avoid multiple colons */
@@ -156,11 +162,12 @@ int AccessOK (ut, cid, tentry, mem, any)
     } else {
        flags = oid = aid = 0;
     }
-    if (!(flags & PRACCESS))           /* provide default access */
+    if (!(flags & PRACCESS)) {         /* provide default access */
        if (flags & PRGRP)
            flags |= PRP_GROUP_DEFAULT;
        else
            flags |= PRP_USER_DEFAULT;
+    }
 
     if (flags & any) return 1;
     if (oid) {
@@ -622,7 +629,7 @@ afs_int32 AddToEntry (tt, entry, loc, aid)
     afs_int32 nptr;
     afs_int32 last;                            /* addr of last cont. block */
     afs_int32 first = 0;
-    afs_int32 cloc;
+    afs_int32 cloc = 0;
     afs_int32 slot = -1;
 
     if (entry->id == aid) return PRINCONSISTENT;
@@ -796,7 +803,7 @@ afs_int32 GetList2 (at, tentry, tentry2 , alist, add)
   prlist *alist;
   afs_int32 add;
 {
-    afs_int32 code;
+    afs_int32 code = 0;
     afs_int32 i;
     struct contentry centry;
     afs_int32 nptr;
index 4129c87..2308636 100644 (file)
 RCSID("$Header$");
 
 #include <stdio.h>
-#ifndef AFS_NT40_ENV
-#include <strings.h>
-#else
+#ifdef AFS_NT40_ENV
 #include <WINNT/afsevent.h>
 #endif
 #include <ctype.h>
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <afs/cellconfig.h>
index 7548ea4..19f2de3 100644 (file)
 RCSID("$Header$");
 
 #include <stdio.h>
-#ifndef AFS_NT40_ENV
-#include <strings.h>
-#else
+#ifdef AFS_NT40_ENV
 #include <WINNT/afsevent.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <afs/cellconfig.h>
index 1ba7e8d..ad94f8f 100644 (file)
@@ -23,6 +23,22 @@ RCSID("$Header$");
 #include <netdb.h>
 #include <netinet/in.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
 #include <rx/rx.h>
 #include <rx/xdr.h>
 #include <afs/rxgen_consts.h>
index 50464d8..048ff54 100644 (file)
@@ -22,6 +22,13 @@ RCSID("$Header$");
 #include <netinet/in.h>
 #include <netdb.h>
 #endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
 #include "ptserver.h"
 #include "pterror.h"