blob: 706441d217e91306459dc72a25b4bdd797a8d1db (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
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;
|