Commit Graph

265 Commits

Author SHA1 Message Date
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
Todd C. Miller
daf634b728 Only include functions in util.exp that are actually in the library.
Fixes a problem on Solaris where undefined functions that are listed
as exported in the map file result in a link error.
Also make sure we use our glob.c if the system is missing glob().
2014-07-29 10:52:43 -06:00
Todd C. Miller
8c86e5c116 Remove support for getting program name via /proc as pr_fname is
usually filled in after symbolic links have been processed, even
on Solaris.
2014-07-25 14:08:59 -06:00
Todd C. Miller
ceb1f6eae6 Use shlib_enable instead of soext when determining whether to install
the library.
2014-07-25 14:08:50 -06:00
Todd C. Miller
cd56a87590 Avoid potential division by zero 2014-07-25 14:07:39 -06:00
Todd C. Miller
ebbd62eac8 Don't link progname test with libsudo_util, just link in progname.lo
directly since that is all we need.  Avoid a linker issue on darwin.
2014-07-25 14:07:09 -06:00
Todd C. Miller
7421524478 Remove pstat_getproc() path as pst_ucomm on HP-UX will return the
target of a symbolic link and not the name of the link itself.
Avoid using pr_fname on AIX for the same reason.
Bug 654
2014-07-25 09:42:41 -06:00
Todd C. Miller
f6fec06037 Add test for getprogname() and symbolic links; bug 654 2014-07-25 09:37:58 -06:00
Todd C. Miller
536e5f4189 sudo_term_{erase,kill} are regular symbols not functions. 2014-07-23 17:06:33 -06:00
Todd C. Miller
47835ff289 Rename missing.h -> sudo_compat.h 2014-07-22 14:25:16 -06:00
Todd C. Miller
ecaecdc1f4 Merge secure_path.h -> sudo_util.h 2014-07-22 11:37:39 -06:00
Todd C. Miller
844a285391 Version the functions in libsudo_util 2014-07-22 11:26:17 -06:00
Todd C. Miller
127ba1354b Rename gettext.h -> sudo_gettext.h 2014-07-21 14:49:43 -06:00
Todd C. Miller
3687b665cb Rename fatal.h -> sudo_fatal.h 2014-07-21 14:40:18 -06:00
Todd C. Miller
b45727cefa Rename queue.h -> sudo_queue.h to avoid collisions with the system
version.
2014-07-21 14:37:27 -06:00
Todd C. Miller
d7c309f702 Conver sudo_debug_write() to a macro 2014-07-21 09:13:47 -06:00
Todd C. Miller
9071e95080 Move mksiglist.h and mksigname.h to lib/util where they belong. 2014-07-14 09:46:17 -06:00
Todd C. Miller
96d1967ab0 Avoid passing -no-fast-install to libtool as this results in the
build dir being left in the library path of the installed executable.
Instead, we remove the "lt-" prefix from the program name in
initprogname() so that the regress test output is unaffected by
libtool's binary wrapper.
2014-07-14 09:08:50 -06:00
Todd C. Miller
9f3caa5a62 Use sudo_strtoid() now that it is located in the same library. 2014-07-13 07:09:00 -06:00
Todd C. Miller
c10c9cd5e6 Skip leading space (ala strtol) so that we can pick up the sign
even if it is not the first character of the string.
2014-07-13 07:08:12 -06:00
Todd C. Miller
36a5767e3e efree -> sudo_efree for consistency 2014-07-10 15:35:04 -06:00
Todd C. Miller
12c3b456d8 Add sudo_warn_strerror() that wraps strerror() with calls to
setlocale() in sudoers so we always get the error string in the
user's locale.  Also change _warning() to take the error number as
a parameter instead of examining errno.
2014-07-08 09:52:21 -06:00
Todd C. Miller
2bad717548 Avoid a cppcheck warning when NSIG is not defined. 2014-07-03 16:55:01 -06:00
Todd C. Miller
4e1e76a4b1 Use libtool to install/uninstall the plugins and sudo_noexec. 2014-06-29 20:45:36 -06:00
Todd C. Miller
2ab61a1281 Don't build a static libsudo_util.a unless we are linking sudoers
statically.
2014-07-01 14:26:47 -06:00