diff --git a/config.h.in b/config.h.in index d50bbeecb..4b89d48a0 100644 --- a/config.h.in +++ b/config.h.in @@ -421,9 +421,6 @@ /* Define to 1 if you have the `setrlimit64' function. */ #undef HAVE_SETRLIMIT64 -/* Define to 1 if you have the `setsid' function. */ -#undef HAVE_SETSID - /* Define to 1 if you have the `set_auth_parameters' function. */ #undef HAVE_SET_AUTH_PARAMETERS diff --git a/configure b/configure index 5f57f4c57..11b69b818 100755 --- a/configure +++ b/configure @@ -14571,7 +14571,7 @@ LIBS=$ac_save_LIBS for ac_func in strchr strrchr memchr memcpy memset sysconf tzset \ strftime setrlimit initgroups fstat gettimeofday \ - regcomp setlocale getaddrinfo setsid setenv vhangup \ + regcomp setlocale getaddrinfo setenv vhangup \ mbr_check_membership setrlimit64 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` diff --git a/configure.in b/configure.in index 4e0a145dd..e02e474b9 100644 --- a/configure.in +++ b/configure.in @@ -1914,7 +1914,7 @@ dnl AC_FUNC_GETGROUPS AC_CHECK_FUNCS(strchr strrchr memchr memcpy memset sysconf tzset \ strftime setrlimit initgroups fstat gettimeofday \ - regcomp setlocale getaddrinfo setsid setenv vhangup \ + regcomp setlocale getaddrinfo setenv vhangup \ mbr_check_membership setrlimit64) AC_CHECK_FUNCS(getline, [], [ AC_LIBOBJ(getline) diff --git a/plugins/sudoers/logging.c b/plugins/sudoers/logging.c index 31e8287a7..16fe270a0 100644 --- a/plugins/sudoers/logging.c +++ b/plugins/sudoers/logging.c @@ -451,18 +451,8 @@ send_mail(const char *fmt, ...) } /* Daemonize - disassociate from session/tty. */ -#ifdef HAVE_SETSID if (setsid() == -1) warning("setsid"); -#else - setpgrp(0, 0); -# ifdef TIOCNOTTY - if ((fd = open(_PATH_TTY, O_RDWR, 0644)) != -1) { - ioctl(fd, TIOCNOTTY, NULL); - close(fd); - } -# endif -#endif (void) chdir("/"); if ((fd = open(_PATH_DEVNULL, O_RDWR, 0644)) != -1) { (void) dup2(fd, STDIN_FILENO); diff --git a/src/exec_pty.c b/src/exec_pty.c index d42109cc2..71d0a00b4 100644 --- a/src/exec_pty.c +++ b/src/exec_pty.c @@ -835,23 +835,10 @@ exec_monitor(struct command_details *details, char *argv[], char *envp[], * and the slave pty as the controlling terminal. * This allows us to be notified when the child has been suspended. */ -#ifdef HAVE_SETSID if (setsid() == -1) { warning("setsid"); goto bad; } -#else -# ifdef TIOCNOTTY - n = open(_PATH_TTY, O_RDWR|O_NOCTTY); - if (n >= 0) { - /* Disconnect from old controlling tty. */ - if (ioctl(n, TIOCNOTTY, NULL) == -1) - warning("cannot disconnect controlling tty"); - close(n); - } -# endif - setpgrp(0, 0); -#endif if (io_fds[SFD_SLAVE] != -1) { #ifdef TIOCSCTTY if (ioctl(io_fds[SFD_SLAVE], TIOCSCTTY, NULL) != 0)