then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().
is currently O(n). The only consumer of timed events is sudoreplay
which only used a singled one so O(n) == O(1) for now. This also
allows us to remove the nanosleep compat function as we now use a
timeout event instead.
safe_close(). A new ev_free_by_fd() function is used to remove and
free any events sharing the specified fd. This can be used after
safe_close() to make sure we don't try to select() on a closed fd.
queue functions. This includes a private queue.h header derived
from FreeBSD. It is simpler to just use our own header rather than
try to deal with macros that may or may not be present in various
queue.h incarnations.
simplied subset of libevent2. Currently only fd events are supported
(since that's all we need). The poll() backend is used by default,
except on Mac OS X where poll() is broken for devices (including
/dev/tty and ptys).
until just before we exec the command. This is consistent with the
non-pty path. As a side effect, the monitor process runs as root
and not the runas user.
regardless of whether or not it is ignored by the underlying command
since there's no way to know what signal handlers the command will
install. Now we just use sudo_sigaction() to set a flag in
saved_signals[] to indicate whether a signal needs to be restored
before exec.
wrapper that has an extra flag to check the saved_signals list to
only install the handler if the signal is not already ignored.
Bump plugin API version for the new front-end signal behavior.
option to match. When set, commands are started in the background
and automatically foregrounded as needed. There are issues with
some ill-mannered programs (like Linux su) so this is not the
default.
foreground process. This helps work around poorly behaved programs
that catch SIGTTOU/SIGTTIN but suspend themselves with SIGSTOP. At
worst, sudo will go into the background but upon resume the command
will be runnable. Otherwise, we can get into a situation where the
command will immediately suspend itself.
MAXHOSTNAMELEN and the MIN/MAX macros. We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
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.
shortage. Older Solaris select() may return EIO instead of EBADF
when the tty goes away. If we get an unhandled select() failure,
kill the child and exit cleanly.
It is better to receive EIO from read()/write() than to be suspended
when we don't expect it. Fixes a problem when our terminal is
revoked which can happen when, e.g. our sshd is killed unceremoniously.
Also, only change the value of "alive" from true to false, never
from false to true. It is possible for us to receive notification
of the child having stopped after it is already dead. This does
not mean it has risen from the grave.