]> granicus.if.org Git - sudo/log
sudo
6 years agomerge sudo 1.8.21 from tip SUDO_1_8_21
Todd C. Miller [Wed, 23 Aug 2017 18:11:39 +0000 (12:11 -0600)]
merge sudo 1.8.21 from tip

--HG--
branch : 1.8

6 years agoFix path to LICENSE and NEWS files that get used in the installer.
Todd C. Miller [Wed, 23 Aug 2017 17:54:13 +0000 (11:54 -0600)]
Fix path to LICENSE and NEWS files that get used in the installer.
Previously, the installed versions were used instead of the ones
in the destdir.

6 years agosync with translationproject.org
Todd C. Miller [Mon, 21 Aug 2017 01:07:07 +0000 (19:07 -0600)]
sync with translationproject.org

6 years agosync with translationproject.org
Todd C. Miller [Fri, 18 Aug 2017 16:00:27 +0000 (10:00 -0600)]
sync with translationproject.org

6 years agosync with translationproject.org
Todd C. Miller [Sat, 12 Aug 2017 21:29:35 +0000 (15:29 -0600)]
sync with translationproject.org

6 years agoPreserving environment variables on the command line was bug #279
Todd C. Miller [Fri, 11 Aug 2017 15:50:07 +0000 (09:50 -0600)]
Preserving environment variables on the command line was bug #279

6 years agoAdd Friulian translation for sudo from Fabio Tomat via translationproject.org
Todd C. Miller [Thu, 10 Aug 2017 16:14:57 +0000 (10:14 -0600)]
Add Friulian translation for sudo from Fabio Tomat via translationproject.org

6 years agosync with translationproject.org
Todd C. Miller [Tue, 8 Aug 2017 12:50:24 +0000 (06:50 -0600)]
sync with translationproject.org

6 years agoIn the Runas example that uses "boulder" make it clear that "boulder"
Todd C. Miller [Fri, 4 Aug 2017 20:55:03 +0000 (14:55 -0600)]
In the Runas example that uses "boulder" make it clear that "boulder"
is a host name.

6 years agoregen
Todd C. Miller [Thu, 3 Aug 2017 16:06:16 +0000 (10:06 -0600)]
regen

6 years agoAllow the user to specify a list of environment variables to preserve.
Todd C. Miller [Thu, 3 Aug 2017 13:32:24 +0000 (07:32 -0600)]
Allow the user to specify a list of environment variables to preserve.
This adds an option paramter to the --preserve-env option, a
comma-separated list of variable names.

6 years agoReplace tty_tickets option with timestamp_type which can be
Todd C. Miller [Tue, 1 Aug 2017 22:14:54 +0000 (16:14 -0600)]
Replace tty_tickets option with timestamp_type which can be
global, ppid or tty.  Defaults to tty (no change in behavior).
Some users want the ppid behavior.

6 years agoregen
Todd C. Miller [Tue, 1 Aug 2017 21:45:20 +0000 (15:45 -0600)]
regen

6 years agoDon't send email about an unresolvable host name if fqdn is
Todd C. Miller [Tue, 1 Aug 2017 19:45:32 +0000 (13:45 -0600)]
Don't send email about an unresolvable host name if fqdn is
enabled and the user specified the run host via the -h flag.

6 years agofix playback of stdout/stderr without embedded carriage returns
Todd C. Miller [Mon, 31 Jul 2017 16:44:39 +0000 (10:44 -0600)]
fix playback of stdout/stderr without embedded carriage returns

6 years agoAvoid unused variable warning when sasl is not used.
Todd C. Miller [Fri, 28 Jul 2017 20:05:54 +0000 (14:05 -0600)]
Avoid unused variable warning when sasl is not used.

6 years agoAdd support for --enable-sasl and --disable-sasl to make it possible
Todd C. Miller [Fri, 28 Jul 2017 19:52:55 +0000 (13:52 -0600)]
Add support for --enable-sasl and --disable-sasl to make it possible
to enable/disable support for LDAP with SASL authentication.  Sudo
compiles in support for SASL authentiation by default if the
ldap_sasl_interactive_bind_s() function is detected.
Bug #788

6 years agoList the correct pattern ("*=()*") in the env_delete description.
Todd C. Miller [Fri, 28 Jul 2017 15:50:12 +0000 (09:50 -0600)]
List the correct pattern ("*=()*") in the env_delete description.
Use pseudo-tty instead of pseudo terminal for consistency.

6 years agoInclude pathnames.h for /dev/fd on FreeBSD and Mac OS X.
Todd C. Miller [Fri, 28 Jul 2017 02:51:21 +0000 (20:51 -0600)]
Include pathnames.h for /dev/fd on FreeBSD and Mac OS X.

6 years agoupdate for 1.8.21
Todd C. Miller [Thu, 27 Jul 2017 23:08:09 +0000 (17:08 -0600)]
update for 1.8.21

6 years agoNo need to call sudo_ev_del() before sudo_ev_free(); sudo_ev_free()
Todd C. Miller [Thu, 27 Jul 2017 20:12:57 +0000 (14:12 -0600)]
No need to call sudo_ev_del() before sudo_ev_free(); sudo_ev_free()
will delete the event from its base before freeing it.

6 years agoTerminate the command if an I/O log function returns 0 or -1. This
Todd C. Miller [Thu, 27 Jul 2017 20:10:44 +0000 (14:10 -0600)]
Terminate the command if an I/O log function returns 0 or -1.  This
was mistakenly removed by 25b7fd056614 in Sudo 1.8.18 with the
removal of the ignore_iolog_errors variable.

6 years agoQuiet a coverity false positive.
Todd C. Miller [Thu, 27 Jul 2017 17:36:10 +0000 (11:36 -0600)]
Quiet a coverity false positive.

6 years agoChange to a single event loop in sudoreplay and use signal events.
Todd C. Miller [Thu, 27 Jul 2017 15:45:35 +0000 (09:45 -0600)]
Change to a single event loop in sudoreplay and use signal events.

6 years agostart new sentences on a new line
Todd C. Miller [Fri, 21 Jul 2017 17:20:04 +0000 (11:20 -0600)]
start new sentences on a new line

6 years agoClarify how the variable prompt options interact with each other
Todd C. Miller [Fri, 21 Jul 2017 17:18:13 +0000 (11:18 -0600)]
Clarify how the variable prompt options interact with each other
and PAM.

6 years agoDon't set passprompt_override when SUDO_PROMPT is present.
Todd C. Miller [Fri, 21 Jul 2017 15:07:00 +0000 (09:07 -0600)]
Don't set passprompt_override when SUDO_PROMPT is present.
This effectively reverts ed77d255f383.

We treat the SUDO_PROMPT environment variable similar to passprompt
in sudoers: it will only override a PAM prompt if the PAM prompt
is either "Password:" or "username's Password:".

6 years agoAdd syslog_pid sudoers option to log sudo's process ID when logging
Todd C. Miller [Thu, 20 Jul 2017 22:33:12 +0000 (16:33 -0600)]
Add syslog_pid sudoers option to log sudo's process ID when logging
via syslog.  This is disabled by default to match historic behavior.

6 years agoWhen deciding which prompt to use (PAM's or sudo's) treat the PAM
Todd C. Miller [Thu, 20 Jul 2017 22:06:47 +0000 (16:06 -0600)]
When deciding which prompt to use (PAM's or sudo's) treat the PAM
prompt "username's Password:" as equivalent to "Password:".
Some PAM modules (on AIX at least) use this prompt.

6 years agoAdd missing argument to a few of the defaults strings in the
Todd C. Miller [Thu, 20 Jul 2017 19:58:54 +0000 (13:58 -0600)]
Add missing argument to a few of the defaults strings in the
"sudo -V" output.

6 years agoWhen examining environment variables or variables passed in from
Todd C. Miller [Thu, 20 Jul 2017 18:02:22 +0000 (12:02 -0600)]
When examining environment variables or variables passed in from
the front-end, ignore variables with no value specified.

6 years agoDocument that "-p prompt" overrides SUDO_PROMPT.
Todd C. Miller [Thu, 20 Jul 2017 17:44:50 +0000 (11:44 -0600)]
Document that "-p prompt" overrides SUDO_PROMPT.

6 years agoEnable passprompt_override by default if SUDO_PROMPT is present in
Todd C. Miller [Thu, 20 Jul 2017 17:40:49 +0000 (11:40 -0600)]
Enable passprompt_override by default if SUDO_PROMPT is present in
the environment.  This is consistent with how "sudo -p prompt" is
handled.

6 years agoWhen reading a single character via a switch() use "default: instead
Todd C. Miller [Mon, 17 Jul 2017 20:44:18 +0000 (14:44 -0600)]
When reading a single character via a switch() use "default: instead
of "case 1:" to quiet a coverity warning.

6 years agoInitialize ch in getsize_cb() in case we are called with the wrong
Todd C. Miller [Mon, 17 Jul 2017 20:13:08 +0000 (14:13 -0600)]
Initialize ch in getsize_cb() in case we are called with the wrong
initial state.

6 years agoremove unused variable
Todd C. Miller [Mon, 17 Jul 2017 20:09:48 +0000 (14:09 -0600)]
remove unused variable

6 years agoCall install_sudoers() even when doedit is false. If a file in a
Todd C. Miller [Mon, 17 Jul 2017 15:42:42 +0000 (09:42 -0600)]
Call install_sudoers() even when doedit is false.  If a file in a
#includedir has a syntax error it will still have been edited and
we need to install the edited temp file.

6 years agoReparse sudoers if a new #include file was added.
Todd C. Miller [Mon, 17 Jul 2017 15:26:00 +0000 (09:26 -0600)]
Reparse sudoers if a new #include file was added.
Otherwise the new file will not get its syntax checked.
Bug #791

6 years agodon't restore the cursor when setting terminal size, we don't want the cursor to...
Todd C. Miller [Fri, 14 Jul 2017 20:30:43 +0000 (14:30 -0600)]
don't restore the cursor when setting terminal size, we don't want the cursor to move

6 years agoRead the xterm terminal size using an event so we can easily time
Todd C. Miller [Fri, 14 Jul 2017 16:10:00 +0000 (10:10 -0600)]
Read the xterm terminal size using an event so we can easily time
out if needed.

6 years agoIf we free the default base in sudo_ev_base_free(), reset the default
Todd C. Miller [Fri, 14 Jul 2017 16:09:58 +0000 (10:09 -0600)]
If we free the default base in sudo_ev_base_free(), reset the default
base to NULL.

6 years agoAdd the ability to set a default event base, to be used by plugins
Todd C. Miller [Thu, 13 Jul 2017 19:59:31 +0000 (13:59 -0600)]
Add the ability to set a default event base, to be used by plugins
which don't have access to the event base.

6 years agoAllow sudoreplay to adjust the window size on xterm-like terminals.
Todd C. Miller [Thu, 13 Jul 2017 17:20:45 +0000 (11:20 -0600)]
Allow sudoreplay to adjust the window size on xterm-like terminals.

6 years agoLog window size change events in the sudoers I/O plugin.
Todd C. Miller [Wed, 12 Jul 2017 11:47:28 +0000 (05:47 -0600)]
Log window size change events in the sudoers I/O plugin.
Let sudoreplay parse a timing file with window change events
(currently ignored).

6 years agoPass window size change events to the plugin.
Todd C. Miller [Wed, 12 Jul 2017 11:47:28 +0000 (05:47 -0600)]
Pass window size change events to the plugin.

6 years agoClear input, output, control and local flags before copying them
Todd C. Miller [Wed, 12 Jul 2017 11:47:28 +0000 (05:47 -0600)]
Clear input, output, control and local flags before copying them
from the source terminal.  Otherwise, flags that are disabled
in the source terminal may still be enabled in the destination.

6 years agoRemove pointless subshells in targets that simply change the directory
Todd C. Miller [Wed, 12 Jul 2017 11:45:46 +0000 (05:45 -0600)]
Remove pointless subshells in targets that simply change the directory
and execute a command.  The command is already run in a shell so
there is no need to execute a subshell in this case.

6 years agoStore the debug instance ID for I/O plugins too.
Todd C. Miller [Mon, 10 Jul 2017 22:28:10 +0000 (16:28 -0600)]
Store the debug instance ID for I/O plugins too.
Now iolog_open() is consistent with policy_open().

6 years agoMove the bits to fill in the new event base to sudo_ev_base_init(),
Todd C. Miller [Thu, 1 Jun 2017 15:45:23 +0000 (09:45 -0600)]
Move the bits to fill in the new event base to sudo_ev_base_init(),
which is not currently exported.

6 years agoUse getentropy() in mkstemp/mkdtemp replacement.
Todd C. Miller [Fri, 30 Jun 2017 00:11:30 +0000 (18:11 -0600)]
Use getentropy() in mkstemp/mkdtemp replacement.

6 years agoUse _PATH_DEV consistently
Todd C. Miller [Fri, 30 Jun 2017 00:10:53 +0000 (18:10 -0600)]
Use _PATH_DEV consistently

6 years agoWhen copying terminal settings from one tty to another only copy a
Todd C. Miller [Thu, 15 Jun 2017 18:59:46 +0000 (12:59 -0600)]
When copying terminal settings from one tty to another only copy a
subset of the flags.  Sudo now copies the same set of flags that
OpenSSH uses, which should be safe.

6 years agoAdd debug warning when we have wait status but don't overwrite the
Todd C. Miller [Thu, 15 Jun 2017 13:51:02 +0000 (07:51 -0600)]
Add debug warning when we have wait status but don't overwrite the
existing cstat.

6 years agoBetter handling of SIGCONT from in command in the monitor. It is
Todd C. Miller [Thu, 15 Jun 2017 13:51:00 +0000 (07:51 -0600)]
Better handling of SIGCONT from in command in the monitor.  It is
useful to know when the command continued but we don't want to
inform the parent or store the wait status in this case.  Fixes a
hang after multiple suspends on Linux.

6 years agoavoid padding in struct cmndspec
Todd C. Miller [Fri, 9 Jun 2017 14:58:44 +0000 (08:58 -0600)]
avoid padding in struct cmndspec

6 years agoFix the man section of sudo_plugin in cross-references.
Todd C. Miller [Wed, 7 Jun 2017 22:25:46 +0000 (16:25 -0600)]
Fix the man section of sudo_plugin in cross-references.

6 years agoDon't treat an unchanged file as an error. From Xin Li.
Todd C. Miller [Mon, 5 Jun 2017 13:47:43 +0000 (07:47 -0600)]
Don't treat an unchanged file as an error.  From Xin Li.

6 years agosudo_edit() must return a wait status but if there is an error, or
Todd C. Miller [Mon, 5 Jun 2017 13:11:09 +0000 (07:11 -0600)]
sudo_edit() must return a wait status but if there is an error, or
even if no changes were made to the file, it was returning 1 instead
which would be interpreted as the command having received SIGHUP.
Use the W_EXITCODE() to construct a proper wait status in the error
case too.

6 years agoAvoid sign extension when assigning the value of tty_nr in
Todd C. Miller [Sat, 3 Jun 2017 14:45:29 +0000 (08:45 -0600)]
Avoid sign extension when assigning the value of tty_nr in
/proc/self/stat on Linux.  It is an unsigned int value that
is printed as a signed int but dev_t is unsigned long long.
We need to cast to unsigned int before assigning to a dev_t.

6 years agoInstead of hard-coding a check for bash functions in env_should_delete(),
Todd C. Miller [Sat, 3 Jun 2017 14:43:32 +0000 (08:43 -0600)]
Instead of hard-coding a check for bash functions in env_should_delete(),
use a "*=()* " pattern in initial_badenv_table[] to match them instead.
This allows the user to remove the check via env_delete.

6 years agoMac OS X -> macOS
Todd C. Miller [Fri, 2 Jun 2017 22:10:37 +0000 (16:10 -0600)]
Mac OS X -> macOS

6 years agodevsearch is ignored on BSD, macOS and Solaris
Todd C. Miller [Fri, 2 Jun 2017 21:47:35 +0000 (15:47 -0600)]
devsearch is ignored on BSD, macOS and Solaris

6 years agoAdded tag SUDO_1_8_20p2 for changeset 47836f4c9834
Todd C. Miller [Wed, 31 May 2017 15:15:38 +0000 (09:15 -0600)]
Added tag SUDO_1_8_20p2 for changeset 47836f4c9834

--HG--
branch : 1.8

6 years agoSudo 1.8.20p2
Todd C. Miller [Wed, 31 May 2017 15:14:31 +0000 (09:14 -0600)]
Sudo 1.8.20p2

6 years agoSudo 1.8.20p2 SUDO_1_8_20p2
Todd C. Miller [Wed, 31 May 2017 15:14:31 +0000 (09:14 -0600)]
Sudo 1.8.20p2

--HG--
branch : 1.8

6 years agoA command name may also contain newline characters so read
Todd C. Miller [Wed, 31 May 2017 15:14:31 +0000 (09:14 -0600)]
A command name may also contain newline characters so read
/proc/self/stat until EOF.  It is not legal for /proc/self/stat to
contain embedded NUL bytes so treat the file as corrupt if we see
any.  With help from Qualys.

This is not exploitable due to the /dev traversal changes in sudo
1.8.20p1 (thanks Solar!).

6 years agoA command name may also contain newline characters so read
Todd C. Miller [Wed, 31 May 2017 15:14:31 +0000 (09:14 -0600)]
A command name may also contain newline characters so read
/proc/self/stat until EOF.  It is not legal for /proc/self/stat to
contain embedded NUL bytes so treat the file as corrupt if we see
any.  With help from Qualys.

This is not exploitable due to the /dev traversal changes in sudo
1.8.20p1 (thanks Solar!).

--HG--
branch : 1.8

7 years agoUse /proc/self consistently on Linux. As far as I know, only AIX
Todd C. Miller [Tue, 30 May 2017 16:44:11 +0000 (10:44 -0600)]
Use /proc/self consistently on Linux.  As far as I know, only AIX
doesn't support /proc/self.

7 years agoUse /proc/self consistently on Linux. As far as I know, only AIX
Todd C. Miller [Tue, 30 May 2017 16:44:11 +0000 (10:44 -0600)]
Use /proc/self consistently on Linux.  As far as I know, only AIX
doesn't support /proc/self.

--HG--
branch : 1.8

7 years agoAdd a new "devsearch" Path setting to sudo.conf for configuring the
Todd C. Miller [Tue, 30 May 2017 16:44:11 +0000 (10:44 -0600)]
Add a new "devsearch" Path setting to sudo.conf for configuring the
/dev paths to traverse instead of hard-coding a list in ttyname.c
The default value can be set at configure time.

7 years agoAfter opening a tty device, fstat() and error out if it is not
Todd C. Miller [Tue, 30 May 2017 16:44:11 +0000 (10:44 -0600)]
After opening a tty device, fstat() and error out if it is not
a character device.

7 years agoAdded tag SUDO_1_8_20p1 for changeset 94d010e2bb50
Todd C. Miller [Mon, 29 May 2017 20:36:35 +0000 (14:36 -0600)]
Added tag SUDO_1_8_20p1 for changeset 94d010e2bb50

--HG--
branch : 1.8

7 years agoSudo 1.8.20p1
Todd C. Miller [Mon, 29 May 2017 20:36:17 +0000 (14:36 -0600)]
Sudo 1.8.20p1

7 years agoSudo 1.8.20p1 SUDO_1_8_20p1
Todd C. Miller [Mon, 29 May 2017 20:36:17 +0000 (14:36 -0600)]
Sudo 1.8.20p1

--HG--
branch : 1.8

7 years agoFix for CVE-2017-1000367, parsing of /proc/pid/stat on Linux when
Todd C. Miller [Mon, 29 May 2017 20:32:53 +0000 (14:32 -0600)]
Fix for CVE-2017-1000367, parsing of /proc/pid/stat on Linux when
the process name contains spaces.  Since the user has control over
the command name this could be used by a user with sudo access to
overwrite an arbitrary file.
Thanks to Qualys for investigating and reporting this bug.

Also stop performing a breadth-first traversal of /dev when looking
for the device.  Only the directories specified in search_devs[]
are checked.

7 years agoFix for CVE-2017-1000367, parsing of /proc/pid/stat on Linux when
Todd C. Miller [Mon, 29 May 2017 20:32:53 +0000 (14:32 -0600)]
Fix for CVE-2017-1000367, parsing of /proc/pid/stat on Linux when
the process name contains spaces.  Since the user has control over
the command name this could be used by a user with sudo access to
overwrite an arbitrary file.
Thanks to Qualys for investigating and reporting this bug.

Also stop performing a breadth-first traversal of /dev when looking
for the device.  Only the directories specified in search_devs[]
are checked.

--HG--
branch : 1.8

7 years agoFix potential memory leak on reallocarray() error. Coverity CID 169639
Todd C. Miller [Tue, 23 May 2017 19:26:54 +0000 (13:26 -0600)]
Fix potential memory leak on reallocarray() error.  Coverity CID 169639

7 years agoOnly fall back to deprecated getaudit() on FreeBSD. Fixes compiler warnings on macOS.
Todd C. Miller [Tue, 23 May 2017 19:19:50 +0000 (13:19 -0600)]
Only fall back to deprecated getaudit() on FreeBSD.  Fixes compiler warnings on macOS.

7 years agoUse clang on macOS if present
Todd C. Miller [Tue, 23 May 2017 18:56:59 +0000 (12:56 -0600)]
Use clang on macOS if present

7 years agofix paths to LICENSE and NEWS files for macOS packages
Todd C. Miller [Tue, 23 May 2017 17:52:40 +0000 (11:52 -0600)]
fix paths to LICENSE and NEWS files for macOS packages

7 years agoTo avoid overwriting existing command status, check for CMD_INVALID
Todd C. Miller [Thu, 18 May 2017 19:53:15 +0000 (13:53 -0600)]
To avoid overwriting existing command status, check for CMD_INVALID
instead of CMD_ERRNO or CMD_WSTATUS.

7 years agoAdd some patterns that could result in exponential run time for
Todd C. Miller [Thu, 18 May 2017 19:10:52 +0000 (13:10 -0600)]
Add some patterns that could result in exponential run time for
poorly written '*' matching.

7 years agoOn HP-UX 11.0, sys/ioctl.h is not sufficient to make struct winsize
Todd C. Miller [Mon, 15 May 2017 15:37:58 +0000 (09:37 -0600)]
On HP-UX 11.0, sys/ioctl.h is not sufficient to make struct winsize
visisble, we need termios.h too.

7 years agoAlways used TIOCGWINSZ.
Todd C. Miller [Mon, 15 May 2017 15:21:00 +0000 (09:21 -0600)]
Always used TIOCGWINSZ.

7 years agoMove exec_setup(), unlimit_nproc() and restore_nproc() from sudo.c
Todd C. Miller [Mon, 15 May 2017 15:01:10 +0000 (09:01 -0600)]
Move exec_setup(), unlimit_nproc() and restore_nproc() from sudo.c
to exec.c.

7 years agoNo need to include selinux.h here.
Todd C. Miller [Mon, 15 May 2017 15:00:15 +0000 (09:00 -0600)]
No need to include selinux.h here.

7 years agoFix compilation error on macOS
Todd C. Miller [Mon, 15 May 2017 14:57:45 +0000 (08:57 -0600)]
Fix compilation error on macOS

7 years agoAvoid a clang analyzer false positive.
Todd C. Miller [Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)]
Avoid a clang analyzer false positive.

7 years agoAdd cov-build and cov-submit targets for checking with coverity.
Todd C. Miller [Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)]
Add cov-build and cov-submit targets for checking with coverity.

7 years agoUse debug logging instead of ignore_result() where possible.
Todd C. Miller [Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)]
Use debug logging instead of ignore_result() where possible.

7 years agoRemove use of non-standard sigaction_t
Todd C. Miller [Fri, 12 May 2017 16:02:18 +0000 (10:02 -0600)]
Remove use of non-standard sigaction_t

7 years agoRemove use of the non-standard SA_INTERRUPT
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Remove use of the non-standard SA_INTERRUPT

7 years agosudo 1.8.21
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
sudo 1.8.21

7 years agoAdd support for multiple '*' in env_keep, env_check and env_delete
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Add support for multiple '*' in env_keep, env_check and env_delete
entries.

7 years agoAdd SIGCHLD to the list of signals we install sudo_handler() for.
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Add SIGCHLD to the list of signals we install sudo_handler() for.
Otherwise, it is possible for the command to exit before the SIGCHLD
handler is installed.  POSIX says that signals that are ignored by
default are still ignored even if the signal mask would block them.
We need to have a handler installed for SIGCHLD before the fork().

7 years agoActivate the sigevents inside the signal pipe callback itself
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Activate the sigevents inside the signal pipe callback itself
and call signal_pipe_cb() directly if the backend returns EINTR
and the signal_caught flag is set.  This has the side effect of
processing signal events in the current pass of the event loop
instead of the next one.

7 years agoUse SUDO_EV_SIGNAL and SUDO_EV_SIGINFO instead of managing the
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Use SUDO_EV_SIGNAL and SUDO_EV_SIGINFO instead of managing the
signal_pipe explicitly.

7 years agoHandle the possibility of the siginfo parameter in sa_sigaction
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Handle the possibility of the siginfo parameter in sa_sigaction
handler being NULL.

7 years agoAdd support for signal events in sudo's event subsystem
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Add support for signal events in sudo's event subsystem

7 years agoRestore the error message for sudo_ev_add() failure.
Todd C. Miller [Fri, 12 May 2017 16:02:17 +0000 (10:02 -0600)]
Restore the error message for sudo_ev_add() failure.