Todd C. Miller
e223df6908
Include stddef.h for rsize_t and errno_t on systems that support
...
it natively.
2013-09-29 18:35:34 -06:00
Todd C. Miller
5caa61d687
Use __nonnull__ attribute in __printflike.
2013-08-18 14:18:55 -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
a44d827636
Add __printflike for vfatal, vfatalx, vwarning and vwarningx.
2013-08-15 14:08:40 -06:00
Todd C. Miller
4928c8c72e
Use __printf0like for warning() and fatal() since the fmt string
...
may be NULL.
2013-08-15 12:58:24 -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
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
c2860cce57
Overload -h option to specify an optional hostname for remote access.
...
This is future-proofing; no policy plugins currently support this.
2013-07-16 16:31:05 -06:00
Todd C. Miller
d6282d154a
Update copyright years.
2013-04-24 09:35:02 -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
414fc377c9
Tru64 5.x does declare innetgr() and getdomainname().
2013-04-01 16:39:30 -04:00
Todd C. Miller
f7b62e8dc1
Move SET/CLR/ISSET from config.h.in to missing.h
2013-04-01 15:38:09 -04:00
Todd C. Miller
6083947939
Tru64 Unix doesn't prototype innetgr() or getdomainname().
2013-03-26 13:19:59 -04:00
Todd C. Miller
d710f1b41c
Whitespace fixes
2013-03-26 10:27:06 -04:00
Todd C. Miller
7f32d1ca4c
Make sesh path configurable in sudo.conf
2013-03-14 16:49:42 -04: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
4e5baccb9c
Add __malloc_like macro to apply __malloc__ attribute to emalloc,
...
ecalloc and estrdup. It cannot be applied to realloc since that
may return the same pointer.
2013-03-05 10:18:32 -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
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
855a11af2b
Move signal code into its own source file and add sudo_sigaction()
...
wrapper that has an extra flag to check the saved_signals list to
only install the handler if the signal is not already ignored.
Bump plugin API version for the new front-end signal behavior.
2013-01-17 13:29:46 -05:00
Todd C. Miller
a449e8b3e7
Add howmany() macro since some systems have this in sys/param.h
...
which we no longer include.
2012-12-20 14:46:45 -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
3c9da162e4
Use MAX_HOST_NAME+1 (limits.h) instead of MAXHOSTNAMELEN (sys/param.h
...
or netdb.h).
2012-12-04 10:18:41 -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
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
88c6446daf
Do locale swapping in the warning()/error() macros themselves instead
...
of in the underlying functions.
2012-11-25 09:34:15 -05:00
Todd C. Miller
4bde57b8b2
Rename warning2()/error2() -> warning_nodebug()/error_nodebug().
2012-11-25 09:34:10 -05:00
Todd C. Miller
acf8af9aac
#unifdef HAVE_SETLOCALE, it is C89 so no need to check for it.
2012-11-12 08:51:58 -05:00
Todd C. Miller
c1db4b1546
Always include locale.h from gettext.h so we no longer need to
...
include locale.h from the .c files.
2012-11-11 20:23:53 -05:00
Todd C. Miller
f8660f9988
Add variants of warn/error and sudo_debug_printf that take a va_list
...
instead of a variable number of args.
2012-11-08 15:37:42 -05:00
Todd C. Miller
ab7dda035a
Replace strsigname() with sig2str(), emulating it as needed.
2012-08-29 14:25:09 -04:00
Todd C. Miller
537dc94b9e
Use strsigname() to print signal names in the debug output.
...
If the system has no strsigname(), use our own.
2012-08-26 20:12:51 -04:00
Todd C. Miller
d89b1a6be2
Support for using SSSD ( http://fedorahosted.org/sssd/ ) as a sudoers
...
data source. From Daniel Kopecek and Pavel Brezina.
2012-08-10 11:59:26 -04:00
Todd C. Miller
9497df293a
Don't run regress tests or sudoers sanity check (using the newly-built
...
visudo) when cross compiling. Bug #560
2012-06-20 13:38:17 -04:00
Todd C. Miller
c74d406313
Older versions of Solaris lack ngettext()
2012-06-18 14:29:06 -04:00
Todd C. Miller
2ef0cc73fc
Sudo defines HAVE_SETLOCALE not HAVE_LOCALE_H
2012-06-18 14:03:39 -04:00
Todd C. Miller
5ac272c03e
Fix gcc 2.x variant macro support.
2012-06-18 14:03:11 -04:00
Todd C. Miller
60a3019483
Add support for controlling symbol visibility using the HP and
...
Solaris C compilers.
2012-06-15 14:18:23 -04:00
Todd C. Miller
1fe3f9f40f
The visibility attribute was actually added in gcc 3.3.x, not 4.0.
...
Just assume that if -fvisibility=hidden works that the attribute
is usable.
2012-06-13 16:57:49 -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
c131cb36f5
Make installed file modes consistent with the file modes in the
...
sudo package.
2012-06-11 10:17:19 -04:00
Todd C. Miller
4e0ffceacb
Add offsetof macro for those without it.
2012-05-10 10:01:26 -04:00
Todd C. Miller
c8ce3a0a85
Log the process id in the debug file output. Since we don't want
...
to keep calling getpid(), stash the value at init time and when we
fork().
2012-04-06 15:20:16 -04:00
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