snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit b7320f580d5cc83a120eb5eff720bfb9331dace3
parent 46985835fc312e1035b5df6daa0b8c9e0d2bcdd2
Author: shtrophic <christoph@liebender.dev>
Date:   Tue, 29 Apr 2025 23:31:04 +0200

allow sandbox to work with changed config values

Diffstat:
Msandbox.c | 9++++-----
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)