windows-strlwr-cellname-20080407
authorJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 7 Apr 2008 15:19:10 +0000 (15:19 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Mon, 7 Apr 2008 15:19:10 +0000 (15:19 +0000)
LICENSE MIT

cellnames are case insensitive and by convention they are lowercased.

src/WINNT/afsd/cm_config.c

index ddf2219..8812dab 100644 (file)
@@ -192,8 +192,10 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
            /* now see if this is the right cell */
             if (stricmp(lineBuffer+1, cellNamep) == 0) {
                /* found the cell we're looking for */
-               if (newCellNamep)
+               if (newCellNamep) {
                    strcpy(newCellNamep, lineBuffer+1);
+                    strlwr(newCellNamep);
+                }
                 inRightCell = 1;
                tracking = 0;
 #ifdef CELLSERV_DEBUG                
@@ -209,8 +211,10 @@ long cm_SearchCellFile(char *cellNamep, char *newCellNamep,
                    fclose(bestp);
                    return -5;
                }
-               if (newCellNamep)
+               if (newCellNamep) {
                    strcpy(newCellNamep, lineBuffer+1);
+                    strlwr(newCellNamep);
+                }
                inRightCell = 0;
                tracking = 0;
                partial = 1;
@@ -302,12 +306,14 @@ long cm_SearchCellByDNS(char *cellNamep, char *newCellNamep, int *ttl,
         for (i = 0; i < numServers; i++) {
             memcpy(&vlSockAddr.sin_addr.s_addr, &cellHostAddrs[i],
                    sizeof(long));
-           vlSockAddr.sin_family = AF_INET;
-           /* sin_port supplied by connection code */
-           if (procp)
-          (*procp)(rockp, &vlSockAddr, cellHostNames[i]);
-           if(newCellNamep)
-          strcpy(newCellNamep,cellNamep);
+            vlSockAddr.sin_family = AF_INET;
+            /* sin_port supplied by connection code */
+            if (procp)
+                (*procp)(rockp, &vlSockAddr, cellHostNames[i]);
+            if (newCellNamep) {
+                strcpy(newCellNamep,cellNamep);
+                strlwr(newCellNamep);
+            }
         }
         return 0;   /* found cell */
     }