summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/bash-c.c36
-rwxr-xr-x[-rw-r--r--]tools/hi-test.conf2
-rwxr-xr-x[-rw-r--r--]tools/hi-test2.conf10
-rwxr-xr-xtools/hi-test3.conf2
-rw-r--r--tools/makefile5
-rwxr-xr-xtools/t-bash-c3
6 files changed, 51 insertions, 7 deletions
diff --git a/tools/bash-c.c b/tools/bash-c.c
new file mode 100644
index 0000000..6b2844d
--- /dev/null
+++ b/tools/bash-c.c
@@ -0,0 +1,36 @@
+//////////////
+
+using namespace std;
+#include <iostream>
+#include <string>
+#include <unistd.h>
+#include <sys/types.h>
+#include <stdio.h> /* for perror() */
+#include <stdlib.h> /* for exit() */
+
+
+string dirname(const string path){
+ size_t where = path.rfind("/");
+ if (where == string::npos) return ".";
+ return path.substr(0, where);
+}
+
+int main(int argc, char** argv){
+ int verbosity(0);
+
+ char* nargv[1+argc];
+ for (int ii = 1; ii <= argc; ii++){
+ if (verbosity) {
+ if (argv[ii] == 0) cout << "zero" << endl;
+ else cout << "[" << argv[ii] << "]" << endl;
+ }
+ nargv[1+ii] = argv[ii];
+ }
+ nargv[1] = (char*)"-c";
+ nargv[0] = (char*)"/home/jsd/bin/ECHO";
+ nargv[0] = (char*)"/bin/bash";
+
+ execv(*nargv, nargv);
+ cerr << "bash-c: exec failed for '" << *nargv << "' : ";
+ perror(0);
+}
diff --git a/tools/hi-test.conf b/tools/hi-test.conf
index aa6a1cf..f692f37 100644..100755
--- a/tools/hi-test.conf
+++ b/tools/hi-test.conf
@@ -1,4 +1,4 @@
-# comment
+#! /usr/local/bin/bash-c set -x ; </dev/null TCPREMOTEHOST=asf TCPREMOTEIP=1.2.3.4 hi-q $0 ; echo $?
# another comment, with blank line between
series hi-test x0 -snooze 10
diff --git a/tools/hi-test2.conf b/tools/hi-test2.conf
index 370ba77..50f231e 100644..100755
--- a/tools/hi-test2.conf
+++ b/tools/hi-test2.conf
@@ -1,6 +1,8 @@
+#! /usr/local/bin/bash-c set -x ; </dev/null 1</dev/null TCPREMOTEHOST=asf TCPREMOTEIP=1.2.3.4 hi-q $0 ; echo $?
+
stub hi-test x0 -snooze 2
-stub hi-test x0 -snooze 1 -exit 0
-stub greylist -suffix (sfx) -v -p 10
-qq hi-test x1 -snooze 3 -exit 3
+stub hi-test x0 -snooze 1 -exit 21 # could be 0 or 21
+stub greylist -suffix (sfx) -v -stain 10
+qq hi-test x1 -snooze 3 -exit 3 # last one controls timing, if all others exit 0
-postspam /bin/echo post spam !
+postspam /usr/local/bin/ECHO2 postspam command!
diff --git a/tools/hi-test3.conf b/tools/hi-test3.conf
index 714073a..a09227b 100755
--- a/tools/hi-test3.conf
+++ b/tools/hi-test3.conf
@@ -1,4 +1,4 @@
-#! /bin/echo 1</dev/null </dev/null hi-q hi-test3.conf
+#! /usr/local/bin/bash-c set -x ; </dev/null 1</dev/null TCPREMOTEHOST=asf TCPREMOTEIP=1.2.3.4 hi-q $0 ; echo $?
stub hi-test x0 -snooze 10
sa hi-test x1 -snooze 1 -exit 0
diff --git a/tools/makefile b/tools/makefile
index 43418ce..5dc7952 100644
--- a/tools/makefile
+++ b/tools/makefile
@@ -12,7 +12,9 @@ CC= /usr/bin/g++ -Wall -g -I $(HOME)/lib/include
qprogs = pido hi-q skrewt hi-test mail-scan greylist wripper
-all: $(qprogs) wripper
+moreprogs = wripper bash-c
+
+all: $(qprogs) $(moreprogs)
greylist: greylist.o
$(CC) $< -lboost_filesystem-mt -o $@
@@ -28,6 +30,7 @@ mail-scan: mail-scan.o
install:
install $(qprogs) /var/qmail/bin/
install -gdaemon -m2755 wripper /usr/lib/mailman/mail/
+ install bash-c /usr/local/bin/
cp filters.conf aufilters.conf /var/qmail/control/
install -m700 -d /var/qmail/rbin
chown qmaild /var/qmail/rbin
diff --git a/tools/t-bash-c b/tools/t-bash-c
new file mode 100755
index 0000000..5a5c261
--- /dev/null
+++ b/tools/t-bash-c
@@ -0,0 +1,3 @@
+#! /usr/src/qmail/tools/bash-c /bin/echo a b c script: $0
+foo
+bar