From c577378f5dbedad54acc364246b10b9fc7ce43bb Mon Sep 17 00:00:00 2001 From: Michael Poole Date: Sat, 23 Sep 2006 00:58:27 +0000 Subject: [PATCH] Fix hostmask generation for hostnames without dots. 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 | 14 ++++++++++++++ src/proto-common.c | 4 ++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4aed6a9..9ca8a5e 100644 --- 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 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 patch-46 Summary: diff --git a/src/proto-common.c b/src/proto-common.c index 68cdfbc..64a43d9 100644 --- a/src/proto-common.c +++ b/src/proto-common.c @@ -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. */ -- 2.20.1