projects
/
srvx.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix hostmask generation for hostnames without dots.
[srvx.git]
/
src
/
proto-common.c
diff --git
a/src/proto-common.c
b/src/proto-common.c
index 68cdfbc15ab76ccbf39926568b36791f870b844f..64a43d927739d4910941a7dd82c222f520e35f35 100644
(file)
--- 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++;
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. */
} else if (cnt == 2) {
for (ii=0; user->hostname[ii] != '.'; ii++) ;
/* Add 3 to account for the *. and \0. */