From b7320f580d5cc83a120eb5eff720bfb9331dace3 Mon Sep 17 00:00:00 2001 From: shtrophic Date: Tue, 29 Apr 2025 23:31:04 +0200 Subject: allow sandbox to work with changed config values --- sandbox.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'sandbox.c') diff --git a/sandbox.c b/sandbox.c index 5046104..1ea9c1c 100644 --- 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) -- cgit v1.2.3