[hackers] [sent] filter via shell pipeline || Grant Mathews
commit 54daf38b08afee88829f24ca8d282557bbb627fe
Author: Grant Mathews <grant.m.mathews_AT_gmail.com>
AuthorDate: Wed Dec 9 20:56:07 2015 -0800
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Thu Dec 24 01:51:29 2015 +0100
filter via shell pipeline
Instead of requiring an executable, allow building arbitrary shell
pipelines to filter filetypes through.
diff --git a/sent.c b/sent.c
index fc5e389..99361e8 100644
--- a/sent.c
+++ b/sent.c
_AT_@ -152,8 +152,8 @@ filter(int fd, const char *cmd)
dup2(fds[1], 1);
close(fds[0]);
close(fds[1]);
- execlp(cmd, cmd, (char *)0);
- eprintf("execlp %s:", cmd);
+ execlp("sh", "sh", "-c", cmd, (char *)0);
+ eprintf("execlp sh -c '%s':", cmd);
}
close(fds[1]);
return fds[0];
Received on Wed Jan 20 2016 - 08:22:46 CET
This archive was generated by hypermail 2.3.0
: Wed Jan 20 2016 - 08:24:16 CET