Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 75941
Collapse All | Expand All

(-)hylafax-4.2.0.orig/hfaxd/InetFaxServer.c++ (-5 / +3 lines)
Lines 177-192 Link Here
177
/*
177
/*
178
 * Check host identity returned by gethostbyaddr to
178
 * Check host identity returned by gethostbyaddr to
179
 * weed out clients trying to spoof us (this is mostly
179
 * weed out clients trying to spoof us (this is mostly
180
 * a sanity check; it's still trivial to spoof).
180
 * a sanity check; if they have full control of DNS
181
 * If the name returned by gethostbyaddr is in our domain,
181
 * they can still spoof)
182
 * look up the name and check that the peer's address
182
 * Look up the name and check that the peer's address
183
 * corresponds to the host name.
183
 * corresponds to the host name.
184
 */
184
 */
185
bool
185
bool
186
InetFaxServer::checkHostIdentity(hostent*& hp)
186
InetFaxServer::checkHostIdentity(hostent*& hp)
187
{
187
{
188
    if (!isLocalDomain(hp->h_name))		// not local, don't check
189
	return (true);
190
    fxStr name(hp->h_name);			// must copy static value
188
    fxStr name(hp->h_name);			// must copy static value
191
    hp = Socket::gethostbyname(name);
189
    hp = Socket::gethostbyname(name);
192
    if (hp) {
190
    if (hp) {
(-)hylafax-4.2.0.orig/hfaxd/User.c++ (-2 / +12 lines)
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);

Return to bug 75941