summaryrefslogtreecommitdiff
path: root/user/netqmail/0003-qmailremote-20170716.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/netqmail/0003-qmailremote-20170716.patch')
-rw-r--r--user/netqmail/0003-qmailremote-20170716.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/user/netqmail/0003-qmailremote-20170716.patch b/user/netqmail/0003-qmailremote-20170716.patch
new file mode 100644
index 000000000..706441d21
--- /dev/null
+++ b/user/netqmail/0003-qmailremote-20170716.patch
@@ -0,0 +1,62 @@
+<https://schmonz.com/qmail/remote>
+
+diff --git a/Makefile b/Makefile
+index 0f0e31a..8042611 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1462,11 +1462,11 @@ tcpto.h readwrite.h timeoutconn.h timeoutread.h timeoutwrite.h
+
+ qmail-rspawn: \
+ load qmail-rspawn.o spawn.o tcpto_clean.o now.o coe.o sig.a open.a \
+-seek.a lock.a wait.a fd.a stralloc.a alloc.a substdio.a error.a str.a \
++seek.a lock.a wait.a fd.a stralloc.a alloc.a substdio.a error.a env.a str.a \
+ auto_qmail.o auto_uids.o auto_spawn.o
+ ./load qmail-rspawn spawn.o tcpto_clean.o now.o coe.o \
+ sig.a open.a seek.a lock.a wait.a fd.a stralloc.a alloc.a \
+- substdio.a error.a str.a auto_qmail.o auto_uids.o \
++ substdio.a error.a env.a str.a auto_qmail.o auto_uids.o \
+ auto_spawn.o
+
+ qmail-rspawn.0: \
+@@ -1474,7 +1474,7 @@ qmail-rspawn.8
+ nroff -man qmail-rspawn.8 > qmail-rspawn.0
+
+ qmail-rspawn.o: \
+-compile qmail-rspawn.c fd.h wait.h substdio.h exit.h fork.h error.h \
++compile qmail-rspawn.c fd.h wait.h substdio.h exit.h fork.h error.h env.h \
+ tcpto.h
+ ./compile qmail-rspawn.c
+
+diff --git a/qmail-rspawn.c b/qmail-rspawn.c
+index 9d838e6..e064db1 100644
+--- a/qmail-rspawn.c
++++ b/qmail-rspawn.c
+@@ -5,6 +5,17 @@
+ #include "fork.h"
+ #include "error.h"
+ #include "tcpto.h"
++#include "env.h"
++
++static char *qrargs[1] = { 0 };
++
++static void setup_qrargs()
++{
++ if (!qrargs[0])
++ qrargs[0] = env_get("QMAILREMOTE");
++ if (!qrargs[0])
++ qrargs[0] = "qmail-remote";
++}
+
+ void initialize(argc,argv)
+ int argc;
+@@ -84,7 +95,9 @@ char *s; char *r; int at;
+ int f;
+ char *(args[5]);
+
+- args[0] = "qmail-remote";
++ setup_qrargs();
++
++ args[0] = qrargs[0];
+ args[1] = r + at + 1;
+ args[2] = s;
+ args[3] = r;