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.
Todd C. Miller [Tue, 19 Nov 2013 23:06:08 +0000 (16:06 -0700)]
Rename snprintf replacement rpl_snprintf since we may now replace
the libc version and #define rpl_snprintf snprintf in missing.h so
we get our version when needed. This is consistent with how we
replace glob and fnmatch.
Todd C. Miller [Tue, 19 Nov 2013 16:48:01 +0000 (09:48 -0700)]
Include unistd.h in sig2str.c for Tru64 as it defines SIGRTMIN and
SIGRTMAX in terms of sysconf(), which is prototyped in unistd.h.
Bug #621; from Daniel Richard G.
Todd C. Miller [Mon, 18 Nov 2013 16:10:09 +0000 (09:10 -0700)]
Allow sudo to compile without variadic macro support in cpp.
Debugging support will be limited (no file info from warnings.)
From Daniel Richard G.; Bug #621
Todd C. Miller [Mon, 18 Nov 2013 15:59:57 +0000 (08:59 -0700)]
Add warning_gettext() wrapper function that changes to the user locale,
then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().
Todd C. Miller [Sun, 17 Nov 2013 23:11:39 +0000 (16:11 -0700)]
Add debug_return_const_str and debug_return_const_ptr for returning
a const string or pointer. Using const for the normal versions
produces warnings with the Tru64 compiler.
Todd C. Miller [Sat, 16 Nov 2013 16:21:43 +0000 (09:21 -0700)]
log_{fatal,warning} now logs to the debug file itself.
log_{fatal,warning} now calls warningx2() after setting the
locale itself instead of using the wrapper macros.
This removes the only use of warningx(ngettext(...)).
Todd C. Miller [Wed, 13 Nov 2013 21:45:47 +0000 (14:45 -0700)]
From Daniel Richard G. (bug #622)
Add an autogen.sh script that rebuilds the autoconf world.
Move old aclocal.m4 contents to m4/sudo.m4.
New (generayed) aclocal.m4 contains the m4_include directives.
Some tests had #include directives where the '#' was not in column 1.
Updated obsolete macro usage via autoupdate.
Todd C. Miller [Mon, 11 Nov 2013 23:00:07 +0000 (16:00 -0700)]
In v{warning,fatal}x?() make a new copy of ap for the debug functions.
It is not legal to use ap twice without reinitializing it.
Noticed by Daniel Richard G.
Todd C. Miller [Mon, 11 Nov 2013 20:53:06 +0000 (13:53 -0700)]
Uniquify header dependencies so we don't end up with duplicates
when a header file includes other headers. The header dependencies
are sorted so the generated order is stable.
Todd C. Miller [Mon, 4 Nov 2013 13:06:01 +0000 (06:06 -0700)]
When deleting an event, check ev->events to determine whether to
remove from readfds or writefds instead of blinding removing from
both. Also fix highfd adjustment.
Todd C. Miller [Fri, 1 Nov 2013 22:54:49 +0000 (16:54 -0600)]
Don't call sudo_ev_{add,del}_impl() for timeout-only events. This
makes it possible to pass sudo_ev_alloc() an fd of -1 for events
only use SUDO_EV_TIMEOUT.
Todd C. Miller [Tue, 29 Oct 2013 21:26:32 +0000 (15:26 -0600)]
Use MSG_WAITALL when receiving struct command_status over the Unix
domain socket since we no longer use datagrams. This should avoid
the need to handle incomplete reads, though in theory it is still
possible.
Todd C. Miller [Mon, 28 Oct 2013 22:40:04 +0000 (16:40 -0600)]
Fix sudo_ev_scan_impl() return value in event_poll.c.
Make sure we clear active flag from unprocessed events if
sudo_ev_loopbreak() or sudo_ev_loopcontinue() are used.
Remove bogus optimization when the timeout is zero or negative; it
could prevent an I/O event from being triggered.
Todd C. Miller [Mon, 28 Oct 2013 17:13:45 +0000 (11:13 -0600)]
Get rid of cur and pending pointers in struct sudo_event_base. We
now pop the first event off the active queue instead of using a
foreach loop with deferred removal of the event.
Add SUDO_EVQ_INSERTED and SUDO_EVQ_TIMEOUTS flags to indicate that
the event on the event queue and timeouts queue respectively.
No longer need to compare the timeout to {0,0} or compare the
event's base pointer to NULL to determine queue membership.