Procházet zdrojové kódy

Don't enable unveil() and pledge() for sendmail spawn if "smtp_url" is set.

grunfink před 1 rokem
rodič
revize
c2cac572e9
1 změnil soubory, kde provedl 5 přidání a 0 odebrání
  1. 5 0
      sandbox.c

+ 5 - 0
sandbox.c

@@ -15,6 +15,11 @@ void sbox_enter(const char *basedir)
 
     int smail = !xs_is_true(xs_dict_get(srv_config, "disable_email_notifications"));
 
+    const char *url = xs_dict_get(srv_config, "smtp_url");
+
+    if (xs_is_string(url) && *url)
+        smail = 0;
+
     srv_debug(1, xs_fmt("Calling unveil()"));
     unveil(basedir,                "rwc");
     unveil("/tmp",                 "rwc");