commit c3be99b
default
·
2025-01-06 06:33:23 +0000 UTC
parent 3d18a32
Fixed sandboxing of the unix socket.
1 files changed,
+8,
-2
+8,
-2
1@@ -63,8 +63,14 @@ LL_BEGIN(sbox_enter_linux_, const char* basedir, const char *address, int smail)
2 if (mtime("/etc/pki") > 0)
3 LL_PATH("/etc/pki", rf );
4
5- if (*address == '/')
6- LL_PATH(address, s);
7+ if (*address == '/') {
8+ /* the directory holding the socket must be allowed */
9+ xs *l = xs_split(address, "/");
10+ l = xs_list_del(l, -1);
11+ xs *sdir = xs_join(l, "/");
12+
13+ LL_PATH(sdir, s);
14+ }
15
16 if (smail)
17 LL_PATH("/usr/sbin/sendmail", x);