diff options
| author | 2025-06-03 03:31:31 +0200 | |
|---|---|---|
| committer | 2025-06-03 03:31:31 +0200 | |
| commit | 89c1a4a94b1032aed3af293c0f04d7a8f058ccda (patch) | |
| tree | e91751238268f0756bc4abe099d6afbf0db4ed65 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-89c1a4a94b1032aed3af293c0f04d7a8f058ccda.tar.gz snac2-89c1a4a94b1032aed3af293c0f04d7a8f058ccda.tar.xz snac2-89c1a4a94b1032aed3af293c0f04d7a8f058ccda.zip | |
Fixed regression while sending email via pipe on OpenBSD.
| -rw-r--r-- | sandbox.c | 8 |
1 files changed, 8 insertions, 0 deletions
| @@ -13,6 +13,8 @@ void sbox_enter(const char *basedir) | |||
| 13 | return; | 13 | return; |
| 14 | } | 14 | } |
| 15 | 15 | ||
| 16 | int smail = !xs_is_true(xs_dict_get(srv_config, "disable_email_notifications")); | ||
| 17 | |||
| 16 | srv_debug(1, xs_fmt("Calling unveil()")); | 18 | srv_debug(1, xs_fmt("Calling unveil()")); |
| 17 | unveil(basedir, "rwc"); | 19 | unveil(basedir, "rwc"); |
| 18 | unveil("/tmp", "rwc"); | 20 | unveil("/tmp", "rwc"); |
| @@ -25,6 +27,9 @@ void sbox_enter(const char *basedir) | |||
| 25 | if (*address == '/') | 27 | if (*address == '/') |
| 26 | unveil(address, "rwc"); | 28 | unveil(address, "rwc"); |
| 27 | 29 | ||
| 30 | if (smail) | ||
| 31 | unveil("/usr/sbin/sendmail", "x"); | ||
| 32 | |||
| 28 | unveil(NULL, NULL); | 33 | unveil(NULL, NULL); |
| 29 | 34 | ||
| 30 | srv_debug(1, xs_fmt("Calling pledge()")); | 35 | srv_debug(1, xs_fmt("Calling pledge()")); |
| @@ -34,6 +39,9 @@ void sbox_enter(const char *basedir) | |||
| 34 | if (*address == '/') | 39 | if (*address == '/') |
| 35 | p = xs_str_cat(p, " unix"); | 40 | p = xs_str_cat(p, " unix"); |
| 36 | 41 | ||
| 42 | if (smail) | ||
| 43 | p = xs_str_cat(p, " exec"); | ||
| 44 | |||
| 37 | pledge(p, NULL); | 45 | pledge(p, NULL); |
| 38 | } | 46 | } |
| 39 | 47 | ||