Add tcsetpgrp_nobg() which acts like tcsetpgrp() but returns -1

for a background process.  This is safer than blocking SIGTTOU
which would cause tcsetpgrp() to succeed in the background.
This commit is contained in:
Todd C. Miller
2017-03-07 12:29:21 -07:00
parent 2f074d33ab
commit af1482f487
5 changed files with 91 additions and 13 deletions

View File

@@ -271,4 +271,7 @@ int add_preserved_fd(struct preserved_fd_list *pfds, int fd);
void closefrom_except(int startfd, struct preserved_fd_list *pfds);
void parse_preserved_fds(struct preserved_fd_list *pfds, const char *fdstr);
/* setpgrp_nobg.c */
int tcsetpgrp_nobg(int fd, pid_t pgrp_id);
#endif /* SUDO_SUDO_H */