summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathan Straz <nstraz@redhat.com>2012-07-19 11:25:13 -0400
committerNathan Straz <nstraz@redhat.com>2012-07-19 11:25:13 -0400
commitac263c30193203c237be44a8ea1d56d570fadfac (patch)
tree62a372c587efb8974b15861dba788b192f7d1009
parentd85776da1a34171a475b7e399a0945037d5c7094 (diff)
downloadqarsh-ac263c30193203c237be44a8ea1d56d570fadfac.tar.gz
qarsh-ac263c30193203c237be44a8ea1d56d570fadfac.tar.xz
qarsh-ac263c30193203c237be44a8ea1d56d570fadfac.zip
Restore original sigmask before exec'ing child
-rw-r--r--qarshd.c4
1 files changed, 3 insertions, 1 deletions
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;