Commit Graph

198 Commits

Author SHA1 Message Date
Todd C. Miller
69ab48f16d Don't allow the debug subsystem to be initialized twice.
Otherwise we can exhuast our stack when built in static mode.
2013-10-16 16:44:21 -06:00
Todd C. Miller
6a5d6f9e9e Make sure we do not try to usie index -1 in base->pfds[]. 2013-10-16 16:08:54 -06:00
Todd C. Miller
79acd5db49 Simple event subsystem that uses poll() or select(). Basically a
simplied subset of libevent2.  Currently only fd events are supported
(since that's all we need).  The poll() backend is used by default,
except on Mac OS X where poll() is broken for devices (including
/dev/tty and ptys).
2013-10-12 05:53:43 -06:00
Todd C. Miller
a6b4f41103 Fix removal of trailing newlines in a debug message. 2013-10-06 14:22:14 -06:00
Todd C. Miller
4fbcde304d Mark main() public to silence a warning on HP-UX. 2013-09-06 10:17:00 -06:00
Todd C. Miller
99352d6738 Rename error.h -> fatal.h now that there is no error() function. 2013-08-15 14:24:29 -06:00
Todd C. Miller
bec394dc11 Add support to the debug subsystem for zero-length strings. This
can happen for things like warning(NULL) or fatal(NULL) where we
just want to log the errno string.
2013-08-15 14:09:53 -06:00
Todd C. Miller
85fc5792d4 Change some fatalx(NULL) that should be fatal(NULL). 2013-08-15 13:06:49 -06:00
Todd C. Miller
d9fd6281e4 Allow default plugin dir to be configured in sudo.conf. 2013-08-13 12:24:28 -06:00
Todd C. Miller
9b2fb418ca Don't allow max_groups to be set to zero, it just complicates things
needlessly.  Fixes an assertion in visudo when there is a group-based
Defaults entry.
2013-08-12 09:14:38 -06:00
Todd C. Miller
8b4fbc5cc0 Refactor code to parse list of gids into its own function that is
shared by the sudo front-end and the sudoers module.
Make uid/gid parse error be fatal, not just a warning.
2013-08-08 11:40:36 -06:00
Todd C. Miller
6126c08f7d Add function comment block. 2013-08-08 11:38:39 -06:00
Todd C. Miller
141f91e777 Default text domain is now sudo, not sudoers. 2013-08-08 10:37:25 -06:00
Todd C. Miller
5556a0f211 Update dependency for atoid.lo 2013-08-08 08:39:58 -06:00
Todd C. Miller
fe23e7c038 Add endpointer and separator args to atoid() 2013-08-08 06:11:52 -06:00
Todd C. Miller
40cb480f07 Move atoid() to common so it can be used in src and compat too. 2013-08-07 15:10:45 -06:00
Todd C. Miller
1f3ea50afd Implement memset_s() and use it instead of zero_bytes().
A new constant, SUDO_CONV_REPL_MAX, is defined by the plugin
API as the max conversation reply length.  This constant can be
used as a max value for memset_s() when clearing passwords
filled in by the conversation function.
2013-08-03 08:30:06 -06:00
Todd C. Miller
f9c4fb69de Add missing $(PIE_LDFLAGS) $(SSP_LDFLAGS) for test programs 2013-05-22 17:04:25 -04:00
Todd C. Miller
f6e8fb8b1c Quiet a few -Wunused-result compiler warnings. 2013-05-01 11:02:09 -04:00
Todd C. Miller
d6282d154a Update copyright years. 2013-04-24 09:35:02 -04:00
Todd C. Miller
95b50f84af Use time(&now) instead of now = time(NULL) when storing the current
time in a time_t (better compiler error checking).
Better parsing and printing of 64-bit time_t on 32-bit platforms.
2013-04-23 13:15:22 -04:00
Todd C. Miller
7ac5730a4c Use EXIT_FAILURE instead of 1 as the fatal() exit value. 2013-04-20 15:10:24 -04:00
Todd C. Miller
39acd2fcba Rename error/errorx -> fatal/fatalx and remove the exit value as
it was always 1.
2013-04-18 14:07:59 -04:00
Todd C. Miller
19d0946023 Simplify lbuf append functions by moving the realloc code into
lbuf_expand().  We now expand as needed each time bytes need to be
written to the lbuf.  Also handle a NULL pointer being passed in
for paranoia's sake.
2013-04-16 11:52:24 -04:00
Todd C. Miller
adee3cded4 Don't need to include setjmp.h here, error.h already includes it. 2013-03-26 08:56:56 -04:00
Todd C. Miller
c078614b43 Fix regress tests on non-OpenBSD platforms. 2013-03-19 14:08:11 -04:00
Todd C. Miller
7f32d1ca4c Make sesh path configurable in sudo.conf 2013-03-14 16:49:42 -04:00
Todd C. Miller
496dc384ab regen 2013-03-07 15:46:11 -05:00
Todd C. Miller
d26c0d87f6 Convert efree() to a macro that just casts to void * and does free().
If the system free() can't handle free(NULL) this may crash but C89
was a long time ago.
2013-03-07 15:41:34 -05:00
Todd C. Miller
1e0a7d5112 Fix debug logging from the plugin when there is no error number.
This was broken in the big debugging reorg for 1.8.7.
2013-03-07 10:06:01 -05:00
Todd C. Miller
3e68433839 Clean up generated test files and other minor housekeeping. 2013-02-28 09:49:09 -05:00
Todd C. Miller
5d7925b24e Test setting disable_coredump to illegal value. 2013-02-20 15:48:53 -05:00
Todd C. Miller
a17fb1de71 Fix atobool() usage. 2013-02-20 15:48:12 -05:00
Todd C. Miller
299298ae42 Remove unused variable. 2013-02-20 15:47:27 -05:00
Todd C. Miller
0c40e82c16 Add simple regress tests for sudo.conf parsing. 2013-02-15 14:42:10 -05:00
Todd C. Miller
0f0ef228a5 If a line was longer that 0x80000000 the bit hack to round to the
next power of two would roll over to zero.
2013-02-14 16:34:13 -05:00
Todd C. Miller
67fed118b6 Add max_groups setting to sudo.conf (currently unused) and remove
unused return value from setters.
2013-02-14 13:34:33 -05:00
Todd C. Miller
7aae6bd6e3 Add line continuation support to sudo_parseln() and make it use
getline() instead of fgets() internally.
2013-02-07 10:56:01 -05:00
Todd C. Miller
630b47e22f Add group_source setting in sudo.conf to allow the admin to specify
how a user's groups are looked up.  Legal values are static (just
the kernel list from getgroups), dynamic (whatever the group database
includes) and adaptive (only use group db if kernel group list is
full).
2013-01-27 13:53:11 -05:00
Todd C. Miller
ef8e141248 Ignore duplicate entries in sudo.conf and report the line number
when there is an error.  Warn, don't abort if there is more than
one policy plugin.
2013-01-23 06:33:53 -05:00
Todd C. Miller
a6f3517f23 regen 2013-01-11 14:29:37 -05:00
Todd C. Miller
6e560f2bab Break out stack smashing protector options into SSP_CFLAGS and
SSP_LDFLAGS so we can use it everywhere (unlike LT_LDFLAGS).
2013-01-03 14:20:49 -05:00
Todd C. Miller
1d7072fe09 Don't include <sys/param.h>. We only needed it for MAXPATHLEN,
MAXHOSTNAMELEN and the MIN/MAX macros.  We now use PATH_MAX and
HOST_NAME_MAX throughout without falling back on MAXPATHLEN or
MAXHOSTNAMELEN and define our own MIN/MAX macros as needed.
2012-12-04 10:40:47 -05:00
Todd C. Miller
b7ae7977a6 Cannot wrap sigsetjmp() or we end up returning to the wrong place.
Use a macro instead.
2012-11-29 06:37:13 -05:00
Todd C. Miller
14e5f35d4d Include missing.h for __printflike. 2012-11-25 11:51:43 -05:00
Todd C. Miller
2632ec7e69 Move warn/error into common and make static builds work. 2012-11-25 09:34:40 -05:00
Todd C. Miller
c2c6616a0c Move _sudo_printf from src/conversation.c to common/sudo_printf.c.
Add sudo_printf function pointer that is initialized to _sudo_printf()
instead of requiring a sudo_conv function pointer everywhere.  The
plugin will reset sudo_printf to point to the version passed in via
the plugin open function.  Now plugin_error.c can just call sudo_printf
in all cases.  The sudoers binaries no longer need their own version
of sudo_printf.
2012-11-25 09:34:33 -05:00
Todd C. Miller
4bde57b8b2 Rename warning2()/error2() -> warning_nodebug()/error_nodebug(). 2012-11-25 09:34:10 -05:00
Todd C. Miller
7b3d268687 Call gettext() on parameters for warning()/warningx() instead of
having warning() do it for us.
2012-11-25 09:34:04 -05:00
Todd C. Miller
6849fff4d7 See DEFAULT_TEXT_DOMAIN 2012-11-25 08:10:12 -05:00