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
Todd C. Miller
b9159ecb26
Add maxseq sudoers option to limit the max number of I/O log files.
2013-02-18 15:06:23 -05:00
Todd C. Miller
618871a331
Log lines and columns in the iolog file.
2013-02-16 11:12:48 -05:00
Todd C. Miller
f2beaaa89f
Add __dso_public to extern declaration of declaration to match
...
actual definition.
2013-01-24 09:01:03 -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
727be29893
Saner loop invariant in io_mkdirs (cosmetic only).
2012-11-25 09:46: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
5496ffe1e8
Add plugin_setjmp() wrapper for siglongjmp(error_jmp, 1) so we don't
...
need error_jmp to be extern. Also add plugin_clearjmp() that clears
a flag so error()/errorx() knows when to call exit() vs. longjmp().
2012-11-25 09:34:26 -05:00
Todd C. Miller
3e5bd8dc52
Include setjmp.h in sudoers.h
...
Move error_jmp into plugin_error.c
Rename sudoers_plugin_cleanup sudoers_cleanup
Make sudoers warning/error functions work when sudo_conv is NULL
2012-11-25 09:33:33 -05:00
Todd C. Miller
edf0881823
Rename mkdir_parents() io_mkdirs() and add a flag to specify whether
...
path is a temporary, in which case the final component is created
via mkdtemp() instead of mkdir().
2012-11-12 17:04:24 -05:00
Todd C. Miller
56de023de8
Avoid strerror() when possible and just rely on warning/error
...
to handle errno in the proper locale.
2012-11-09 16:32:29 -05:00
Todd C. Miller
a0c53bd751
Call gettext inside log_error et al instead of having the caller do it. This way we can display any messages to the user in their own locale but log in the sudoers local.
2012-11-08 15:37:44 -05:00
Todd C. Miller
3651377e12
Refactor command_info setting into its own function.
2012-10-25 13:16:58 -04:00
Todd C. Miller
3ba8da4ab6
Cast 2nd argument of lseek() to off_t if it is a constant for systems
...
with 64-bit off_t but without a proper lseek() prototype.
2012-08-07 14:42:08 -04:00
Todd C. Miller
203abd98b9
Use the expanded io log dir when updating the sequence number.
...
Includes a workaround for older versions of sudo where the
sequence number was stored in the unexpanded io log dir.
2012-06-15 12:33:12 -04:00
Todd C. Miller
649edc3192
Export group cache from sudoers.so for system_group.so to use.
2012-06-13 16:21:45 -04:00
Todd C. Miller
6f6b0dec6c
Use gcc's visibility attribute to specify when symbols are visible
...
or hidden, if available. If not available, use an ELF version
script if it is supported. If all else fails, fall back to using
libtool's -export-symbols.
2012-06-13 14:01:16 -04:00
Todd C. Miller
f3ab15b117
typo fix in comment
2012-04-19 11:49:18 -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
e3e2397cba
Quiet a compiler warning on some platforms.
2012-03-28 13:17:11 -04:00
Todd C. Miller
44ce5720de
Remove the NO_EXIT flag to log_error() and add a log_fatal() function
...
that exits and is marked no_return. Fixes false positives from
static analyzers and is easier for humans to read too.
2012-03-26 10:59:14 -04:00
Todd C. Miller
a16dee915b
Add support for plugin args at the end of a Plugin line in sudo.conf.
...
Bump the minor number accordingly and update the documentation. A
plugin must check the sudo front end's version before using the
plugin_args parameter since it is only supported for API version
1.2 and higher.
2012-03-02 11:04:09 -05:00
Todd C. Miller
3da971ba33
Better debug subsystem usage
2012-02-02 11:28:33 -05:00
Todd C. Miller
373043b4db
Initialize the debug framework from the I/O plugin too.
2012-01-09 11:00:59 -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
839919566e
Add debug_decl/debug_return (almost) everywhere.
...
Remove old sudo_debug() and convert users to sudo_debug_printf().
2011-10-22 14:40:21 -04:00
Todd C. Miller
8513c48185
Add missing space between command name and the first command line argument.
2011-05-27 14:07:23 -04:00
Todd C. Miller
bf7e7b5752
Add gettext.h convenience header. This is similar to but distinct from
...
the one included with the gettext package.
2011-05-20 11:48:17 -04:00
Todd C. Miller
7960bde2db
Minor warning/error message cleanup
2011-05-18 13:04:24 -04:00
Todd C. Miller
fce0b906eb
cannot -> "unable to" in warning/error messages
2011-05-18 12:41:06 -04:00
Todd C. Miller
c3a259f5ee
Add calls to bindtextdomain() and textdomain()
...
Currently there are two domains, one for the sudo front-end and
one for the sudoers plugin and its associated utilities.
2011-05-17 16:38:40 -04:00
Todd C. Miller
b643b190a7
Prepare sudoers module messages for translation.
2011-05-16 16:32:05 -04:00
Todd C. Miller
383aef00b1
Log the TSID even if it is not a simple session ID.
2011-03-11 12:11:05 -05:00
Todd C. Miller
af2ac7ccc6
Use a char array to map a number to a base36 digit.
2011-02-01 14:54:08 -05:00
Todd C. Miller
ae2f7638f5
standardize on "return foo;" rather than "return(foo);" or "return (foo);"
2011-01-24 15:15:18 -05:00
Todd C. Miller
f7f8b6867e
Update copyright year to 2011
2011-01-20 16:46:56 -05:00
Todd C. Miller
755e3ef0ab
mkdir_iopath() returns size_t now that it uses strlcpy() and not snprintf()
2010-12-30 18:08:09 -05:00
Todd C. Miller
7f580397e2
Trim leading slashes from iolog_file and trailing slashes from iolog_dir
2010-12-30 18:05:53 -05:00
Todd C. Miller
25036d7a75
Pass a single I/O log file name in command_details instead of
...
separate dir + file parameters.
2010-12-30 17:09:01 -05:00