From ac263c30193203c237be44a8ea1d56d570fadfac Mon Sep 17 00:00:00 2001 From: Nathan Straz Date: Thu, 19 Jul 2012 11:25:13 -0400 Subject: Restore original sigmask before exec'ing child --- qarshd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qarshd.c') diff --git a/qarshd.c b/qarshd.c index fd4ca08..380a9a3 100644 --- a/qarshd.c +++ b/qarshd.c @@ -51,6 +51,7 @@ int debug = 0; /* Globals */ struct sockaddr_storage peername; int child_exitted = 0; +sigset_t orig_sigmask; /* A mini cache for rstat so we can check it in pushfile */ char *saved_path = NULL; @@ -105,6 +106,7 @@ run_cmd(const char *cmd, int p_in, int p_out, int p_err) if (pid == 0) { /* child */ setpgrp(); + sigprocmask(SIG_SETMASK, &orig_sigmask, NULL); /* Connect stdin, stdout, and stderr to qarsh */ new_in = connect_to_peer(&peername, p_in); @@ -251,7 +253,7 @@ handle_packets(int infd) int nfd; struct timespec timeout; struct qa_packet *qp = NULL, *rp = NULL; - sigset_t sigmask, orig_sigmask; + sigset_t sigmask; struct sigaction sa; pid_t child_pid = 0; -- cgit