Commit Graph

7630 Commits

Author SHA1 Message Date
Todd C. Miller
fd8cf2c89b 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.
2014-10-24 11:28:39 -06:00
Todd C. Miller
4bf641df69 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.
2014-10-24 11:17:48 -06:00
Todd C. Miller
a2e9d66be1 Remove duplicate -U__NBBY in CPPCHECK_OPTS 2014-10-24 09:40:07 -06:00
Todd C. Miller
6c6f502835 Older shells don't support unset. 2014-10-23 16:23:37 -06:00
Todd C. Miller
d0cc4d9e4b Fix inet_ntop() replacement on older systems without it.
We only expose the prototype for net_ifs.c due to the
use of socklen_t.
2014-10-23 15:44:03 -06:00
Todd C. Miller
7dc2c8fa1c Dynamically allocate debug_fds bitmap and realloc as needed. 2014-10-23 14:37:29 -06:00
Todd C. Miller
17a2a27e46 Use generic bitmap macros instead of select-style fd_set. 2014-10-23 14:37:27 -06:00
Todd C. Miller
4baa7e6d2c Replace sudo_debug_num_instances with sudo_debug_max_instance 2014-10-23 13:43:17 -06:00
Todd C. Miller
935e48c6e4 Don't call into the debug subsystem after we've deregistered the
plugin's instance.
2014-10-23 13:42:50 -06:00
Todd C. Miller
2a47abad21 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[].
2014-10-23 13:19:51 -06:00
Todd C. Miller
f2eb6dcc06 Link with -ldl if needed when built with --disable-shared-libutil/ 2014-10-23 13:08:21 -06:00
Todd C. Miller
119c13d8b3 Fix includes order. 2014-10-23 10:16:13 -06:00
Todd C. Miller
2968ce060d Remove extra newline mistakenly introduced in rev 9682. 2014-10-23 10:15:38 -06:00
Todd C. Miller
3860552713 Fix typo in unset. 2014-10-23 09:50:29 -06:00
Todd C. Miller
fe9e035ccf Set debug instance for standalone programs. 2014-10-23 09:40:36 -06:00
Todd C. Miller
1ca52382a4 Fix compilation issues, fallout from the debug changes. 2014-10-23 09:26:13 -06:00
Todd C. Miller
6d2be1fd62 regen 2014-10-23 07:57:37 -06:00
Todd C. Miller
fbc54368cc Sudo 1.8.12 2014-10-23 07:29:08 -06:00
Todd C. Miller
323b4a814e Update with debug system changes and revent bug fixes. 2014-10-23 07:28:36 -06:00
Todd C. Miller
5270ebf1f2 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.
2014-10-23 06:36:50 -06:00
Todd C. Miller
8db5f29398 sudoers_debug_instance is now included in libparsesudoers so we don't
need to declare it here.
2014-10-23 06:19:30 -06:00
Todd C. Miller
e9914a91b1 The sudoers plugin now defines its own list of debugging subsystem names
and defines.
2014-10-22 13:30:52 -06:00
Todd C. Miller
866cfc4fc3 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.
2014-10-22 13:23:05 -06:00
Todd C. Miller
a7e724b75d 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.
2014-10-22 13:20:32 -06:00
Todd C. Miller
346ff6766e Pass plugin path in the settings array. 2014-10-22 13:13:00 -06:00
Todd C. Miller
1e0b8903f2 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.
2014-10-22 13:13:00 -06:00
Todd C. Miller
f71d4abd7b Remove an unneeded NULL check to quiet a cppcheck warning. 2014-10-22 10:41:23 -06:00
Todd C. Miller
15f5af06d7 Set locale to C for visudo and testsudoers regression tests.
Bug #672
2014-10-14 08:54:23 -06:00
Todd C. Miller
38c7d7abc4 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
2014-10-13 08:33:25 -06:00
Todd C. Miller
2c5239a3a7 Add back fix for Bug #663 2014-10-11 16:45:07 -06:00
Todd C. Miller
8f1fb89d53 The older style bash function exporting is not used by post-shellshock
versions of bash.
2014-10-10 14:04:10 -06:00
Todd C. Miller
7a901d4c07 Apple uses a different variant of the BASH_FUNC prefix for bash
functions.
2014-10-10 13:55:36 -06:00
Todd C. Miller
0be86df4dd Remove change that is part of 1.8.12 not 1.8.11p1 2014-10-07 20:28:08 -06:00
Todd C. Miller
a50e72b81b Update for sudo 1.8.11p1 2014-10-07 14:14:43 -06:00
Todd C. Miller
837fb1f81d Only check stdin for the tty and avoid the check entirely if we
don't have a way to get the tty from the kernel.  Bug #643
2014-10-07 13:50:53 -06:00
Todd C. Miller
1dd96778e5 Make a copy of ap in sudo_debug_vprintf2() in case the static buffer
is not big enough and we need to call vasprintf().
2014-10-07 12:26:32 -06:00
Todd C. Miller
dc67442151 Avoid comparing new cwd with old one if getcwd() failed.
Bug #670
2014-10-07 10:56:50 -06:00
Todd C. Miller
1890f0fcd6 Fix debugging printout output for env_should_keep() 2014-10-07 10:11:08 -06:00
Todd C. Miller
d7574a344e Use INSTALL_OWNER instead of -O/-G flags so we can work with the
autotools install-sh too.  Bug #669
2014-10-06 14:23:41 -06:00
Todd C. Miller
79f4471e41 Move sudo_printf to policy.c to match sudo_conv. 2014-10-06 10:13:42 -06:00
Todd C. Miller
bd99dcc028 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.
2014-10-05 16:41:52 -06:00
Todd C. Miller
29be093646 Use correct names when referring to subsections in the sudoers manual. 2014-10-03 10:41:53 -06:00
Todd C. Miller
5f9e84ea51 Use inet_ntop() instead of inet_ntoa() and include a version for
systems that are missing it.
2014-10-02 07:55:08 -06:00
Todd C. Miller
1d7bab5046 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.
2014-10-01 15:42:07 -06:00
Todd C. Miller
1faf2b5958 Mention --disable-shared-libutil fix. 2014-10-01 15:09:44 -06:00
Todd C. Miller
2f3ebce118 Always use --tag=disable-static to avoid installing a static
sudo_noexec.
2014-10-01 14:39:20 -06:00
Todd C. Miller
0b0481fa36 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.
2014-10-01 14:32:30 -06:00
Todd C. Miller
05d3a4c5e5 Remove LT_LDMAP and LT_LDOPT and just use LT_LDEXPORTS for the
compiler-specific option to restrict symbol exporting.
2014-10-01 13:24:57 -06:00
Todd C. Miller
1d0b5422ae Include sys/types.h to get gid_t, etc used in sudo_compat.h.
Fixes a build issue on Solaris.
2014-10-01 09:30:17 -06:00
Todd C. Miller
b2e138bde0 Fix cust & pasto in error message when there is a mismatch between
the sudo and libc ttys.  From Diego Elio Petteno'.  Bug #643
2014-09-29 15:33:39 -06:00