Unverified Commit 86f7c0f5 authored by Paul Haerle's avatar Paul Haerle Committed by GitHub
Browse files

opensmtpd: fix missing braces in proc_path.diff (#508031)

parents 0ab68845 dd0017c9
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -32,17 +32,22 @@ index 2365b1ee..b1b6bcec 100644
 	char		 exec[_POSIX_ARG_MAX];
 	int		 execr;
 
@@ -1455,8 +1462,12 @@ fork_filter_process(const char *name, const char *command, const char *user, con
 	if (command[0] == '/')
 		execr = snprintf(exec, sizeof(exec), "exec %s", command);
 	else
@@ -1455,7 +1462,12 @@ fork_filter_process(const char *name, const char *command, const char *user, con
-	if (command[0] == '/')
-		execr = snprintf(exec, sizeof(exec), "exec %s", command);
-	else
-		execr = snprintf(exec, sizeof(exec), "exec %s/%s", 
-		    PATH_LIBEXEC, command);
+	if (command[0] == '/') {
+		execr = snprintf(exec, sizeof(exec), "exec %s", command);
+	} else {
+		proc_path = getenv("OPENSMTPD_PROC_PATH");
+		if (proc_path == NULL) {
+			proc_path = PATH_LIBEXEC;
+		}
 		execr = snprintf(exec, sizeof(exec), "exec %s/%s", 
-		    PATH_LIBEXEC, command);
+		execr = snprintf(exec, sizeof(exec), "exec %s/%s",
+		    proc_path, command);
+	}
 	if (execr >= (int) sizeof(exec))
 		fatalx("%s: exec path too long", name);