commit 89c1a4a94b1032aed3af293c0f04d7a8f058ccda
parent 27caa511503b55af87483702aacc6051cc412f82
Author: grunfink <grunfink@comam.es>
Date: Tue, 3 Jun 2025 03:31:31 +0200
Fixed regression while sending email via pipe on OpenBSD.
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/sandbox.c b/sandbox.c
@@ -13,6 +13,8 @@ void sbox_enter(const char *basedir)
return;
}
+ int smail = !xs_is_true(xs_dict_get(srv_config, "disable_email_notifications"));
+
srv_debug(1, xs_fmt("Calling unveil()"));
unveil(basedir, "rwc");
unveil("/tmp", "rwc");
@@ -25,6 +27,9 @@ void sbox_enter(const char *basedir)
if (*address == '/')
unveil(address, "rwc");
+ if (smail)
+ unveil("/usr/sbin/sendmail", "x");
+
unveil(NULL, NULL);
srv_debug(1, xs_fmt("Calling pledge()"));
@@ -34,6 +39,9 @@ void sbox_enter(const char *basedir)
if (*address == '/')
p = xs_str_cat(p, " unix");
+ if (smail)
+ p = xs_str_cat(p, " exec");
+
pledge(p, NULL);
}