Fix hostmask generation for hostnames without dots.
authorMichael Poole <mdpoole@troilus.org>
Sat, 23 Sep 2006 00:58:27 +0000 (00:58 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 23 Sep 2006 00:58:27 +0000 (00:58 +0000)
src/proto-common.c (generate_hostmask): Keep no-dot hostnames as the
    mask -- mod-qserver can generate hostnames like "localhost".
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-47

ChangeLog
src/proto-common.c

index 4aed6a951dc2618bbb03a88e8ea8e9786aefc37b..9ca8a5e689ba3835e327b2bfa73dba6c049c7297 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
 #
 
+2006-09-23 00:58:27 GMT        Michael Poole <mdpoole@troilus.org>     patch-47
+
+    Summary:
+      Fix hostmask generation for hostnames without dots.
+    Revision:
+      srvx--devo--1.3--patch-47
+
+    src/proto-common.c (generate_hostmask): Keep no-dot hostnames as the
+        mask -- mod-qserver can generate hostnames like "localhost".
+
+    modified files:
+     ChangeLog src/proto-common.c
+
+
 2006-09-23 00:55:02 GMT        Michael Poole <mdpoole@troilus.org>     patch-46
 
     Summary:
index 68cdfbc15ab76ccbf39926568b36791f870b844f..64a43d927739d4910941a7dd82c222f520e35f35 100644 (file)
@@ -738,8 +738,8 @@ generate_hostmask(struct userNode *user, int options)
         for (ii=cnt=0; hostname[ii]; ii++)
             if (hostname[ii] == '.')
                 cnt++;
-        if (cnt == 1) {
-            /* only a two-level domain name; leave hostname */
+        if (cnt == 0 || cnt == 1) {
+            /* only a one- or two-level domain name; leave hostname */
         } else if (cnt == 2) {
             for (ii=0; user->hostname[ii] != '.'; ii++) ;
             /* Add 3 to account for the *. and \0. */