diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2023-11-06 12:36:28 +0000 |
---|---|---|
committer | Laurent Bercot <ska@appnovation.com> | 2023-11-06 12:36:28 +0000 |
commit | ec59cfb58177bdf1cdd4cfd16ce69a3cc3cfa304 (patch) | |
tree | 4abf5796803646f33bbf9999058b2e0e40114fc1 /src/conn-tools | |
parent | 80bf12f9d36f7feed01d0ca8b03dcdb814e48c1a (diff) | |
download | s6-networking-ec59cfb58177bdf1cdd4cfd16ce69a3cc3cfa304.tar.xz |
s6-tcpserver-access: don't use errno in deny messages
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/conn-tools')
-rw-r--r-- | src/conn-tools/s6-tcpserver-access.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/conn-tools/s6-tcpserver-access.c b/src/conn-tools/s6-tcpserver-access.c index ddd6072..e8c868a 100644 --- a/src/conn-tools/s6-tcpserver-access.c +++ b/src/conn-tools/s6-tcpserver-access.c @@ -46,7 +46,7 @@ static void logit (pid_t pid, ip46 const *ip, int h) fmtip[ip46_fmt(fmtip, ip)] = 0 ; fmtpid[pid_fmt(fmtpid, pid)] = 0 ; if (h) strerr_warni5x("allow", " pid ", fmtpid, " ip ", fmtip) ; - else strerr_warni5sys("deny", " pid ", fmtpid, " ip ", fmtip) ; + else strerr_warni5x("deny", " pid ", fmtpid, " ip ", fmtip) ; } static inline void log_accept (pid_t pid, ip46 const *ip) @@ -176,11 +176,11 @@ int main (int argc, char const *const *argv) strerr_diefu6sys(111, "check ", rulestypestr[rulestype], " ruleset for ", "IP", " in ", rules) ; case S6_ACCESSRULES_ALLOW : break ; case S6_ACCESSRULES_DENY : - if (verbosity >= 2) { errno = EACCES ; log_deny(getpid(), &remoteip) ; } + if (verbosity >= 2) log_deny(getpid(), &remoteip) ; return 1 ; case S6_ACCESSRULES_NOTFOUND : if (flagdnslookup) break ; - if (verbosity >= 2) { errno = ENOENT ; log_deny(getpid(), &remoteip) ; } + if (verbosity >= 2) log_deny(getpid(), &remoteip) ; return 1 ; default: X() ; } @@ -361,10 +361,10 @@ int main (int argc, char const *const *argv) strerr_diefu6sys(111, "check ", rulestypestr[rulestype], " ruleset for ", "reverse DNS", " in ", rules) ; case S6_ACCESSRULES_ALLOW : break ; case S6_ACCESSRULES_DENY : - if (verbosity >= 2) { errno = EACCES ; log_deny(getpid(), &remoteip) ; } + if (verbosity >= 2) log_deny(getpid(), &remoteip) ; return 1 ; case S6_ACCESSRULES_NOTFOUND : - if (verbosity >= 2) { errno = ENOENT ; log_deny(getpid(), &remoteip) ; } + if (verbosity >= 2) log_deny(getpid(), &remoteip) ; return 1 ; default : X() ; } |