Lines 136-151
Link Here
|
136 |
* must supply. The next field is the password that |
136 |
* must supply. The next field is the password that |
137 |
* must be presented to gain administrative privileges. |
137 |
* must be presented to gain administrative privileges. |
138 |
* |
138 |
* |
|
|
139 |
* If the regex is a single word (no @ sign), we take it |
140 |
* as a host only short form for (^[^@]*@<input> |
141 |
* |
139 |
* If the first character of the <regex> is a ``!'' |
142 |
* If the first character of the <regex> is a ``!'' |
140 |
* then the line specifies user(s) to disallow; a match |
143 |
* then the line specifies user(s) to disallow; a match |
141 |
* causes the user to be rejected w/o a password prompt. |
144 |
* causes the user to be rejected w/o a password prompt. |
142 |
* This facility is mainly for backwards compatibility. |
145 |
* This facility is mainly for backwards compatibility. |
143 |
*/ |
146 |
*/ |
144 |
char* cp; |
147 |
char* cp; |
|
|
148 |
bool userandhost = false; |
145 |
for (cp = line; *cp && *cp != ':'; cp++) |
149 |
for (cp = line; *cp && *cp != ':'; cp++) |
146 |
; |
150 |
if (*cp == '@') userandhost = true; |
|
|
151 |
|
147 |
const char* base = &line[line[0] == '!']; |
152 |
const char* base = &line[line[0] == '!']; |
148 |
RE pat(base, cp-base); |
153 |
fxStr pattern(base, cp-base); |
|
|
154 |
if (! userandhost) { |
155 |
pattern.insert("^.*@"); |
156 |
pattern.append("$"); |
157 |
} |
158 |
RE pat(pattern); |
149 |
if (line[0] == '!') { // disallow access on match |
159 |
if (line[0] == '!') { // disallow access on match |
150 |
if (pat.Find(dotform) || pat.Find(hostform)) |
160 |
if (pat.Find(dotform) || pat.Find(hostform)) |
151 |
return (false); |
161 |
return (false); |