Quellcode durchsuchen

Fixed regression while sending email via pipe on OpenBSD.

grunfink vor 1 Jahr
Ursprung
Commit
89c1a4a94b
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  1. 8 0
      sandbox.c

+ 8 - 0
sandbox.c

@@ -13,6 +13,8 @@ void sbox_enter(const char *basedir)
         return;
         return;
     }
     }
 
 
+    int smail = !xs_is_true(xs_dict_get(srv_config, "disable_email_notifications"));
+
     srv_debug(1, xs_fmt("Calling unveil()"));
     srv_debug(1, xs_fmt("Calling unveil()"));
     unveil(basedir,                "rwc");
     unveil(basedir,                "rwc");
     unveil("/tmp",                 "rwc");
     unveil("/tmp",                 "rwc");
@@ -25,6 +27,9 @@ void sbox_enter(const char *basedir)
     if (*address == '/')
     if (*address == '/')
         unveil(address, "rwc");
         unveil(address, "rwc");
 
 
+    if (smail)
+        unveil("/usr/sbin/sendmail",   "x");
+
     unveil(NULL,                   NULL);
     unveil(NULL,                   NULL);
 
 
     srv_debug(1, xs_fmt("Calling pledge()"));
     srv_debug(1, xs_fmt("Calling pledge()"));
@@ -34,6 +39,9 @@ void sbox_enter(const char *basedir)
     if (*address == '/')
     if (*address == '/')
         p = xs_str_cat(p, " unix");
         p = xs_str_cat(p, " unix");
 
 
+    if (smail)
+        p = xs_str_cat(p, " exec");
+
     pledge(p, NULL);
     pledge(p, NULL);
 }
 }