diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2007-10-02 00:27:45 +0200 |
---|---|---|
committer | Johannes Berg <johannes@sipsolutions.net> | 2007-10-02 00:27:45 +0200 |
commit | 774dea2a6c61b074425f0eb0b7751c1f7c17433d (patch) | |
tree | c0c5c69071f389d801eab20a78828a26fcc9f3b8 | |
parent | 08a43776866b6679f6a1f19be5f64f6e2c5b622d (diff) | |
download | dovecot-antispam-774dea2a6c61b074425f0eb0b7751c1f7c17433d.tar.gz dovecot-antispam-774dea2a6c61b074425f0eb0b7751c1f7c17433d.tar.xz dovecot-antispam-774dea2a6c61b074425f0eb0b7751c1f7c17433d.zip |
fix crm114, it works
-rw-r--r-- | crm114-exec.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/crm114-exec.c b/crm114-exec.c index 9e701fd..a10ba09 100644 --- a/crm114-exec.c +++ b/crm114-exec.c @@ -43,10 +43,10 @@ static int call_reaver(const char *signature, enum classification wanted) switch (wanted) { case CLASS_NOTSPAM: - class_arg = "good"; + class_arg = "--good"; break; case CLASS_SPAM: - class_arg = "spam"; + class_arg = "--spam"; break; } @@ -54,7 +54,8 @@ static int call_reaver(const char *signature, enum classification wanted) * For reaver stdin, it wants to read a full message but * really only needs the signature. */ - pipe(pipes); + if (pipe(pipes)) + return -1; pid = fork(); if (pid < 0) @@ -97,13 +98,13 @@ static int call_reaver(const char *signature, enum classification wanted) /* see above */ close(pipes[1]); - if (dup2(pipes[0], 0) != 2) + if (dup2(pipes[0], 0) != 0) exit(1); close(pipes[0]); - if (dup2(fd, 1) != 0) + if (dup2(fd, 1) != 1) exit(1); - if (dup2(fd, 2) != 0) + if (dup2(fd, 2) != 2) exit(1); close(fd); |