ptserver-warning-cleanup-20011005
[openafs.git] / src / ptserver / ptprocs.c
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] = "";