Todd C. Miller
0b241088b3
There's no need to conditionalize the #include <unistd.h>, we require
...
a POSIX system.
2015-07-02 09:08:28 -06:00
Todd C. Miller
4a07b472f0
Only include stddef.h where it is needed.
2015-06-20 05:34:35 -06:00
Todd C. Miller
c36415417f
Add function name to "unable to allocate memory" warnings.
2015-06-19 14:51:17 -06:00
Todd C. Miller
dc883f2454
We require ANSI C so stop using the obsolete STDC_HEADERS.
2015-06-19 14:29:27 -06:00
Todd C. Miller
d004b02fc6
Use non-exiting allocatings in the sudoers plugin.
2015-06-17 06:49:59 -06:00
Todd C. Miller
2bf454b74d
Use non-exiting allocators in the redblack tree and fix the fallout.
...
Also switch to non-exiting allocators in affected code blocks.
2015-05-27 09:51:54 -06:00
Todd C. Miller
caf5d45e0f
Previously, debug_return_bool was the same as debug_return_int
...
except that it logged true/false for 1/0. However, this appears
to trigger a bug in some compilers. To avoid this, debug_return_bool
now uses bool, not int. Callers that were passing it an int have
been converted to use debug_return_int instead.
2015-05-07 10:33:23 -06:00
Todd C. Miller
973286c7ac
Check the return value of gettimeofday(), even though it should
...
never fail.
2015-02-25 07:10:25 -07:00
Todd C. Miller
59ab26dbcc
Go back to a 2 args debug_decl and just use the "default" instance,
...
now renamed "active".
2015-02-01 08:24:49 -07:00
Todd C. Miller
9d6e1a57d5
Add sudoers_debug_deregister() and use it instead of calling
...
sudo_debug_deregister() directly.
2014-10-27 16:06:20 -06:00
Todd C. Miller
34d9cfe1cf
Initialize the debug subsystem in sudoers early. Currently this
...
means iterating over the settings list twice.
2014-10-24 12:50:12 -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
935e48c6e4
Don't call into the debug subsystem after we've deregistered the
...
plugin's instance.
2014-10-23 13:42: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
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
af9306cd81
Return -1 from logging functions if we get a write error.
2014-08-26 13:54:29 -06:00
Todd C. Miller
36a5767e3e
efree -> sudo_efree for consistency
2014-07-10 15:35:04 -06:00
Todd C. Miller
a8fa112a53
atobool -> sudo_strtobool
...
atoid-> sudo_strtoid
atomode -> sudo_strtomode
2014-06-27 14:53:54 -06:00
Todd C. Miller
2d61d38c23
Add sudo_ prefix to alloc.c functions and rename alloc.h -> sudo_alloc.h
2014-06-27 10:48:31 -06:00
Todd C. Miller
aecef4aa1d
Rename warning/fatal -> sudo_warn/sudo_fatal to avoid namespace
...
pollution in libsudo_util.so.
2014-06-27 09:30:52 -06:00
Todd C. Miller
f029e3e744
Remove touch() from fileops.c and just call utimes/futimes directly.
...
Rename lock_file -> sudo_lock_file to avoid namespace pollution
2014-06-26 15:51:15 -06:00
Todd C. Miller
2166a6afe1
Remove use of setjmp/longjmp in the sudoers plugin. We no longer
...
call fatal() except in the malloc wrappers and due to libsudo_util
there is now a single copy of fatal/fatalx.
2014-06-26 15:51:15 -06:00
Todd C. Miller
b0f1fa7d05
Rename log_warning flags and only send mail if SLOG_SEND_MAIL is
...
set instead of mailing by default like we used to.
2014-05-02 20:54:01 -06:00
Todd C. Miller
954a3e77b1
Add log_warningx
2014-05-02 16:40:30 -06:00
Todd C. Miller
cbee9cc8cb
Remove now-unused log_fatal()
2014-04-30 17:00:20 -06:00
Todd C. Miller
bd86ced96a
Don't call ferror() on a closed stream, just check the return value
...
of fclose() instead. Found by cppcheck.
2014-04-24 11:12:18 -06:00
Todd C. Miller
9b7dfa7522
Remove calls to log_fatal() in I/O log functions and just pass an
...
error back to the caller.
2014-04-04 15:30:12 -06:00
Todd C. Miller
b813c4de48
Use sudo_timeval macros and remove compat macros from missing.h
2014-01-30 15:51:59 -07:00
Todd C. Miller
12fc51060e
When writing length to timing file, use %u not %d as it is unsigned.
2014-01-08 16:45:06 -07:00
Todd C. Miller
27598bc0ab
Update copyright year.
2014-01-07 10:43:31 -07:00
Todd C. Miller
0e1d726aac
Handle a sequence file with no trailing newline.
2014-01-04 12:42:34 -07:00
Todd C. Miller
391bc02e25
Truncate io log and timing files on open when recycling them.
...
Only an issue when the sequence number wraps around.
2014-01-03 18:28:07 -07:00
Todd C. Miller
6fe419423a
Repair reading of the iolog sequence number that got broken when
...
adding stricter strtoul() checks.
2014-01-03 18:11:27 -07:00
Todd C. Miller
cbf41b8b96
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().
2013-12-11 13:43:10 -07:00
Todd C. Miller
8f9ce7249a
Use strtonum() instead of atoi(), strtol() or strtoul() where possible.
2013-12-10 16:23:21 -07:00
Todd C. Miller
96eb2c4f8f
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().
2013-11-18 08:59:57 -07:00
Todd C. Miller
99b7351de0
Fix some #if vs. #ifdef and remove an extraneous semicolon.
...
Bug #624 ; from Daniel Richard G.
2013-11-17 16:15:36 -07:00
Todd C. Miller
07a804caf3
Quiet sign comparision warnings.
2013-10-23 15:03:31 -06:00
Todd C. Miller
6b57ef4f6d
Fix logic goof when checking open() status.
2013-09-03 11:24:31 -06:00
Todd C. Miller
422115d728
Repair writing of the I/O log file indices broken in sudo 1.8.7.
2013-09-03 09:22:44 -06:00
Todd C. Miller
fe23e7c038
Add endpointer and separator args to atoid()
2013-08-08 06:11:52 -06:00
Todd C. Miller
dde7331a0f
Use atoid() in more places.
2013-08-07 15:49:03 -06:00
Todd C. Miller
8a57f129ac
Eliminate a few relocations related to sudoers_io.
2013-05-20 11:06:13 -04:00
Todd C. Miller
f6e8fb8b1c
Quiet a few -Wunused-result compiler warnings.
2013-05-01 11:02:09 -04:00
Todd C. Miller
368a6558ca
Change some error/errorx -> fatal/fatalx in comments and xgettext
...
flags.
2013-04-26 16:06:05 -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
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
6c737f043f
Zero out struct iolog_details early to avoid a potential (though
...
unlikely) dereference of stack garbage if we hit a fatal error
before iolog_deserialize_info() is called.
2013-04-16 11:06:55 -04:00
Todd C. Miller
fa93dede39
Add back gettimeofday() call inadvertantly removed in e1abb9810a83
2013-02-28 09:25:10 -05:00