]> granicus.if.org Git - sudo/log
sudo
11 years agoWarn if the time stamp in the I/O log file does not fit in time_t.
Todd C. Miller [Sat, 14 Dec 2013 15:30:37 +0000 (08:30 -0700)]
Warn if the time stamp in the I/O log file does not fit in time_t.
Warn if the info line is not well-formed instead of silently ignoring
it.

11 years agoRename libcommon libsudo_util
Todd C. Miller [Fri, 13 Dec 2013 14:46:05 +0000 (07:46 -0700)]
Rename libcommon libsudo_util

11 years agoMove prototypes for functions provided by libcommon that don't have
Todd C. Miller [Fri, 13 Dec 2013 01:29:07 +0000 (18:29 -0700)]
Move prototypes for functions provided by libcommon that don't have
their own header files into sudo_util.h.

11 years agoNow that we have proper number parsing functions we should store
Todd C. Miller [Wed, 11 Dec 2013 21:43:04 +0000 (14:43 -0700)]
Now that we have proper number parsing functions we should store
T_UINT defaults values as unsigned int, not int.

11 years agoDon't use int where we really mean enum def_tuple. When this code
Todd C. Miller [Wed, 11 Dec 2013 21:31:50 +0000 (14:31 -0700)]
Don't use int where we really mean enum def_tuple.  When this code
was written it was assumed that we may have multiple tuple types.
However, that hasn't happened and probably never will.

11 years agoRegen after string parsing changes.
Todd C. Miller [Wed, 11 Dec 2013 20:55:12 +0000 (13:55 -0700)]
Regen after string parsing changes.

11 years agoThe OpenBSD strtonum() uses very short error strings that can't
Todd C. Miller [Wed, 11 Dec 2013 20:43:10 +0000 (13:43 -0700)]
The OpenBSD strtonum() uses very short error strings that can't
be translated usefully.  Convert them to longer strings on error.
Also use the longer strings for atomode() and atoid().

11 years agoAdd atomode() function for parsing a file mode.
Todd C. Miller [Tue, 10 Dec 2013 23:56:54 +0000 (16:56 -0700)]
Add atomode() function for parsing a file mode.

11 years agoUse strtonum() instead of atoi(), strtol() or strtoul() where possible.
Todd C. Miller [Tue, 10 Dec 2013 23:23:21 +0000 (16:23 -0700)]
Use strtonum() instead of atoi(), strtol() or strtoul() where possible.

11 years agoAdd strtonum.c to compat for simpler number parsing.
Todd C. Miller [Tue, 10 Dec 2013 21:38:52 +0000 (14:38 -0700)]
Add strtonum.c to compat for simpler number parsing.

11 years agoFix a warning on Solaris, we need to use debug_return_const_ptr.
Todd C. Miller [Mon, 9 Dec 2013 21:06:46 +0000 (14:06 -0700)]
Fix a warning on Solaris, we need to use debug_return_const_ptr.

11 years agocheck_symbols needs to link with SUDO_LIBS in order to get -lpthread
Todd C. Miller [Mon, 9 Dec 2013 21:00:55 +0000 (14:00 -0700)]
check_symbols needs to link with SUDO_LIBS in order to get -lpthread
on HP-UX for libldap (which uses threads).  It would be better to
have a separate variable for the pthread library but this is no
worse than it used to be.

11 years agoadd missing comma
Todd C. Miller [Sun, 8 Dec 2013 18:20:32 +0000 (11:20 -0700)]
add missing comma

11 years agoMake -c option description more accurate.
Todd C. Miller [Sun, 8 Dec 2013 18:06:27 +0000 (11:06 -0700)]
Make -c option description more accurate.

11 years agoWhen checking whether a user may change the login class, just check
Todd C. Miller [Sat, 7 Dec 2013 16:17:54 +0000 (09:17 -0700)]
When checking whether a user may change the login class, just check
pw_uid of the runas user, which was passed in to set_loginclass().

11 years agoUse atoid() when parsing user/group IDs and print them as unsigned int.
Todd C. Miller [Fri, 6 Dec 2013 21:10:03 +0000 (14:10 -0700)]
Use atoid() when parsing user/group IDs and print them as unsigned int.

11 years agoCorrectly parse 64-bit times in I/O log files.
Todd C. Miller [Thu, 5 Dec 2013 23:19:50 +0000 (16:19 -0700)]
Correctly parse 64-bit times in I/O log files.

11 years agoUse atoid() not atoi() when parsing uids/gids.
Todd C. Miller [Thu, 5 Dec 2013 22:51:56 +0000 (15:51 -0700)]
Use atoid() not atoi() when parsing uids/gids.

11 years agoBetter match debugging.
Todd C. Miller [Thu, 5 Dec 2013 21:34:56 +0000 (14:34 -0700)]
Better match debugging.
Sprinkle const in match functions.

11 years agoDocument that plugins can be compiled statically into the sudo binary.
Todd C. Miller [Wed, 4 Dec 2013 23:05:05 +0000 (16:05 -0700)]
Document that plugins can be compiled statically into the sudo binary.

11 years agosudo_sss_filter_user_netgroup(): fix comment typos, break out of loop
Todd C. Miller [Tue, 3 Dec 2013 22:47:45 +0000 (15:47 -0700)]
sudo_sss_filter_user_netgroup(): fix comment typos, break out of loop
early if we match ALL or netgroup.

11 years agoWhen filtering netgroups, use the passwd struct stashed in the handle,
Todd C. Miller [Tue, 3 Dec 2013 22:39:12 +0000 (15:39 -0700)]
When filtering netgroups, use the passwd struct stashed in the handle,
not user_name since we may be listing another users privileges.

11 years agoRHEL 6 and above builds sudo with SSSD support
Todd C. Miller [Tue, 3 Dec 2013 22:18:42 +0000 (15:18 -0700)]
RHEL 6 and above builds sudo with SSSD support

11 years agoAvoid passing NULL domainname to sudo_debug_printf().
Todd C. Miller [Tue, 3 Dec 2013 22:15:12 +0000 (15:15 -0700)]
Avoid passing NULL domainname to sudo_debug_printf().

11 years agoDocument sssd debug subsystem.
Todd C. Miller [Tue, 3 Dec 2013 21:42:33 +0000 (14:42 -0700)]
Document sssd debug subsystem.

11 years agoDocument "event" debug subsystem.
Todd C. Miller [Tue, 3 Dec 2013 21:40:58 +0000 (14:40 -0700)]
Document "event" debug subsystem.

11 years agoUse atoid() instead of atoi() when parsing uids/gids so we get
Todd C. Miller [Tue, 3 Dec 2013 21:33:26 +0000 (14:33 -0700)]
Use atoid() instead of atoi() when parsing uids/gids so we get
proper range checking.

11 years agoAdd user netgroup filtering for SSSD. Previously, rules for a
Todd C. Miller [Tue, 3 Dec 2013 21:19:37 +0000 (14:19 -0700)]
Add user netgroup filtering for SSSD.  Previously, rules for a
netgroup were applied to all even when they did not belong to the
specified netgroup.  RedHat Bugzilla 880150.

11 years agoFix several issues found by the clang static analyzer; Daniel Kopecek
Todd C. Miller [Tue, 3 Dec 2013 21:10:11 +0000 (14:10 -0700)]
Fix several issues found by the clang static analyzer; Daniel Kopecek

11 years agoMention how to dump sudoers info from LDAP.
Todd C. Miller [Mon, 2 Dec 2013 23:00:15 +0000 (16:00 -0700)]
Mention how to dump sudoers info from LDAP.

11 years agoOn Solaris, disabling the proc_exec privilege appears to interfere
Todd C. Miller [Mon, 2 Dec 2013 18:14:25 +0000 (11:14 -0700)]
On Solaris, disabling the proc_exec privilege appears to interfere
with DAC file permissions.  Adding DAC override permissions to the
inheritable set works around this for commands run as root without
giving extra permissions to other users.  Bug #626

11 years agoInstead of setprogname(), add initprogname() which gets the program
Todd C. Miller [Mon, 2 Dec 2013 02:12:21 +0000 (19:12 -0700)]
Instead of setprogname(), add initprogname() which gets the program
name for getprogname() using /proc or pstat() if possible.

11 years agoIgnore EOVERFLOW from pstat_getproc(). The HP-UX kernel appears
Todd C. Miller [Sun, 1 Dec 2013 01:43:57 +0000 (18:43 -0700)]
Ignore EOVERFLOW from pstat_getproc().  The HP-UX kernel appears
to return this in certain situations but it appears to be harmless
at least insofar as retrieving the tty goes.

11 years agoSync with translationproject.org
Todd C. Miller [Sat, 30 Nov 2013 22:19:19 +0000 (15:19 -0700)]
Sync with translationproject.org

11 years agoAdd missing newline in help message after export option.
Todd C. Miller [Thu, 28 Nov 2013 13:08:08 +0000 (06:08 -0700)]
Add missing newline in help message after export option.

11 years agoDo not add LIBDL to SUDO_LIBS or SUDOERS_LIBS in configure, do it
Todd C. Miller [Tue, 26 Nov 2013 14:15:55 +0000 (07:15 -0700)]
Do not add LIBDL to SUDO_LIBS or SUDOERS_LIBS in configure, do it
in Makefile.in so we can make it last.  Fixes a linking problem on
Ubuntu precise.

11 years agoDo not rely on NULL being defined for getaddrinfo() test.
Todd C. Miller [Mon, 25 Nov 2013 16:54:04 +0000 (09:54 -0700)]
Do not rely on NULL being defined for getaddrinfo() test.
Fixes the check on HP-UX 11.23.

11 years agoRegen for sudo 1.8.9b1
Todd C. Miller [Sun, 24 Nov 2013 23:37:32 +0000 (16:37 -0700)]
Regen for sudo 1.8.9b1

11 years agoSync with translationproject.org
Todd C. Miller [Sun, 24 Nov 2013 23:31:40 +0000 (16:31 -0700)]
Sync with translationproject.org

11 years agoAdd wrapper functions for dlopen() et al so that we can support
Todd C. Miller [Fri, 22 Nov 2013 23:35:15 +0000 (16:35 -0700)]
Add wrapper functions for dlopen() et al so that we can support
statically compiling in the sudoers plugin but still allow other
plugins to be loaded.  The new --enable-static-sudoers configure
option will cause the sudoers plugin to be compiled statically into
the sudo binary.  This does not prevent other plugins from being
loaded as per sudo.conf.

11 years agoHandle non-unix groups correctly. Get rid of runasuser and runasgroup
Todd C. Miller [Thu, 21 Nov 2013 16:45:55 +0000 (09:45 -0700)]
Handle non-unix groups correctly.  Get rid of runasuser and runasgroup
types and use username and usergroup instead.  The fact that the user
or group is inside a Runas_List doesn't affect its underlying type.

11 years agoSimplify Defaults list option object. The name and value strings
Todd C. Miller [Wed, 20 Nov 2013 21:35:35 +0000 (14:35 -0700)]
Simplify Defaults list option object.  The name and value strings
are superfluous.

11 years agoBack out unintended change.
Todd C. Miller [Wed, 20 Nov 2013 19:21:34 +0000 (12:21 -0700)]
Back out unintended change.

11 years agoAdd dedicated test for getaddrinfo(). Tru64 UNIX contains two
Todd C. Miller [Wed, 20 Nov 2013 19:04:47 +0000 (12:04 -0700)]
Add dedicated test for getaddrinfo().  Tru64 UNIX contains two
versions of getaddrinfo and we must include netdb.h to get the
proper definition.

11 years agoDefine RTLD_GLOBAL for older systems without it. Bug #621
Todd C. Miller [Wed, 20 Nov 2013 14:22:10 +0000 (07:22 -0700)]
Define RTLD_GLOBAL for older systems without it.  Bug #621

11 years agoRename snprintf replacement rpl_snprintf since we may now replace
Todd C. Miller [Tue, 19 Nov 2013 23:06:08 +0000 (16:06 -0700)]
Rename snprintf replacement rpl_snprintf since we may now replace
the libc version and #define rpl_snprintf snprintf in missing.h so
we get our version when needed.  This is consistent with how we
replace glob and fnmatch.

11 years agolibcommon tests need locale_stub.lo to link.
Todd C. Miller [Tue, 19 Nov 2013 18:00:41 +0000 (11:00 -0700)]
libcommon tests need locale_stub.lo to link.

11 years agoAdd check for C99 compliant (v)snprintf function.
Todd C. Miller [Tue, 19 Nov 2013 17:40:25 +0000 (10:40 -0700)]
Add check for C99 compliant (v)snprintf function.

11 years agoInclude unistd.h in sig2str.c for Tru64 as it defines SIGRTMIN and
Todd C. Miller [Tue, 19 Nov 2013 16:48:01 +0000 (09:48 -0700)]
Include unistd.h in sig2str.c for Tru64 as it defines SIGRTMIN and
SIGRTMAX in terms of sysconf(), which is prototyped in unistd.h.
Bug #621; from Daniel Richard G.

11 years agoAdd definition of U_ for --disable-nsl
Todd C. Miller [Tue, 19 Nov 2013 16:45:13 +0000 (09:45 -0700)]
Add definition of U_ for --disable-nsl
Don't define warning_gettext if --disable-nsl
Bug #621; from Daniel Richard G.

11 years agoWhen merging Defaults entries we need to check the type of the
Todd C. Miller [Mon, 18 Nov 2013 23:59:02 +0000 (16:59 -0700)]
When merging Defaults entries we need to check the type of the
next entry and not just assume it is the same as the previous one.

11 years agorunasgroups not runasgroup in the Cmnd_Spec.
Todd C. Miller [Mon, 18 Nov 2013 23:28:10 +0000 (16:28 -0700)]
runasgroups not runasgroup in the Cmnd_Spec.

11 years agoFix some syntax errors and change how lists are handled.
Todd C. Miller [Mon, 18 Nov 2013 19:00:44 +0000 (12:00 -0700)]
Fix some syntax errors and change how lists are handled.

11 years agoAllow sudo to compile without variadic macro support in cpp.
Todd C. Miller [Mon, 18 Nov 2013 16:10:09 +0000 (09:10 -0700)]
Allow sudo to compile without variadic macro support in cpp.
Debugging support will be limited (no file info from warnings.)
From Daniel Richard G.; Bug #621

11 years agoAdd warning_gettext() wrapper function that changes to the user locale,
Todd C. Miller [Mon, 18 Nov 2013 15:59:57 +0000 (08:59 -0700)]
Add warning_gettext() wrapper function that changes to the user locale,
then calls gettext().
Add U_ macro that calls warning_gettext() instead of gettext().
Rename warning2()/error2() back to warning_nodebug()/error_nodebug().

11 years agoFix some #if vs. #ifdef and remove an extraneous semicolon.
Todd C. Miller [Sun, 17 Nov 2013 23:15:36 +0000 (16:15 -0700)]
Fix some #if vs. #ifdef and remove an extraneous semicolon.
Bug #624; from Daniel Richard G.

11 years agoAdd debug_return_const_str and debug_return_const_ptr for returning
Todd C. Miller [Sun, 17 Nov 2013 23:11:39 +0000 (16:11 -0700)]
Add debug_return_const_str and debug_return_const_ptr for returning
a const string or pointer.  Using const for the normal versions
produces warnings with the Tru64 compiler.

11 years agoFixes for building under Tru64; from Daniel Richard G.
Todd C. Miller [Sun, 17 Nov 2013 21:16:13 +0000 (14:16 -0700)]
Fixes for building under Tru64; from Daniel Richard G.
Bug #624

11 years agolog_{fatal,warning} now logs to the debug file itself.
Todd C. Miller [Sat, 16 Nov 2013 16:21:43 +0000 (09:21 -0700)]
log_{fatal,warning} now logs to the debug file itself.
log_{fatal,warning} now calls warningx2() after setting the
locale itself instead of using the wrapper macros.
This removes the only use of warningx(ngettext(...)).

11 years agoAdd -Wpointer-arith to --enable-warnings
Todd C. Miller [Fri, 15 Nov 2013 22:33:46 +0000 (15:33 -0700)]
Add -Wpointer-arith to --enable-warnings

11 years agoFix more instances of #include directives where the '#' was not in
Todd C. Miller [Fri, 15 Nov 2013 22:16:47 +0000 (15:16 -0700)]
Fix more instances of #include directives where the '#' was not in
column 1.  From Daniel Richard G. (bug #622)

11 years agoAdd support to visudo to export sudoers in JSON format.
Todd C. Miller [Fri, 15 Nov 2013 22:11:55 +0000 (15:11 -0700)]
Add support to visudo to export sudoers in JSON format.

11 years agoRemove unused digest field from struct cmndspec, the digest really
Todd C. Miller [Wed, 13 Nov 2013 23:17:16 +0000 (16:17 -0700)]
Remove unused digest field from struct cmndspec, the digest really
lives in struct sudo_command.

11 years agoRegen with autoconf 2.69
Todd C. Miller [Wed, 13 Nov 2013 22:02:19 +0000 (15:02 -0700)]
Regen with autoconf 2.69

11 years agoRename configure.in -> configure.ac
Todd C. Miller [Wed, 13 Nov 2013 22:00:28 +0000 (15:00 -0700)]
Rename configure.in -> configure.ac

11 years agoFrom Daniel Richard G. (bug #622)
Todd C. Miller [Wed, 13 Nov 2013 21:45:47 +0000 (14:45 -0700)]
From Daniel Richard G. (bug #622)
    Add an autogen.sh script that rebuilds the autoconf world.
    Move old aclocal.m4 contents to m4/sudo.m4.
    New (generayed) aclocal.m4 contains the m4_include directives.
    Some tests had #include directives where the '#' was not in column 1.
    Updated obsolete macro usage via autoupdate.

11 years agoVery old systems (pre XPG 4.2) may not support MSG_WAITALL. The
Todd C. Miller [Tue, 12 Nov 2013 22:14:58 +0000 (15:14 -0700)]
Very old systems (pre XPG 4.2) may not support MSG_WAITALL.  The
likelihood of receiving a partial message is quite low so this is
not a big deal.

11 years agoHP-UX may require _XOPEN_SOURCE_EXTENDED to be defined for MSG_WAITALL
Todd C. Miller [Tue, 12 Nov 2013 22:13:54 +0000 (15:13 -0700)]
HP-UX may require _XOPEN_SOURCE_EXTENDED to be defined for MSG_WAITALL
to be visible.

11 years agoAdd regress test for bug #623
Todd C. Miller [Tue, 12 Nov 2013 16:50:36 +0000 (09:50 -0700)]
Add regress test for bug #623

11 years agoCope with a comment on the last line of the file with no newline.
Todd C. Miller [Tue, 12 Nov 2013 16:36:39 +0000 (09:36 -0700)]
Cope with a comment on the last line of the file with no newline.
Bug #623

11 years agoInclude arpa/inet.h for HP-UX; from Daniel Richard G.
Todd C. Miller [Tue, 12 Nov 2013 15:53:33 +0000 (08:53 -0700)]
Include arpa/inet.h for HP-UX; from Daniel Richard G.

11 years agoAdd missing $(mansrcdir) to visudo.mdoc and visudo.man.
Todd C. Miller [Tue, 12 Nov 2013 15:51:25 +0000 (08:51 -0700)]
Add missing $(mansrcdir) to visudo.mdoc and visudo.man.
From Daniel Richard G.

11 years agoIn v{warning,fatal}x?() make a new copy of ap for the debug functions.
Todd C. Miller [Mon, 11 Nov 2013 23:00:07 +0000 (16:00 -0700)]
In v{warning,fatal}x?() make a new copy of ap for the debug functions.
It is not legal to use ap twice without reinitializing it.
Noticed by Daniel Richard G.

11 years agoRemove errant warning_restore_locale() call.
Todd C. Miller [Mon, 11 Nov 2013 22:24:28 +0000 (15:24 -0700)]
Remove errant warning_restore_locale() call.

11 years agoMove va_copy compat macro to missing.h
Todd C. Miller [Mon, 11 Nov 2013 21:35:10 +0000 (14:35 -0700)]
Move va_copy compat macro to missing.h

11 years agoUniquify header dependencies so we don't end up with duplicates
Todd C. Miller [Mon, 11 Nov 2013 20:53:06 +0000 (13:53 -0700)]
Uniquify header dependencies so we don't end up with duplicates
when a header file includes other headers.  The header dependencies
are sorted so the generated order is stable.

11 years agoAdd getaddrinfo.lo to LTLIBOBJS for systems that need it.
Todd C. Miller [Mon, 11 Nov 2013 19:53:44 +0000 (12:53 -0700)]
Add getaddrinfo.lo to LTLIBOBJS for systems that need it.
From Daniel Richard G.

11 years agoFix pasto
Todd C. Miller [Mon, 11 Nov 2013 19:47:29 +0000 (12:47 -0700)]
Fix pasto

11 years agoFix typo.
Todd C. Miller [Thu, 7 Nov 2013 21:46:28 +0000 (14:46 -0700)]
Fix typo.

11 years agoregen
Todd C. Miller [Mon, 4 Nov 2013 17:30:12 +0000 (10:30 -0700)]
regen

11 years agoFix warnings from -Wold-style-definition
Todd C. Miller [Mon, 4 Nov 2013 13:26:37 +0000 (06:26 -0700)]
Fix warnings from -Wold-style-definition

11 years agoAdd -Wold-style-definition to --enable-warnings
Todd C. Miller [Mon, 4 Nov 2013 13:21:01 +0000 (06:21 -0700)]
Add -Wold-style-definition to --enable-warnings

11 years agoExtra debugging for ready fds.
Todd C. Miller [Mon, 4 Nov 2013 13:06:38 +0000 (06:06 -0700)]
Extra debugging for ready fds.

11 years agoWhen deleting an event, check ev->events to determine whether to
Todd C. Miller [Mon, 4 Nov 2013 13:06:01 +0000 (06:06 -0700)]
When deleting an event, check ev->events to determine whether to
remove from readfds or writefds instead of blinding removing from
both.  Also fix highfd adjustment.

11 years agoOnly check an fd that is >= 0. Timeout-only events may have a
Todd C. Miller [Sat, 2 Nov 2013 16:13:54 +0000 (10:13 -0600)]
Only check an fd that is >= 0.  Timeout-only events may have a
negative fd.

11 years agoDon't call sudo_ev_{add,del}_impl() for timeout-only events. This
Todd C. Miller [Fri, 1 Nov 2013 22:54:49 +0000 (16:54 -0600)]
Don't call sudo_ev_{add,del}_impl() for timeout-only events.  This
makes it possible to pass sudo_ev_alloc() an fd of -1 for events
only use SUDO_EV_TIMEOUT.

11 years agoMake a copy of readfds/writefds before calling select() instead
Todd C. Miller [Thu, 31 Oct 2013 22:13:15 +0000 (16:13 -0600)]
Make a copy of readfds/writefds before calling select() instead
of calculating it each time.  Keep track of high fd in the base.

11 years agoAdd Stephen Gelman
Todd C. Miller [Wed, 30 Oct 2013 21:27:30 +0000 (15:27 -0600)]
Add Stephen Gelman

11 years agoFix sign comparison warning.
Todd C. Miller [Wed, 30 Oct 2013 20:27:50 +0000 (14:27 -0600)]
Fix sign comparison warning.

11 years agoFix potential NULL dereference in non-interactive mode.
Todd C. Miller [Wed, 30 Oct 2013 16:21:02 +0000 (10:21 -0600)]
Fix potential NULL dereference in non-interactive mode.

11 years agoUse MSG_WAITALL when receiving struct command_status over the Unix
Todd C. Miller [Tue, 29 Oct 2013 21:26:32 +0000 (15:26 -0600)]
Use MSG_WAITALL when receiving struct command_status over the Unix
domain socket since we no longer use datagrams.  This should avoid
the need to handle incomplete reads, though in theory it is still
possible.

11 years agoSIGKILL is not catchable
Todd C. Miller [Tue, 29 Oct 2013 20:20:43 +0000 (14:20 -0600)]
SIGKILL is not catchable

11 years agoAdd sudo_ev_get_timeleft() to get the amount of time left before
Todd C. Miller [Tue, 29 Oct 2013 14:16:42 +0000 (08:16 -0600)]
Add sudo_ev_get_timeleft() to get the amount of time left before
an event times out and use it in sudoreplay.

11 years agoIf the user presses <return> or <enter> in sudoreplay, skip to the
Todd C. Miller [Mon, 28 Oct 2013 23:01:23 +0000 (17:01 -0600)]
If the user presses <return> or <enter> in sudoreplay, skip to the
next event.  Useful for skipping past long pauses in the data.

11 years agoFix sudo_ev_scan_impl() return value in event_poll.c.
Todd C. Miller [Mon, 28 Oct 2013 22:40:04 +0000 (16:40 -0600)]
Fix sudo_ev_scan_impl() return value in event_poll.c.
Make sure we clear active flag from unprocessed events if
sudo_ev_loopbreak() or sudo_ev_loopcontinue() are used.
Remove bogus optimization when the timeout is zero or negative; it
could prevent an I/O event from being triggered.

11 years agoMove session replay into its own function.
Todd C. Miller [Mon, 28 Oct 2013 20:44:50 +0000 (14:44 -0600)]
Move session replay into its own function.

11 years agoGet rid of cur and pending pointers in struct sudo_event_base. We
Todd C. Miller [Mon, 28 Oct 2013 17:13:45 +0000 (11:13 -0600)]
Get rid of cur and pending pointers in struct sudo_event_base.  We
now pop the first event off the active queue instead of using a
foreach loop with deferred removal of the event.
Add SUDO_EVQ_INSERTED and SUDO_EVQ_TIMEOUTS flags to indicate that
the event on the event queue and timeouts queue respectively.
No longer need to compare the timeout to {0,0} or compare the
event's base pointer to NULL to determine queue membership.

11 years agorename sudo_ev_loop_impl() -> sudo_ev_scan_impl()
Todd C. Miller [Mon, 28 Oct 2013 16:10:22 +0000 (10:10 -0600)]
rename sudo_ev_loop_impl() -> sudo_ev_scan_impl()

11 years agoAdd support for libevent-style timed events. Adding a timed event
Todd C. Miller [Mon, 28 Oct 2013 16:00:09 +0000 (10:00 -0600)]
Add support for libevent-style timed events.  Adding a timed event
is currently O(n).  The only consumer of timed events is sudoreplay
which only used a singled one so O(n) == O(1) for now.  This also
allows us to remove the nanosleep compat function as we now use a
timeout event instead.

11 years agoNow that sudo_ev_base_free() removes all events before freeing we
Todd C. Miller [Sat, 26 Oct 2013 13:52:59 +0000 (07:52 -0600)]
Now that sudo_ev_base_free() removes all events before freeing we
don't need to do this by hand.