Kaynağa Gözat

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

grunfink 1 yıl önce
ebeveyn
işleme
c2cac572e9
1 değiştirilmiş dosya ile 5 ekleme ve 0 silme
  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");