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.
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.