Commit Graph

15 Commits

Author SHA1 Message Date
Todd C. Miller
abdff25703 Always pass __func__, __FILE__ and __LINE__ in sudo_debug_printf()
and use a new flag, SUDO_DEBUG_FILENO to specify when to use it.
This allows consumers of sudo_debug_printf() to log that data without
having to specify it manually.
2012-04-05 13:04:00 -04:00
Todd C. Miller
2c84bd4d08 Log warning() at SUDO_DEBUG_WARN not SUDO_DEBUG_ERROR.
Log the function, file and line number in the debug log for warning()
and error().
2012-04-05 12:37:15 -04:00
Todd C. Miller
2fe41248ac Add SUDO_DEBUG_ERRNO flag to debug functions so we can log errno.
Use this flag when wrapping error() and warning() so the debug
output includes the error string.
2012-04-04 16:59:31 -04:00
Todd C. Miller
aecb5206e2 Fix compiler warnings on some platforms and provide a better method
of defeating gcc's warn_unused_result attribute.
2012-03-29 10:33:40 -04:00
Todd C. Miller
37770ecf1e Initial cut at a hooks implementation. The plugin can register
hooks for getenv, putenv, setenv and unsetenv.  This makes it
possible for the plugin to trap changes to the environment made by
authentication methods such as PAM or BSD auth so that such changes
are reflected in the environment passed back to sudo for execve().
2012-03-07 16:35:42 -05:00
Todd C. Miller
e16ae617e4 g/c now-unused debug subsystems 2012-02-05 10:17:26 -05:00
Todd C. Miller
c91f5ee680 Make sure we don't try to fall back to using the conversation
function for debugging in the main sudo process if we are unable
to open the debug file.
2012-02-03 12:30:07 -05:00
Todd C. Miller
fa15fc7651 The result of writev() is never checked so just cast to NULL. 2012-01-11 13:09:09 -05:00
Todd C. Miller
21a2f95821 Use stdbool.h instead of rolling our own TRUE/FALSE macros. 2011-12-02 11:27:33 -05:00
Todd C. Miller
ab887a6fb0 No longer pass debug_file to plugin, plugins must now use CONV_DEBUG_MSG 2011-11-30 14:56:41 -05:00
Todd C. Miller
8fa6ab0372 Include time.h for ctime() prototype. 2011-11-30 09:14:11 -05:00
Todd C. Miller
a64f1eaea8 Do not close error pipe or debug fd via closefrom() as we need them
to report an exec error should one occur.
2011-11-29 19:51:24 -05:00
Todd C. Miller
65b781a2ef Use SUDO_CONV_DEBUG_MSG in the plugin instead of writing
directly to the debug file.
2011-11-13 13:55:19 -05:00
Todd C. Miller
3ee9cef0da Fold SUDO_DEBUG_PROGERR and SUDO_DEBUG_SYSERR into SUDO_DEBUG_ERROR 2011-11-07 16:33:49 -05:00
Todd C. Miller
53e3ad11b5 New debug framework for sudo and plugins using /etc/sudo.conf that
also supports function call tracing.
2011-10-22 14:00:52 -04:00