]> andersk Git - moira.git/commitdiff
don't allow empty labels in names
authordanw <danw>
Mon, 1 Feb 1999 21:37:05 +0000 (21:37 +0000)
committerdanw <danw>
Mon, 1 Feb 1999 21:37:05 +0000 (21:37 +0000)
server/qsetup.pc

index 651839050a3e17340a6acba7484880936f4a0f25..b13e02601fa7df01f8cf6f440537cfd3bf81c489 100644 (file)
@@ -1180,7 +1180,8 @@ int hostname_check(char *name)
 
   /* Sanity check name: must contain only letters, numerals, and
    * hyphen, and not start or end with a hyphen. Also make sure no
-   * label (the thing the .s seperate) is longer than 63 characters.
+   * label (the thing the .s seperate) is longer than 63 characters,
+   * or empty.
    */
 
   for (p = name, count = 0; *p; p++)
@@ -1190,7 +1191,11 @@ int hostname_check(char *name)
          (*p == '-' && p[1] == '.'))
        return 0;
       if (*p == '.')
-       count = 0;
+       {
+         if (count == 1)
+           return 0;
+         count = 0;
+       }
       if (count == 64)
        return 0;
     }
This page took 0.044518 seconds and 5 git commands to generate.