Commit Graph

191 Commits

Author SHA1 Message Date
Todd C. Miller
7960bde2db Minor warning/error message cleanup 2011-05-18 13:04:24 -04:00
Todd C. Miller
fce0b906eb cannot -> "unable to" in warning/error messages 2011-05-18 12:41:06 -04:00
Todd C. Miller
917c8d48ad We don't want to translate debugging messages. 2011-05-17 18:37:18 -04:00
Todd C. Miller
c865a462cc Prepare sudo front end messages for translation. 2011-05-06 17:47:51 -04:00
Todd C. Miller
240642399b Save the controlling tty process group before suspending so we can
restore it when we resume.  Fixes job control problems on Linux
caused by the previous attemp to fix resuming a shell when I/O
logging not enabled.
2011-03-16 12:02:04 -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
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
caefd1abdc In handle_signals(), restart the read() on EINTR to make sure we keep up
with the signal pipe.  Don't return -1 on EAGAIN, it just means we have
emptied the pipe.
2011-03-09 11:28:51 -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
a099aa7f2a SVR5 systems return non-zero for success on socketpair(),
check for -1 instead.  Closes Bug 469
2011-02-19 08:13:17 -05:00
Todd C. Miller
056cb8a5da Remove duplicate FD_SET of signal_pipe[0] 2011-02-06 16:55:21 -05:00
Todd C. Miller
5fc2f8f454 Pass SIGUSR1/SIGUSR2 through to the child. 2011-02-03 10:25:42 -05:00
Todd C. Miller
34a087acf6 Use pid_t not int and check the return value of kill() 2011-02-03 09:20:34 -05:00
Todd C. Miller
29f9e23c84 In non-pty mode before continuing the child, make it the foreground
pgrp if possible.  Fixes resuming a shell.
2011-02-02 14:19:23 -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
c833ff02b6 Add use_pty command_info flag for policies to indicate that a
pty should be allocated even if no I/O logging is performed.
2010-12-20 16:27:46 -05:00
Todd C. Miller
a11e4c8d72 If perform_io() fails, kill the child before exiting so it doesn't
complain about connection reset.  We can get an I/O error if, for
example, and we get EIO reading from stdin.
2010-10-15 16:24:42 -04:00
Todd C. Miller
413b7b55d1 Add missing signal_pipe[0] to fdsr for the non-pty case. 2010-10-01 12:03:47 -04:00
Todd C. Miller
c04f48b4bf Quiet gcc warnings on glibc systems that use warn_unused_result for
write(2).
2010-09-11 09:26:09 -04:00
Todd C. Miller
66bea8c4c9 Read as many signals on the signal pipe as we can before returning. 2010-09-10 11:27:20 -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
2cef2bb5b0 When not logging I/O install a handler for SIGCONT and deliver it
to the command upon resume.  Fixes bugzilla #431
2010-08-24 08:42:47 -04:00
Todd C. Miller
e11e4efb8f Do I/O logging in the C locale so the floating point numbers in the
timing file are not locale-dependent.
2010-07-27 09:45:20 -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
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
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
6717c59d77 Split exec.c into exec.c and exec_pty.c 2010-06-07 18:06:22 -04:00
Todd C. Miller
3fbd834783 Add missing const to I/O log action function 2010-06-04 09:10:05 -04:00
Todd C. Miller
cd26d2891d Unbreak the non-io logging case. 2010-06-02 14:23:38 -04:00
Todd C. Miller
1eafb30a44 Fix a bug where we could treat EAGAIN as a permanent error.
Also set cstat if perform_io() returns an error.
2010-06-01 10:58:11 -04:00
Todd C. Miller
d2d68aa24d Re-enable cleanup functions in sudoers plugin and sudo driver
for error()/errorx().
2010-05-28 12:15:14 -04:00
Todd C. Miller
9773ba3f79 Rename script_execve to sudo_execve and rename script_foo in exec.c 2010-05-27 16:46:31 -04:00
Todd C. Miller
4248a11ef7 rename script.c exec.c and fix up the MANIFEST file 2010-05-27 16:32:41 -04:00