@@ -1,11 +1,12 @@
1−diff -Naur opensmtpd-5.7.1p1/smtpd/parse.y opensmtpd-5.7.1p1.patched/smtpd/parse.y
2−--- opensmtpd-5.7.1p1/smtpd/parse.y 2015-06-30 10:13:34.000000000 +0200
3−+++ opensmtpd-5.7.1p1.patched/smtpd/parse.y 2015-09-26 08:41:17.012472516 +0200
4−@@ -2519,13 +2519,19 @@
1+diff --git a/smtpd/parse.y b/smtpd/parse.y
2+index ab02719..c1c77d9 100644
3+--- a/smtpd/parse.y
4++++ b/smtpd/parse.y
5+@@ -2534,13 +2534,19 @@ create_filter_proc(char *name, char *prog)
56 {
67 struct filter_conf *f;
78 char *path;
8−+ const char *proc_path;
9++ const char *proc_path;
910
1011 if (dict_get(&conf->sc_filters, name)) {
1112 yyerror("filter \"%s\" already defined", name);
@@ -13,64 +14,71 @@ diff -Naur opensmtpd-5.7.1p1/smtpd/parse.y opensmtpd-5.7.1p1.patched/smtpd/parse
1314 }
1415
1516- if (asprintf(&path, "%s/filter-%s", PATH_LIBEXEC, prog) == -1) {
16−+ proc_path = getenv("OPENSMTPD_PROC_PATH");
17−+ if (proc_path == NULL) {
18−+ proc_path = PATH_LIBEXEC;
19−+ }
17++ proc_path = getenv("OPENSMTPD_PROC_PATH");
18++ if (proc_path == NULL) {
19++ proc_path = PATH_LIBEXEC;
20++ }
2021+
2122+ if (asprintf(&path, "%s/filter-%s", proc_path, prog) == -1) {
2223 yyerror("filter \"%s\" asprintf failed", name);
2324 return (0);
2425 }
25−diff -Naur opensmtpd-5.7.1p1/smtpd/smtpd.c opensmtpd-5.7.1p1.patched/smtpd/smtpd.c
26−--- opensmtpd-5.7.1p1/smtpd/smtpd.c 2015-06-30 10:13:34.000000000 +0200
27−+++ opensmtpd-5.7.1p1.patched/smtpd/smtpd.c 2015-09-26 08:41:16.998472557 +0200
28−@@ -854,6 +854,7 @@
26+diff --git a/smtpd/smtpd.c b/smtpd/smtpd.c
27+index afc8891..9b0a80f 100644
28+--- a/smtpd/smtpd.c
29++++ b/smtpd/smtpd.c
30+@@ -795,6 +795,7 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
2931 char path[PATH_MAX];
3032 char name[PATH_MAX];
3133 char *arg;
32−+ char *proc_path;
34++ char *proc_path;
3335
3436 if (strlcpy(name, conf, sizeof(name)) >= sizeof(name)) {
3537 log_warnx("warn: %s-proc: conf too long", key);
36−@@ -864,7 +865,12 @@
38+@@ -805,7 +806,12 @@ fork_proc_backend(const char *key, const char *conf, const char *procname)
3739 if (arg)
3840 *arg++ = '\0';
3941
4042- if (snprintf(path, sizeof(path), PATH_LIBEXEC "/%s-%s", key, name) >=
41−+ proc_path = getenv("OPENSMTPD_PROC_PATH");
42−+ if (proc_path == NULL) {
43−+ proc_path = PATH_LIBEXEC;
44−+ }
43++ proc_path = getenv("OPENSMTPD_PROC_PATH");
44++ if (proc_path == NULL) {
45++ proc_path = PATH_LIBEXEC;
46++ }
4547+
4648+ if (snprintf(path, sizeof(path), "%s/%s-%s", proc_path, key, name) >=
4749 (ssize_t)sizeof(path)) {
4850 log_warn("warn: %s-proc: exec path too long", key);
4951 return (-1);
50−diff -Naur opensmtpd-5.7.1p1/smtpd/table.c opensmtpd-5.7.1p1.patched/smtpd/table.c
51−--- opensmtpd-5.7.1p1/smtpd/table.c 2015-06-30 10:13:34.000000000 +0200
52−+++ opensmtpd-5.7.1p1.patched/smtpd/table.c 2015-09-26 08:41:17.005472536 +0200
53−@@ -201,6 +201,7 @@
52+diff --git a/smtpd/table.c b/smtpd/table.c
53+index 21ee237..95b5164 100644
54+--- a/smtpd/table.c
55++++ b/smtpd/table.c
56+@@ -193,6 +193,7 @@ table_create(const char *backend, const char *name, const char *tag,
5457 struct table_backend *tb;
5558 char buf[LINE_MAX];
5659 char path[LINE_MAX];
57−+ const char *proc_path;
60++ const char *proc_path;
5861 size_t n;
5962 struct stat sb;
6063
61−@@ -215,8 +216,14 @@
64+@@ -207,11 +208,16 @@ table_create(const char *backend, const char *name, const char *tag,
6265 if (name && table_find(name, NULL))
6366 fatalx("table_create: table \"%s\" already defined", name);
6467
65−+ proc_path = getenv("OPENSMTPD_PROC_PATH");
66−+ if (proc_path == NULL) {
67−+ proc_path = PATH_LIBEXEC;
68−+ }
68++ proc_path = getenv("OPENSMTPD_PROC_PATH");
69++ if (proc_path == NULL) {
70++ proc_path = PATH_LIBEXEC;
71++ }
6972+
7073 if ((tb = table_backend_lookup(backend)) == NULL) {
71−- if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC "/table-%s",
74+- if ((size_t)snprintf(path, sizeof(path), PATH_LIBEXEC"/table-%s",
75+- backend) >= sizeof(path)) {
76+- fatalx("table_create: path too long \""
77+- PATH_LIBEXEC"/table-%s\"", backend);
7278+ if ((size_t)snprintf(path, sizeof(path), "%s/table-%s",
73−+ proc_path,
74− backend) >= sizeof(path)) {
75− fatalx("table_create: path too long \""
76− PATH_LIBEXEC "/table-%s\"", backend);
79++ proc_path, backend) >= sizeof(path)) {
80++ fatalx("table_create: path too long \"%s/table-%s\"",
81++ proc_path, backend);
82+ }
83+ if (stat(path, &sb) == 0) {
84+ tb = table_backend_lookup("proc");