summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorGravatar Karl Ramm <kcr@1ts.org>2013-10-27 12:38:47 -0400
committerGravatar Karl Ramm <kcr@1ts.org>2013-10-27 12:38:47 -0400
commitc5ff590650307a4259da459e78b34aa1eb72dd7c (patch)
tree96ca1d73f5f126eba9a84d749bae94727ec84eb5 /server
parent1783b0db8de653e7ab7200df5e2d470a9e9da094 (diff)
The logging is too chatty and the control flow is too incomprehensible
Diffstat (limited to 'server')
-rw-r--r--server/acl_files.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/server/acl_files.c b/server/acl_files.c
index 346abb7..9f67fd7 100644
--- a/server/acl_files.c
+++ b/server/acl_files.c
@@ -351,32 +351,25 @@ acl_check(char *acl, char *princ, struct sockaddr_in *who)
{
char *realm;
char *name;
- int result = -1;
+ int result = 0;
if (princ) {
name = strdup(princ);
realm = split_name(name);
if (acl_match(acl, name, realm, 1))
- result = 0;
- else if (acl_match(acl, name, realm, 0))
+ return 0;
+ if (acl_match(acl, name, realm, 0))
result = 1;
free(name);
}
- if (who && result != 0) {
+ if (who) {
if (acl_host_match(acl, who->sin_addr.s_addr, 1))
- result = 0;
- else if (acl_host_match(acl, who->sin_addr.s_addr, 0))
+ return 0;
+ if (acl_host_match(acl, who->sin_addr.s_addr, 0))
result = 1;
}
- if (result == -1)
- result = 0;
-
- syslog(LOG_DEBUG, "acl_check(%s, %s, %s) = %d", acl,
- princ ? princ : "NONE", who ? inet_ntoa(who->sin_addr) : "NONE",
- result);
-
return result;
}