diff options
| author | 2024-04-02 17:44:27 +0200 | |
|---|---|---|
| committer | 2024-04-02 17:44:27 +0200 | |
| commit | b6f8d8e900fd7db1e8ffa886976f9ae4d520ba25 (patch) | |
| tree | 02dc166b9347c9934288097ddc25aec172d69ab6 | |
| parent | Updated RELEASE_NOTES. (diff) | |
| download | snac2-b6f8d8e900fd7db1e8ffa886976f9ae4d520ba25.tar.gz snac2-b6f8d8e900fd7db1e8ffa886976f9ae4d520ba25.tar.xz snac2-b6f8d8e900fd7db1e8ffa886976f9ae4d520ba25.zip | |
On OpenBSD, don't enable sendmail if email notifications are disabled.
| -rw-r--r-- | data.c | 13 |
1 files changed, 11 insertions, 2 deletions
| @@ -117,18 +117,27 @@ int srv_open(char *basedir, int auto_upgrade) | |||
| 117 | srv_debug(1, xs_dup("OpenBSD security disabled by admin")); | 117 | srv_debug(1, xs_dup("OpenBSD security disabled by admin")); |
| 118 | } | 118 | } |
| 119 | else { | 119 | else { |
| 120 | int smail = xs_type(xs_dict_get(srv_config, "disable_email_notifications")) != XSTYPE_TRUE; | ||
| 121 | |||
| 120 | srv_debug(1, xs_fmt("Calling unveil()")); | 122 | srv_debug(1, xs_fmt("Calling unveil()")); |
| 121 | unveil(basedir, "rwc"); | 123 | unveil(basedir, "rwc"); |
| 122 | unveil("/tmp", "rwc"); | 124 | unveil("/tmp", "rwc"); |
| 123 | unveil("/usr/sbin/sendmail", "x"); | ||
| 124 | unveil("/etc/resolv.conf", "r"); | 125 | unveil("/etc/resolv.conf", "r"); |
| 125 | unveil("/etc/hosts", "r"); | 126 | unveil("/etc/hosts", "r"); |
| 126 | unveil("/etc/ssl/openssl.cnf", "r"); | 127 | unveil("/etc/ssl/openssl.cnf", "r"); |
| 127 | unveil("/etc/ssl/cert.pem", "r"); | 128 | unveil("/etc/ssl/cert.pem", "r"); |
| 128 | unveil("/usr/share/zoneinfo", "r"); | 129 | unveil("/usr/share/zoneinfo", "r"); |
| 130 | |||
| 131 | if (smail) | ||
| 132 | unveil("/usr/sbin/sendmail", "x"); | ||
| 133 | |||
| 129 | unveil(NULL, NULL); | 134 | unveil(NULL, NULL); |
| 130 | srv_debug(1, xs_fmt("Calling pledge()")); | 135 | srv_debug(1, xs_fmt("Calling pledge()")); |
| 131 | pledge("stdio rpath wpath cpath flock inet proc exec dns fattr", NULL); | 136 | |
| 137 | if (smail) | ||
| 138 | pledge("stdio rpath wpath cpath flock inet proc exec dns fattr", NULL); | ||
| 139 | else | ||
| 140 | pledge("stdio rpath wpath cpath flock inet proc dns fattr", NULL); | ||
| 132 | } | 141 | } |
| 133 | #endif /* __OpenBSD__ */ | 142 | #endif /* __OpenBSD__ */ |
| 134 | 143 | ||