Commit Graph

439 Commits

Author SHA1 Message Date
Todd C. Miller
d0c333969a Remove artificial limit on length of pattern and string. It is
possible to use fnmatch() on things other than paths (such as
arguments) so a limit of PATH_MAX does not make sense.  Fixes a bug
where rules would fail to match if the length of the arguments were
larger than PATH_MAX (usually 1024).
2014-12-10 14:00:12 -07:00
Todd C. Miller
bc6269e58b Prevent cppcheck from getting confused by our compat definition of
the va_copy macro for pre-C99.
2014-11-15 06:32:39 -07:00
Todd C. Miller
cbe917c540 If there are multiple outputs, ap will be re-used so make a copy
and operate on it instead.
2014-11-14 16:30:22 -07:00
Todd C. Miller
04d803c79c Use SSP_LDFLAGS when creating shared objects. 2014-11-10 14:58:46 -07:00
Todd C. Miller
d00142f552 We only build .lo (not .o) files for libsudo_util 2014-11-10 14:58:45 -07:00
Todd C. Miller
2040d4dde5 Use arc4random() for mkstemp/mkdtemp if available. If not, try to
seed from /dev/urandom before falling back to the gettimeofday seed.
2014-10-31 06:57:19 -06:00
Todd C. Miller
ccc210eddb If a system lacks mkdtemp() or mkstemps(), use our own mkdtemp()
and mkstemps().  Previously we only exposed the missing one but
since the guts are the same we might as well use them.
2014-10-29 13:03:39 -06:00
Todd C. Miller
2eed956396 Use a static buffer for sudo_debug_execve2() if possible. 2014-10-31 06:57:17 -06:00
Todd C. Miller
1be81d5720 Fix path settings broken in rev 9731. 2014-10-27 16:31:33 -06:00
Todd C. Miller
f730b28ce0 Adjust regress test now that boolean settings display an error for
invalid input.
2014-10-27 16:31:01 -06:00
Todd C. Miller
0982f7838b Use AC_PROG_AWK 2014-10-27 14:54:13 -06:00
Todd C. Miller
0d6895cbd9 fix comment typo 2014-10-27 14:21:27 -06:00
Todd C. Miller
adfdad9ae0 Version the symbols for sudo_debug.c now that the API is stable. 2014-10-27 05:26:08 -06:00
Todd C. Miller
d5fdd1ea07 Go back to parsing sudo.conf in place for settings and paths and
improve debugging info for unsupported entries and parse errors.
2014-10-26 08:33:09 -06:00
Todd C. Miller
6b1b734ffa 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.
2014-10-26 08:33:08 -06:00
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
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
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
2968ce060d Remove extra newline mistakenly introduced in rev 9682. 2014-10-23 10:15:38 -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
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
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
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
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
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
f5647654dd 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.
2014-09-20 06:46:27 -06:00
Todd C. Miller
e20475922d There is no longer a reason for the plugin to init the debug subsystem
itself.  It will always be initialized by the front-end if needed.
2014-09-08 16:24:32 -06:00
Todd C. Miller
d557aee1ec Remove obsolete definition of SIZE_T which is now handled by
sudo_compat.h and rename the format arg to fmt in sudo_evasprintf_v1()
for consistency with sudo_easprintf_v1().
2014-09-08 14:30:17 -06:00
Todd C. Miller
111136dc8b regen 2014-09-03 10:32:02 -06:00
Todd C. Miller
f95ca8d4f0 Remove confusing comment. 2014-09-02 15:00:23 -06:00
Todd C. Miller
4fa58d6974 Use a stack buffer for the debug message when possible, most are small. 2014-09-02 14:36:05 -06:00
Todd C. Miller
8bc688188f Move sudo_printf extern to sudo_util.h 2014-08-31 18:46:26 -06:00
Todd C. Miller
a07ce849f7 Some versions of the HP C Compiler don't export functions that take
function pointers as arguments unless a typedef is used.
2014-08-31 18:33:30 -06:00
Todd C. Miller
152178e4be Don't need sudo_fatal.h 2014-08-31 14:20:44 -06:00
Todd C. Miller
2b849b2687 Don't allow sudo_ev_loopcont() to override sudo_ev_loopexit() 2014-08-29 09:47:08 -06:00
Todd C. Miller
e9370718f9 Add some internal convenience functions. 2014-08-29 09:44:08 -06:00
Todd C. Miller
2246b1827f Don't recurse infinitely until we blow the stack when the debug
file can't be opened in the front-end.  The conversation-type debug
mode will be removed in the future.
2014-08-18 16:35:58 -06:00
Todd C. Miller
6d8c6ed37a remove unused label 2014-08-15 14:37:07 -06:00
Todd C. Miller
dcd505d0c5 Remove regress .err files in distclean target. 2014-08-08 14:53:14 -06:00
Todd C. Miller
69762d8882 Remove generated files for linker as part of distclean. 2014-08-08 14:49:06 -06:00
Todd C. Miller
76a6dad424 Add --disable-shared-libutil configure option. It may only be used
in conjunction with the --enable-static-sudoers option.
2014-08-08 11:03:24 -06:00
Todd C. Miller
f29880c1c7 If getaddrinfo() is missing libsudoutil may need to pull in networking
libraries.
2014-07-29 13:06:18 -06:00