Todd C. Miller [Wed, 15 Jan 2014 03:34:20 +0000 (20:34 -0700)]
If the event loop exits due to an error and we are not logging I/O,
kill the command if still running. Fixes a bug where sudo could
exit while the command was still running.
Todd C. Miller [Wed, 15 Jan 2014 03:20:26 +0000 (20:20 -0700)]
When relocating preserved fds, start with the highest ones first
to avoid moving fds around more than we have to. Now uses a bitmap
to keep track of which fds are being preserved. Fixes a bug where
the debugging fd could be relocated to the same fd as the error
backchannel temporarily, resulting in debugging output being printed
to the backchannel if util@debug was enabled.
Todd C. Miller [Tue, 14 Jan 2014 17:54:56 +0000 (10:54 -0700)]
If not logging I/O we may get EOF when the command is executed and
the other end of the backchannel is closed. Just remove the
backchannel event in this case or we will continue to receive
the event. Bug #631
Todd C. Miller [Tue, 7 Jan 2014 17:35:56 +0000 (10:35 -0700)]
Go back to making the bit fields in struct cmndtag explicitly signed.
This fixes a problem on gcc 4.8 (at least) which appears to be
treating the value as unsigned by default.
Todd C. Miller [Fri, 27 Dec 2013 13:50:06 +0000 (06:50 -0700)]
Use sudoers_initlocale() in main() startup, not sudoers_setlocal()
as the latter assumes we are already in the user's locale which may
not be the case. For sudoreplay, we can just use setlocale()
directly as there is no sudoers locale.
Todd C. Miller [Mon, 16 Dec 2013 21:53:27 +0000 (14:53 -0700)]
Remove _MAX and _MIN compat; we rely on missing.h for that.
We already require the compiler handle long long so there's
no need to use HAVE_LONG_LONG_INT everywhere.
Todd C. Miller [Wed, 11 Dec 2013 21:31:50 +0000 (14:31 -0700)]
Don't use int where we really mean enum def_tuple. When this code
was written it was assumed that we may have multiple tuple types.
However, that hasn't happened and probably never will.
Todd C. Miller [Wed, 11 Dec 2013 20:43:10 +0000 (13:43 -0700)]
The OpenBSD strtonum() uses very short error strings that can't
be translated usefully. Convert them to longer strings on error.
Also use the longer strings for atomode() and atoid().
Todd C. Miller [Mon, 9 Dec 2013 21:00:55 +0000 (14:00 -0700)]
check_symbols needs to link with SUDO_LIBS in order to get -lpthread
on HP-UX for libldap (which uses threads). It would be better to
have a separate variable for the pthread library but this is no
worse than it used to be.
Todd C. Miller [Tue, 3 Dec 2013 21:19:37 +0000 (14:19 -0700)]
Add user netgroup filtering for SSSD. Previously, rules for a
netgroup were applied to all even when they did not belong to the
specified netgroup. RedHat Bugzilla 880150.
Todd C. Miller [Mon, 2 Dec 2013 18:14:25 +0000 (11:14 -0700)]
On Solaris, disabling the proc_exec privilege appears to interfere
with DAC file permissions. Adding DAC override permissions to the
inheritable set works around this for commands run as root without
giving extra permissions to other users. Bug #626
Todd C. Miller [Sun, 1 Dec 2013 01:43:57 +0000 (18:43 -0700)]
Ignore EOVERFLOW from pstat_getproc(). The HP-UX kernel appears
to return this in certain situations but it appears to be harmless
at least insofar as retrieving the tty goes.
Todd C. Miller [Fri, 22 Nov 2013 23:35:15 +0000 (16:35 -0700)]
Add wrapper functions for dlopen() et al so that we can support
statically compiling in the sudoers plugin but still allow other
plugins to be loaded. The new --enable-static-sudoers configure
option will cause the sudoers plugin to be compiled statically into
the sudo binary. This does not prevent other plugins from being
loaded as per sudo.conf.
Todd C. Miller [Thu, 21 Nov 2013 16:45:55 +0000 (09:45 -0700)]
Handle non-unix groups correctly. Get rid of runasuser and runasgroup
types and use username and usergroup instead. The fact that the user
or group is inside a Runas_List doesn't affect its underlying type.