Commit Diff


commit - 7258013668ef07ebc2c942108e7b4851c327adaa
commit + 721f8c43be7c7bdd557317229426e2ced3d70793
blob - 8f324e536ea02ba338e434de491b4f778535a399
blob + 519feca8e0c35aef53585cbe5ea3ddc21da5fcf7
--- main.c
+++ main.c
@@ -29,6 +29,7 @@
 #include <limits.h>
 #include <netdb.h>
 #include <opensmtpd.h>
+#include <paths.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -169,7 +170,9 @@ main(int argc, char *argv[])
 
 	OpenSSL_add_all_digests();
 
-	if (pledge("tmppath stdio dns", NULL) == -1)
+	if (unveil(_PATH_TMP, "rwc") == -1)
+		osmtpd_err(1, "unveil");
+	if (pledge("stdio rpath wpath cpath dns", NULL) == -1)
 		osmtpd_err(1, "pledge");
 
 	if ((ectx = EVP_ENCODE_CTX_new()) == NULL)