@@ -345,8 +345,8 @@ mon_backchannel_cb(int fd, int what, void *v)
345345 * Returns only if execve() fails.
346346 */
347347static void
348- exec_cmnd_pty (struct command_details * details , sigset_t * mask ,
349- bool foreground , int intercept_fd , int errfd )
348+ exec_cmnd_pty (struct command_details * details , bool foreground ,
349+ int intercept_fd , int errfd )
350350{
351351 volatile pid_t self = getpid ();
352352 debug_decl (exec_cmnd_pty , SUDO_DEBUG_EXEC );
@@ -396,7 +396,7 @@ exec_cmnd_pty(struct command_details *details, sigset_t *mask,
396396 /* Execute command; only returns on error. */
397397 sudo_debug_printf (SUDO_DEBUG_INFO , "executing %s in the %s" ,
398398 details -> command , foreground ? "foreground" : "background" );
399- exec_cmnd (details , mask , intercept_fd , errfd );
399+ exec_cmnd (details , intercept_fd , errfd );
400400
401401 debug_return ;
402402}
@@ -542,12 +542,11 @@ pty_make_controlling(const char *follower)
542542 * resets signal handlers and forks a child to call exec_cmnd_pty().
543543 * Waits for status changes from the command and relays them to the
544544 * parent and relays signals from the parent to the command.
545- * Must be called with signals blocked and the old signal mask in oset.
546545 * Returns an error if fork(2) fails, else calls _exit(2).
547546 */
548547int
549- exec_monitor (struct command_details * details , sigset_t * oset ,
550- bool foreground , int backchannel , int intercept_fd )
548+ exec_monitor (struct command_details * details , bool foreground ,
549+ int backchannel , int intercept_fd )
551550{
552551 struct monitor_closure mc ;
553552 struct command_status cstat ;
@@ -622,9 +621,6 @@ exec_monitor(struct command_details *details, sigset_t *oset,
622621 */
623622 init_exec_events_monitor (& mc , errsock [0 ]);
624623
625- /* Restore signal mask now that signal handlers are setup. */
626- sigprocmask (SIG_SETMASK , oset , NULL );
627-
628624 mc .cmnd_pid = sudo_debug_fork ();
629625 switch (mc .cmnd_pid ) {
630626 case -1 :
@@ -641,7 +637,7 @@ exec_monitor(struct command_details *details, sigset_t *oset,
641637 close (backchannel );
642638 close (errsock [0 ]);
643639 /* setup tty and exec command */
644- exec_cmnd_pty (details , oset , foreground , intercept_fd , errsock [1 ]);
640+ exec_cmnd_pty (details , foreground , intercept_fd , errsock [1 ]);
645641 if (send (errsock [1 ], & errno , sizeof (int ), 0 ) == -1 )
646642 sudo_warn (U_ ("unable to execute %s" ), details -> command );
647643 _exit (EXIT_FAILURE );
0 commit comments