aboutsummaryrefslogtreecommitdiff
path: root/usr.sbin/cron
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2015-12-22 15:32:45 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2015-12-22 15:32:45 +0000
commitd985028157fa5cb2d129767be56c197611a7b3fd (patch)
tree7343ea248cf4f747f1ac268e8c12d6a3af636c93 /usr.sbin/cron
parent7044922b395c23e4cfce6ac44edf56717d94eafe (diff)
downloadsrc-d985028157fa5cb2d129767be56c197611a7b3fd.tar.gz
src-d985028157fa5cb2d129767be56c197611a7b3fd.zip
Notes
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r--usr.sbin/cron/cron/do_command.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c
index 8dfd4f66aa8f..d570c84a1d37 100644
--- a/usr.sbin/cron/cron/do_command.c
+++ b/usr.sbin/cron/cron/do_command.c
@@ -114,7 +114,7 @@ child_process(e, u)
struct pam_conv pamc = {
.conv = openpam_nullconv,
.appdata_ptr = NULL
- };
+ }
Debug(DPROC, ("[%d] checking account with PAM\n", getpid()))
@@ -161,8 +161,10 @@ child_process(e, u)
/* create some pipes to talk to our future child
*/
- pipe(stdin_pipe); /* child's stdin */
- pipe(stdout_pipe); /* child's stdout */
+ if (pipe(stdin_pipe) != 0 || pipe(stdout_pipe) != 0) {
+ log_it("CRON", getpid(), "error", "can't pipe");
+ exit(ERROR_EXIT);
+ }
/* since we are a forked process, we can diddle the command string
* we were passed -- nobody else is going to use it again, right?