From 921a959bc43275dc2a39ac3cc95b738d7ea98cf2 Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Tue, 22 Aug 2023 15:03:02 +0000 Subject: Respond 403 on EACCES Signed-off-by: Laurent Bercot --- src/tipideed/regular.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/tipideed/regular.c') diff --git a/src/tipideed/regular.c b/src/tipideed/regular.c index 1ac1095..df4b157 100644 --- a/src/tipideed/regular.c +++ b/src/tipideed/regular.c @@ -1,5 +1,7 @@ /* ISC license. */ +#include + #include #include #include @@ -39,7 +41,12 @@ int respond_regular (tipidee_rql const *rql, char const *fn, uint64_t size, tipi if (fd == -1) { buffer_unput(buffer_1, n) ; - die500sys(rql, 111, "open ", fn) ; + if (errno == EACCES) + { + respond_403(rql) ; + return 0 ; + } + else die500sys(rql, 111, "open ", fn) ; } send_file(fd, size, fn) ; fd_close(fd) ; -- cgit v1.3.1