MCPcopy Create free account
hub / github.com/apache/httpd / in_domain

Function in_domain

modules/aaa/mod_access_compat.c:215–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213};
214
215static int in_domain(const char *domain, const char *what)
216{
217 int dl = strlen(domain);
218 int wl = strlen(what);
219
220 if ((wl - dl) >= 0) {
221 if (strcasecmp(domain, &what[wl - dl]) != 0) {
222 return 0;
223 }
224
225 /* Make sure we matched an *entire* subdomain --- if the user
226 * said 'allow from good.com', we don't want people from nogood.com
227 * to be able to get in.
228 */
229
230 if (wl == dl) {
231 return 1; /* matched whole thing */
232 }
233 else {
234 return (domain[0] == '.' || what[wl - dl - 1] == '.');
235 }
236 }
237 else {
238 return 0;
239 }
240}
241
242static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method)
243{

Callers 1

find_allowdenyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected