commit 7370cf822832c26812c535ed5fb73d699cb14064
parent 46985835fc312e1035b5df6daa0b8c9e0d2bcdd2
Author: grunfink <grunfink@noreply.codeberg.org>
Date: Wed, 30 Apr 2025 06:21:06 +0000
Merge pull request 'Fix: make landlock work with `smtp_url`' (#378) from shtrophic/snac2:master into master
Reviewed-on: https://codeberg.org/grunfink/snac2/pulls/378
Diffstat:
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/sandbox.c b/sandbox.c
@@ -107,9 +107,9 @@ LL_BEGIN(sbox_enter_linux_, const char* basedir, const char *address, int smtp_p
void sbox_enter(const char *basedir)
{
- const xs_val *v;
const char *errstr;
const char *address = xs_dict_get(srv_config, "address");
+ const char *smtp_url = xs_dict_get(srv_config, "smtp_url");
int smtp_port = -1;
if (xs_is_true(xs_dict_get(srv_config, "disable_sandbox"))) {
@@ -117,11 +117,10 @@ void sbox_enter(const char *basedir)
return;
}
- if ((v = xs_dict_get(srv_config, "email_notifications")) &&
- (v = xs_dict_get(v, "url"))) {
- smtp_port = parse_port((const char *)v, &errstr);
+ if (xs_is_string(smtp_url) && *smtp_url != '\0') {
+ smtp_port = parse_port(smtp_url, &errstr);
if (errstr)
- srv_debug(0, xs_fmt("Couldn't determine port from '%s': %s", (const char *)v, errstr));
+ srv_debug(0, xs_fmt("Couldn't determine port from '%s': %s", smtp_url, errstr));
}
if (sbox_enter_linux_(basedir, address, smtp_port) == 0)