Todd C. Miller [Sun, 26 Oct 2014 14:33:08 +0000 (08:33 -0600)]
Add a flag argument to sudo_conf_read() so we can decide which
bits get parsed. This lets us parse Debug statements first and
init the debug subsystem early.
Todd C. Miller [Fri, 24 Oct 2014 17:28:39 +0000 (11:28 -0600)]
No need to convert sudoedit -> sudo in sudo_debug_get_instance()
as we store the actual program name and only do the sudoedit ->
sudo conversion when reading the sudo.conf file. Fixes debugging
when invoked as sudoedit.
Todd C. Miller [Fri, 24 Oct 2014 17:17:48 +0000 (11:17 -0600)]
In the plugin registers with the debug framework at open time, the
sudo front-end will now set the default debug instance appropriately
before calling into the plugin. This means the plugin no longer needs
to do the sudo_debug_set_default_instance() dance.
Todd C. Miller [Thu, 23 Oct 2014 19:19:51 +0000 (13:19 -0600)]
Only fill in subsystem_ids[] for the instance if the caller passed
in an array for it. If the caller only wants the default subsystems
we don't actually need ids[].
Todd C. Miller [Thu, 23 Oct 2014 12:36:50 +0000 (06:36 -0600)]
When registering with the debug subsystem, the caller now passes
in an arrary of ints that gets filled in with the subsytem IDs to
be used in debug_decl.
Todd C. Miller [Wed, 22 Oct 2014 19:23:05 +0000 (13:23 -0600)]
Add support for multiple Debug lines per program. Callers may
register arbitrary debug facilities or use built-in defaults. We
now use separate Debug statements for plugins and programs.
Todd C. Miller [Wed, 22 Oct 2014 19:20:32 +0000 (13:20 -0600)]
Change how sudo.conf is parsed. We now do a quick parse and then
set the values after the entire file has been parsed. This lets
us init the debug system earlier. Plugin-specific debug flags are
now stored in struct plugin_info and struct plugin_container and
passed to the plugin via one or more debug_flags settings.
Todd C. Miller [Wed, 22 Oct 2014 19:13:00 +0000 (13:13 -0600)]
Return settings from parse_args as struct sudo_settings and format
for the plugin at plugin open time. This will allow for additional,
plugin-specific settings to be added to the array.
Todd C. Miller [Mon, 13 Oct 2014 14:33:25 +0000 (08:33 -0600)]
Fix logic bug. We only want to return -1 from linux_audit_open()
when audit_open() fails and errno is not one of EINVAL, EPROTONOSUPPORT,
or EAFNOSUPPORT. For those errno values, we return AUDIT_NOT_CONFIGURED
which is not a fatal error. Bug #671
Todd C. Miller [Sun, 5 Oct 2014 22:41:52 +0000 (16:41 -0600)]
Add sudo_warn_set_conversation() to specify a conversation function
to use for warn/fatal. If no conversation function is specified,
the standard error will be used. We now only need sudo_printf()
for things that use the parser.
Todd C. Miller [Wed, 1 Oct 2014 21:42:07 +0000 (15:42 -0600)]
Fix detection of functions in network libs like -lsocket, -lnsl and
-linet when we have already added those libs to NET_LIBS.
Fixes a problem where inet_pton() was not detected on Solaris.
Todd C. Miller [Wed, 1 Oct 2014 20:32:30 +0000 (14:32 -0600)]
Instead of building libutil statically for --disable-shared-libutil,
just treat it as a convenience library. Do the same with sudoers
for --enable-static-sudoers. Fixes link errors on Solaris among
others when --disable-shared-libutil is used.
Todd C. Miller [Sat, 27 Sep 2014 16:16:31 +0000 (10:16 -0600)]
Block SIGINT and SIGQUIT while verifying passwords so that
authentication modules that use sleep() are not interrupted.
If the user interrupted authentication, exit the loop.
Todd C. Miller [Sat, 27 Sep 2014 16:13:28 +0000 (10:13 -0600)]
Only check for -lshadow if we haven't already found getspnam() in
libc. Rather than treat this specially, just add -lshadow as another
place to search in addition to -lgen.
Todd C. Miller [Wed, 24 Sep 2014 15:18:54 +0000 (09:18 -0600)]
In pp_files_expand() set _target to be empty. Fixes a problem with
Solaris sh where simply using typeset doesn't causes the variable
to be treated as local so we can inadvertantly inherit a value from
a previous call.
Todd C. Miller [Sat, 20 Sep 2014 15:21:51 +0000 (09:21 -0600)]
On AIX, _PATH_BSHELL is /usr/bin/bsh but we want to use /usr/bin/sh
(which is usually ksh). This makes sudo's behavior when executing
a shell without the #! magic number match execvp() on AIX.
Todd C. Miller [Sat, 20 Sep 2014 12:46:27 +0000 (06:46 -0600)]
Don't use SSP_CFLAGS or PIE_CFLAGS when building mksiglist/mksigname
as they are built with the host compiler which may be different
when cross-compiling. From Gustavo Zacarias. Bug 662.