Todd C. Miller [Tue, 28 Aug 2012 14:11:38 +0000 (10:11 -0400)]
Detect sys_sigabbrev[] and use it in place of sys_signame[] if
present. For some reason glibc does not declare sys_sigabbrev so
we must add an extern definition of our own.
Todd C. Miller [Mon, 27 Aug 2012 15:22:33 +0000 (11:22 -0400)]
Pass on SIGTSTP to the command if it was sent by a user process
(not the kernel or the terminal) when we are not I/O logging and
set the default SIGTSTP handler when we re-send the signal to
ourself, restoring our handler after we resume.
Todd C. Miller [Mon, 27 Aug 2012 14:29:59 +0000 (10:29 -0400)]
Shells typically change their process group when they start up so
that they can implement job control. Most well-behaved shells
change the pgrp back to its original value before suspending so we
must not try to restore in that case, lest we race with the child
upon resume, potentially stopping sudo with SIGTTOU while the command
continues to run. Some shells, such as pdksh, just suspend the
shell by sending SIGSTOP to themselves without restoring the pgrp.
In this case we need to change the pgrp back for them.
Should fix bug #568
Todd C. Miller [Thu, 23 Aug 2012 18:47:58 +0000 (14:47 -0400)]
When running regress tests, list pass/fail rate for each dir
(testsudoers and visudo) instead of the total. Also prevent the
result files from clobbering each other by keeping them in the
relevant directories.
Todd C. Miller [Thu, 23 Aug 2012 18:02:02 +0000 (14:02 -0400)]
Don't print an error message in yyerror() if open_sudoers() fails,
we've already printed an error message. Also restore the check
for sudoers_warnings in yyerror().
Todd C. Miller [Tue, 14 Aug 2012 14:45:55 +0000 (10:45 -0400)]
Add new check_defaults() function to check (but not update) the
Defaults entries. Visudo can now use this instead of update_defaults
to check all the defaults regardless instead of just the global
Defaults entries.
Todd C. Miller [Thu, 9 Aug 2012 18:11:41 +0000 (14:11 -0400)]
If sudo.conf contains an I/O plugin but no policy plugin, use sudoers
for the policy plugin. If a policy plugin is specified without an
I/O plugin, only the policy plugin will be loaded.
Todd C. Miller [Thu, 9 Aug 2012 15:36:25 +0000 (11:36 -0400)]
Add a note about wildcards matching multiple words and include an
example. Also mention that for sudoedit, a wildcard in command
line args does not match a slash.
Todd C. Miller [Mon, 6 Aug 2012 18:38:35 +0000 (14:38 -0400)]
If we receive a signal from the command we executed, do not forward
it back to the command. This fixes a problem with BSD-derived
versions of the reboot command which send SIGTERM to all other
processes, including the sudo process. Sudo would then deliver
SIGTERM to reboot which would die before calling the reboot() system
call, effectively leaving the system in single user mode.
Todd C. Miller [Thu, 2 Aug 2012 18:37:32 +0000 (14:37 -0400)]
If a command matches using an empty Runas_List (i.e. Runas_List is
present but empty) and the -u option was not specified, set runas_pw
to user_pw instead of using runas_default. This is intended to be
used in conjunction with the Solaris Privilege Set support for rules
that grant privileges without changing the user.
Todd C. Miller [Thu, 2 Aug 2012 18:02:54 +0000 (14:02 -0400)]
Add support for parsing an empty Runas_List, which only allows the
command to be run as the invoking user. This can be used in
conjunction with the Solaris Privilege Set support to grant privileges
without changing the user.
Todd C. Miller [Wed, 1 Aug 2012 18:38:52 +0000 (14:38 -0400)]
Generate a sed script file when munging *.mdoc or *.man instead of
passing sed expressions on the command line. Older seds do not
support \n in a replacement so generate and run a sed script instead.
Todd C. Miller [Tue, 31 Jul 2012 17:36:48 +0000 (13:36 -0400)]
When checking whether a signal is user-generated, compare si_code
against SI_USER instead of <= 0 since on HP-UX, terminal-related
signals get a code of 0.
Todd C. Miller [Tue, 31 Jul 2012 15:11:25 +0000 (11:11 -0400)]
SuSE Enterprise Linux uses RLIMIT_NPROC and _SC_CHILD_MAX interchangably.
This causes problems when setting RLIMIT_NPROC to RLIM_INFINITY due
to a bug in bash where bash tries to honor the value of _SC_CHILD_MAX
but treats a value of -1 as an error, and uses a default value of
32 instead.
Previously, we just checked RLIMIT_NPROC and, if it was unlimited,
restored the previous value of RLIMIT_NPROC. However, that makes
it impossible to set nproc to unlimited. We now only restore the
nproc resource limit if sysconf(_SC_CHILD_MAX) is negative. In
most cases, pam_limits will set RLIMIT_NPROC for us.
Todd C. Miller [Mon, 30 Jul 2012 15:09:11 +0000 (11:09 -0400)]
Active Directory apparently requires that tenths of a second be
present in a date so append .0 to the "now" value in the time filter.
Also remove space for the global AND from TIMEFILTER_LENGTH since
it was not being used consistently. Buffers of TIMEFILTER_LENGTH
now need to account for the terminating NUL byte.
Todd C. Miller [Fri, 27 Jul 2012 20:22:09 +0000 (16:22 -0400)]
Fix printing of the permission denied message to standard error
when a user is not allowed to run a command. This got broken by
the recent logging changes.