Todd C. Miller [Sat, 24 Apr 2010 23:05:11 +0000 (19:05 -0400)]
Don't stash ctime in on-disk tty ticket info for now; on many (most?)
systems the ctime is updated when the tty is written to. Once I
have a better idea of what systems do not update ctime on ttys (and
have a way to test for this) the ctime stash will be conditionally
re-enabled.
Todd C. Miller [Thu, 22 Apr 2010 14:16:18 +0000 (10:16 -0400)]
Store info from stat(2)ing the tty in the tty ticket when tty tickets
are in use. On most systems, this closes the loophole whereby a user
can log out of a tty, log back in and still have the timestamp be valid.
Todd C. Miller [Tue, 20 Apr 2010 21:00:31 +0000 (17:00 -0400)]
Convert perm setting to push/pop model; still needs some work
Use the stashed runas groups instead of using getgrouplist()
Reset perms to the initial value on error
Todd C. Miller [Wed, 14 Apr 2010 10:38:32 +0000 (06:38 -0400)]
Add workaround for the lack of the environ pointer on Mac OS X
in dlopen()ed modules. Use of environ in the sudoers plugin should
ultimately be removed but this will do for the moment.
Todd C. Miller [Wed, 14 Apr 2010 10:24:42 +0000 (06:24 -0400)]
Set errorfile to the sudoers path if we set parse_error manually.
This prevents a NULL dereference in printf() when checking a sudoers
file in strict mode when alias errors are present.
Todd C. Miller [Tue, 13 Apr 2010 10:31:55 +0000 (06:31 -0400)]
If execve fails in logging mode, pass the errno directly to the grandparent
on the backchannel and exit. The immediate parent will get SIGCHLD and
try to report that status but its parent will no longer be listening.
It would probably be cleaner to pass this over a pipe in script_child().
Todd C. Miller [Sat, 10 Apr 2010 14:31:47 +0000 (10:31 -0400)]
Only need to take action on SIGCHLD in parent if no I/O logger.
If there is an I/O logger we will receive ECONNRESET or EPIPE when
we try to read from the socketpair.
Todd C. Miller [Fri, 9 Apr 2010 10:10:07 +0000 (06:10 -0400)]
Qualify the command even if it is in the current working directory,
e.g. "./foo" instead of just returning "foo". This removes an ambiguity
between real commands and possible pseudo-commands in command matching.
Todd C. Miller [Thu, 8 Apr 2010 11:40:04 +0000 (07:40 -0400)]
Better signal handling.
Instead of using a single variable to store the received signal, use
an array so we can't lose a signal when multiple are sent.
Fix process termination by SIGALRM in non-I/O logger mode.
Fix relaying terminal signals to the child in non-I/O logger mode.
Todd C. Miller [Thu, 8 Apr 2010 10:12:47 +0000 (06:12 -0400)]
Fix a race between when we get the child pid in the parent and when
the child process exits. The problem exhibited as a hang after a
short-lived process, e.g. "sudo id" when no IO logger was enabled.
Todd C. Miller [Sun, 4 Apr 2010 12:40:23 +0000 (08:40 -0400)]
Free str after using it in the version method. Use sudo_conv, not
io_conv since we don't have the IO conversation function pointer
in the I/O version method anymore now that io_open is delayed.
Todd C. Miller [Wed, 31 Mar 2010 16:43:26 +0000 (12:43 -0400)]
Unlike most operating systems, HP-UX select() is not interrupted
by SIGCHLD when the signal is registered with SA_RESTART. If
we clear SA_RESTART when calling sigaction() for SIGCHLD we get
the expected behavior and the code in the select() loops already
handles EINTR correctly.
Todd C. Miller [Sun, 28 Mar 2010 00:19:40 +0000 (20:19 -0400)]
Add back io logging (transcript) support. Currently, the open function
runs too early and it is not possible to use the io module independently
of the policy module.
Todd C. Miller [Sun, 21 Mar 2010 12:54:06 +0000 (08:54 -0400)]
Fix the -s and -i flags and add support for the "implied_shell"
option. If the user does not specify a command, sudo will now pass
in the path to the user's shell and set impied_shell=true. The
plugin can them either check the command normally or return -2 to
cause sudo to print a usage message and exit.