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

Function in_domain

modules/aaa/mod_authz_host.c:59–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

57#endif
58
59static int in_domain(const char *domain, const char *what)
60{
61 int dl = strlen(domain);
62 int wl = strlen(what);
63
64 if ((wl - dl) >= 0) {
65 if (strcasecmp(domain, &what[wl - dl]) != 0) {
66 return 0;
67 }
68
69 /* Make sure we matched an *entire* subdomain --- if the user
70 * said 'allow from good.com', we don't want people from nogood.com
71 * to be able to get in.
72 */
73
74 if (wl == dl) {
75 return 1; /* matched whole thing */
76 }
77 else {
78 return (domain[0] == '.' || what[wl - dl - 1] == '.');
79 }
80 }
81 else {
82 return 0;
83 }
84}
85
86static const char *ip_parse_config(cmd_parms *cmd,
87 const char *require_line,

Callers 1

host_check_authorizationFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected