aboutsummaryrefslogtreecommitdiff
path: root/src/wrapacl.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2020-02-11 15:51:29 +0100
committerSergey Poznyakoff <gray@gnu.org.ua>2020-02-11 15:51:29 +0100
commit38d71b4e92d60b751ada2ee326acc22707aa5900 (patch)
tree94bdf2a2265d4f1e6f533d972c85816c71f4aeb0 /src/wrapacl.c
downloadping903-38d71b4e92d60b751ada2ee326acc22707aa5900.tar.gz
ping903-38d71b4e92d60b751ada2ee326acc22707aa5900.tar.bz2
Initial commit
Diffstat (limited to 'src/wrapacl.c')
-rw-r--r--src/wrapacl.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/wrapacl.c b/src/wrapacl.c
new file mode 100644
index 0000000..de6c2dd
--- /dev/null
+++ b/src/wrapacl.c
@@ -0,0 +1,21 @@
+/* This file is part of Ping903
+Copyright (C) 2020 Sergey Poznyakoff
+License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
+This is free software: you are free to change and redistribute it.
+There is NO WARRANTY, to the extent permitted by law.
+*/
+#include <tcpd.h>
+#include <microhttpd.h>
+
+int
+p903_httpd_acl(void *cls, const struct sockaddr *addr, socklen_t addrlen)
+{
+ struct request_info req;
+ request_init(&req,
+ RQ_DAEMON, "ping903",
+ RQ_CLIENT_SIN, addr,
+ RQ_SERVER_SIN, cls,
+ NULL);
+ sock_methods(&req);
+ return hosts_access(&req) ? MHD_YES : MHD_NO;
+}

Return to:

Send suggestions and report system problems to the System administrator.