Commit Graph

87 Commits

Author SHA1 Message Date
Todd C. Miller
5d7889c0d7 Save the controlling tty process group before suspending in pty
mode.  Previously, we assumed that the child pgrp == child pid
(which is usually, but not always, the case).
2011-03-18 10:04:50 -04:00
Todd C. Miller
2041d39db7 Add support for ut_exit 2011-03-15 16:18:33 -04:00
Todd C. Miller
3506f01077 Add support for controlling whether utmp is updated and which user is
listed in the entry.
2011-03-15 15:53:49 -04:00
Todd C. Miller
8653ccc809 Redo utmp handling. If no getutent()/getutxent() is available,
assume a ttyslot-based utmp.  If getttyent() is available, use
that directly instead of ttyslot() so we don't have to do the
stdin dup2 dance.
2011-03-14 10:20:47 -04:00
Todd C. Miller
1e9def1efa Move utmp handling into utmp.c 2011-03-11 15:54:12 -05:00
Todd C. Miller
53da5e8cdf Update copyright years. 2011-03-11 15:34:35 -05:00
Todd C. Miller
c7a7d31905 Add support for disabling exec via solaris privileges.
Includes preparation for moving noexec support out of sudoers
and into front end as documented.
2011-03-10 14:24:10 -05:00
Todd C. Miller
1496bfed6c Add support for adding a utmp entry when allocating a new pty.
Requires the BSD login(3) or SYSV/POSIX getutent()/getutxent().
Currently only creates a new entry if the existing tty has
a utmp entry.
2011-03-08 15:37:40 -05:00
Todd C. Miller
39d9feb438 The howmany macro lives in sys/sysmacros.h on SVR5 systems
Closes Bug 470
2011-02-19 08:23:46 -05:00
Todd C. Miller
5fc2f8f454 Pass SIGUSR1/SIGUSR2 through to the child. 2011-02-03 10:25:42 -05:00
Todd C. Miller
2959d5dadd Use special values SIGCONT_FG and SIGCONT_BG instead of SIGUSR1 and
SIGUSR2 to indicate whether the child should be continued in the
foreground or background.
2011-02-03 09:59:41 -05:00
Todd C. Miller
82c85571c9 Remove obsolete comment 2011-02-02 14:24:48 -05:00
Todd C. Miller
8a64a8c798 If we get a signal other than SIGCHLD in the monitor, pass it directly
to the child.
2011-02-02 13:27:24 -05:00
Todd C. Miller
c18468d1a5 Save signal state before changing handlers and restore before
we execute the command.
2011-02-02 12:44:35 -05:00
Todd C. Miller
ae2f7638f5 standardize on "return foo;" rather than "return(foo);" or "return (foo);" 2011-01-24 15:15:18 -05:00
Todd C. Miller
e2f253e51d Fix TCGETWINSZ compat. 2010-10-07 14:11:10 -04:00
Todd C. Miller
1a4990f571 Prefer newer TIOCGWINSZ ioctl to old TIOCGSIZE 2010-10-02 17:11:07 -04:00
Todd C. Miller
59399d55c3 Instead of using a array to store received signals, open a pipe and
have the signal handler write the signal number to one end and
select() on the other end.  This makes it possible to handle signals
similar to I/O without race conditions.
2010-09-10 11:20:32 -04:00
Todd C. Miller
420db23714 Quiet gcc warnings on glibc systems that use warn_unused_result for
write(2) and others.
2010-08-03 11:17:56 -04:00
Todd C. Miller
23c96fbc2e Handle ENXIO from read/write which can occur when reading/writing
a pty that has gone away.
2010-07-26 13:04:11 -04:00
Todd C. Miller
c9e86ab3b9 The return value of strsignal() may be const and should be treated
as const regardless.
2010-07-21 15:57:37 -04:00
Todd C. Miller
30fe4a067c Set usrinfo for AIX
Set adminstrative domain for the process when looking up user's
    password or group info and when preparing for execve().
Include strings.h even if string.h exists since they may define
    different things.  Fixes warnings on AIX and others.
2010-06-29 13:08:05 -04:00
Todd C. Miller
d018936b4e Move functions and symbols shared between exec.c and exec_pty.c
into sudo_exec.h.
2010-06-16 16:46:56 -04:00
Todd C. Miller
f64bb67c6c Clean up some XXXs 2010-06-15 15:01:11 -04:00
Todd C. Miller
54ffb19ccb remove setsid check, we require a POSIX system 2010-06-15 09:24:56 -04:00
Todd C. Miller
c2f8d24f20 Check for dup2() failure. 2010-06-15 09:02:23 -04:00
Todd C. Miller
d27223b4c7 Call selinux_restore_tty() as part of cleanup() so it gets called
from error()/errorx()
2010-06-14 15:09:15 -04:00
Todd C. Miller
047fc3876d Remove sigaction emulation
Use SA_INTERRUPT in sa_flags
2010-06-10 15:18:23 -04:00
Todd C. Miller
34613c8465 Use a flag bit in struct command_details for selinux instead of a separate
field.
2010-06-09 16:25:44 -04:00
Todd C. Miller
4c1ef12648 Implement background mode. If I/O logging we use pipes instead of a pty. 2010-06-09 16:19:45 -04:00
Todd C. Miller
c5a6ca998a Move compat definition of NSIG to compat.h 2010-06-09 13:57:07 -04:00
Todd C. Miller
e5283b2f96 Require POSIX termios to build sudo 2010-06-09 11:09:55 -04:00
Todd C. Miller
51f70f2040 Use POSIX tcgetpgrp() instead of BSD TIOCGPGRP ioctl 2010-06-09 09:54:58 -04:00
Todd C. Miller
edd34a2d7e Add selinux_enabled flag into struct command_details and
set it in command_info_to_details().
Return an error from selinux_setup() instead of exiting.
Call selinux_setup() from exec_setup().
2010-06-08 17:59:18 -04:00
Todd C. Miller
ecfb70b056 Remove commented out copy of old sudo_execve() function. 2010-06-09 09:22:44 -04:00
Todd C. Miller
0be6bab05c Remove duplicate call to selinux_setup(). 2010-06-08 16:16:08 -04:00
Todd C. Miller
6717c59d77 Split exec.c into exec.c and exec_pty.c 2010-06-07 18:06:22 -04:00