Todd C. Miller
0123cf63f1
The Path setting for the plugin directory is "plugin_dir" not "plugin".
2015-12-18 14:03:59 -07:00
Todd C. Miller
55531958de
Allow sudo.conf Path settings to disable path names (by setting the
...
value of NULL).
2015-12-18 12:31:28 -07:00
Todd C. Miller
8b12390abf
Add debug_return_ssize_t
2015-11-01 15:13:28 -07:00
Todd C. Miller
a2979ed809
Remove checks for __sys_siglist and __sys_signame. They are internal
...
to libc and there are no known systems that export those symbols
that do not already export the single underbar or no-underbar versions.
2015-09-10 16:44:57 -06:00
Todd C. Miller
67183d74f4
Remove include/compat/timespec.h. Systems old enough to lack struct
...
timespec are too old to build a modern sudo.
2015-09-09 11:13:22 -06:00
Todd C. Miller
448b18de2b
Set errno to EINVAL if sudo_lock_* is called with a bad type.
2015-09-07 06:06:08 -06:00
Todd C. Miller
0c70df5de9
Implement suspend/resume callbacks for the conversation function.
...
If suspended, close the timestamp file (dropping all locks). On
resume, lock the record before reading the password.
For this to work properly we need to be able to run th callback
when tsetattr() suspends us, not just when the user does. To
accomplish this the term_* functions now return EINTR if SIGTTOU
would be generated. The caller now has to restart the term_*
function (and send itself SIGTTOU) instead of it being done
automatically.
2015-09-07 06:06:08 -06:00
Todd C. Miller
00142c91fa
Lock individual records in the timestamp file instead of the entire
...
file. This will make it possible for multiple sudo processes using
the same tty to serialize their timestamp lookups.
2015-09-07 06:06:08 -06:00
Todd C. Miller
98a15d9879
Add a struct sudo_conv_callback that contains on_suspend and on_resume
...
function pointer args plus a closure pointer and at it to the
conversation function.
2015-09-07 06:06:08 -06:00
Todd C. Miller
1965da8c33
Avoid a potential out of bounds read found by enh while fuzzing
...
with address sanitizer enabled.
2015-07-31 16:10:03 -06:00
Todd C. Miller
e941f97eb4
Replace two "return 0" with debug_return_bool(false).
2015-07-22 19:11:32 -06:00
Todd C. Miller
d4211081c0
Add some debugging printfs when malloc fails and we don't have an
...
explicit call to sudo_warnx().
2015-07-14 15:28:01 -06:00
Todd C. Miller
3c644f5bc0
Return -1 if realloc() fails.
2015-07-14 14:48:04 -06:00
Todd C. Miller
f2f5c2949c
Add line number to debug log for memory allocation errors.
2015-07-14 14:47:12 -06:00
Todd C. Miller
43a57126ea
Solaris 2.6 has the prototypes for inet_pton() and inet_ntop() in
...
resolv.h.
2015-07-09 10:11:25 -06:00
Todd C. Miller
445e6f2e9a
Check sudo_conf_read() return value and exit on fatal error (a
...
warning was already printed by sudo_conf_read()).
2015-07-07 13:17:50 -06:00
Todd C. Miller
d77941c2be
We require POSIX so no need to conditionally include dirent.h.
...
Add a check for d_namlen and use the result in the NAMLEN macro.
2015-07-02 09:24:48 -06:00
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
5e695d4cd9
Add missing exit value.
2015-06-30 12:19:24 -06:00
Todd C. Miller
662f9ec562
Add missing fcntl.h include.
2015-06-30 12:19:17 -06:00
Todd C. Miller
105f199f6b
Fix build on compilers w/o __func__ or __FUNCTION__
2015-06-30 10:41:14 -06:00
Todd C. Miller
44f7ed3b11
Remove sudo_evasprintf_v1, missed during alloc.c removal.
2015-06-30 10:37:06 -06:00
Todd C. Miller
b756b6a112
Add missing fcntl.h include.
2015-06-30 10:32:42 -06:00
Todd C. Miller
54f9de6cce
Add an error flag to the lbuf struct to simplify error checking.
...
Callers of the lbuf functions now check the error flag to tell if
a memory allocation error ocurred.
2015-06-26 15:58:04 -06:00
Todd C. Miller
d36e46cb6e
Must call round_nfds() with fd+1 since it takes a count not the fd
...
number. In other words, the lowest value is 1, not 0.
2015-06-23 13:49:56 -06:00
Todd C. Miller
d7224ea502
It's safe to rely on C89 semantics for realloc(NULL, size).
2015-06-20 19:27:31 -06:00
Todd C. Miller
4da6468d5a
Remove symbols from the now-removed alloc.c.
2015-06-20 16:56:42 -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
d8dd6512ce
Better handling of setlocale() returning NULL.
2015-06-19 16:49:02 -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
e2328479dd
Use strtok_r() instead of strtok()
2015-06-19 12:35:51 -06:00
Todd C. Miller
4f9cabd005
Remove obsolete memory.h include.
2015-06-18 21:02:57 -06:00
Todd C. Miller
a50555faa2
Remove support for the obsolete malloc.h header.
2015-06-18 20:30:59 -06:00
Todd C. Miller
86fb8e15a8
Use sudo_strsplit() instead of doing the equivalent manually.
2015-06-18 16:14:49 -06:00
Todd C. Miller
db3012645e
Test strsplit behavior with an empty string.
2015-06-18 16:14:20 -06:00
Todd C. Miller
ea744042ed
Allow "make LIBTOOL=/path/to/libtool" to work properly.
2015-06-18 13:06:15 -06:00
Todd C. Miller
a38253b101
Replace use of OSDEFS with config.h defines.
...
Rename DEFS in Makefile.in to CPPDEFS and include in CPPFLAGS.
Bring back _BSD_SOURCE as a config.h define.
Remove obsolescent _REENTRANT define.
2015-06-18 09:33:05 -06:00
Todd C. Miller
4be97a6c4e
Remove now-unused sudo_alloc.h and alloc.c
2015-06-17 17:00:55 -06:00
Todd C. Miller
5ce50a885c
Use non-exiting allocators in libsudo_util.
2015-06-17 17:00:53 -06:00
Todd C. Miller
2c63f1b5b2
regen dependencies
2015-06-16 13:17:46 -06:00
Todd C. Miller
23d72149b0
Add missing dependency info for reallocarray.lo in lib/util/Makefile.in
...
and regen configure to match last configure.ac change.
2015-06-15 13:45:12 -06:00
Todd C. Miller
f43f530987
Move pattern length check until after we have initialized the glob_t
...
so we can call globfree() even on error. From Frank Denis.
2015-06-13 08:13:48 -06:00
Todd C. Miller
c0fa0e248d
Add debugging output on memory alloc failure.
...
Add missing checks in event_select.c for reallocarray() failure.
2015-06-05 13:18:48 -06:00
Todd C. Miller
564eb7e7dd
Use non-exiting allocators.
2015-06-05 13:17:56 -06:00
Todd C. Miller
9884df8c9e
If asprintf() or vasprintf() fail, set the dest pointer to NULL
...
like BSD and Solaris do. This appears to be the direction glibc
is going as well.
2015-06-03 11:07:56 -06:00
Todd C. Miller
1100d91e8f
Fix typo/thinko in static buffer conversion; use vsnprintf() not snprintf()
2015-05-27 16:41:46 -06:00
Todd C. Miller
6b7be032af
Use non-existing allocators in the passwd/group cache functions.
2015-05-27 10:26:49 -06:00
Todd C. Miller
40d72f26e4
Add standalone reallocarray.c from OpenBSD instead of rolling our own.
2015-05-27 10:04:32 -06:00
Todd C. Miller
8c3fd195d2
Add unit tests for strsplit and parse_gid_list.
2015-05-26 20:25:08 -06:00