Todd C. Miller
670d8e6d77
Special case comment lines in lbufs.
2018-03-04 07:03:41 -07:00
Todd C. Miller
42fe0409f6
Add sudo_ev_dispatch(), a wrapper for ev_loop() with no flags.
...
Similar the dispatch function in libevent.
2018-02-19 11:00:10 -07:00
Todd C. Miller
a885b952fb
Remove use of AC_HEADER_TIME, only obsolete platforms actually
...
need this. Also stop removing sys/time.h unless the source file
uses struct timeval.
2018-01-17 09:52:15 -07:00
Todd C. Miller
ff5ac3ef0e
Add tsdump, a simple utility to dump a timestamp file. To build,
...
run "make tsdump" in the plugins/sudoers directory (it is not built
by default). In order to map the tty device number to a name,
sudo_ttyname_dev() has been moved into libsudo_util.
2018-01-11 10:49:20 -07:00
Todd C. Miller
d93559e9c0
regen
2017-12-18 09:39:06 -07:00
Todd C. Miller
48fba3c2cc
update my email to Todd.Miller@sudo.ws
2017-12-03 17:53:40 -07:00
Todd C. Miller
dd47a0a416
Add missing initprogname() calls.
2017-11-28 09:06:44 -07:00
Todd C. Miller
2c45774a35
Treat an empty hostname as a failure and return NULL.
2017-10-20 07:37:40 -06:00
Todd C. Miller
fdff345e0f
The read and write sides of signal_pipe[] were swapped, resulting
...
in EBADF reading from and writing to the signal pipe on Linux and
probably others. On systems with bidirectional pipes this was not
an issue.
2017-09-06 12:29:36 -06:00
Todd C. Miller
c3b3e501b9
regen
2017-08-01 15:45:20 -06:00
Todd C. Miller
5a6b8a78f1
Include pathnames.h for /dev/fd on FreeBSD and Mac OS X.
2017-07-27 20:51:21 -06:00
Todd C. Miller
7f8765d327
If we free the default base in sudo_ev_base_free(), reset the default
...
base to NULL.
2017-07-14 10:09:58 -06:00
Todd C. Miller
d2a0bfbb12
Add the ability to set a default event base, to be used by plugins
...
which don't have access to the event base.
2017-07-13 13:59:31 -06:00
Todd C. Miller
6505d05803
Clear input, output, control and local flags before copying them
...
from the source terminal. Otherwise, flags that are disabled
in the source terminal may still be enabled in the destination.
2017-07-12 05:47:28 -06:00
Todd C. Miller
e70a953fb4
Remove pointless subshells in targets that simply change the directory
...
and execute a command. The command is already run in a shell so
there is no need to execute a subshell in this case.
2017-07-12 05:45:46 -06:00
Todd C. Miller
88bf0337e9
Move the bits to fill in the new event base to sudo_ev_base_init(),
...
which is not currently exported.
2017-06-01 09:45:23 -06:00
Todd C. Miller
c000189684
Use getentropy() in mkstemp/mkdtemp replacement.
2017-06-29 18:11:30 -06:00
Todd C. Miller
6d4d4594b7
Use _PATH_DEV consistently
2017-06-29 18:10:53 -06:00
Todd C. Miller
c77c5d026a
When copying terminal settings from one tty to another only copy a
...
subset of the flags. Sudo now copies the same set of flags that
OpenSSH uses, which should be safe.
2017-06-15 12:59:46 -06:00
Todd C. Miller
cc71b99849
Add a new "devsearch" Path setting to sudo.conf for configuring the
...
/dev paths to traverse instead of hard-coding a list in ttyname.c
The default value can be set at configure time.
2017-05-30 10:44:11 -06:00
Todd C. Miller
20a0fa1284
Fix potential memory leak on reallocarray() error. Coverity CID 169639
2017-05-23 13:26:54 -06:00
Todd C. Miller
c91b6777d3
On HP-UX 11.0, sys/ioctl.h is not sufficient to make struct winsize
...
visisble, we need termios.h too.
2017-05-15 09:37:58 -06:00
Todd C. Miller
ea9120ee24
Always used TIOCGWINSZ.
2017-05-15 09:21:00 -06:00
Todd C. Miller
d979898e71
Remove use of non-standard sigaction_t
2017-05-12 10:02:18 -06:00
Todd C. Miller
95e92bfe4e
Activate the sigevents inside the signal pipe callback itself
...
and call signal_pipe_cb() directly if the backend returns EINTR
and the signal_caught flag is set. This has the side effect of
processing signal events in the current pass of the event loop
instead of the next one.
2017-05-12 10:02:17 -06:00
Todd C. Miller
9d4a92b9b4
Handle the possibility of the siginfo parameter in sa_sigaction
...
handler being NULL.
2017-05-12 10:02:17 -06:00
Todd C. Miller
2a55808775
Add support for signal events in sudo's event subsystem
2017-05-12 10:02:17 -06:00
Todd C. Miller
6af6f84670
Fix exponential behavior in glob() with respect to multiple '*'.
...
See https://research.swtch.com/glob
Adapted from https://perl5.git.perl.org/perl.git/commit/33252c318625f3c6c89b816ee88481940e3e6f95
2017-04-28 12:12:00 -06:00
Todd C. Miller
7aa89c49b5
Emulate pipe2() on systems without it.
2017-03-13 12:11:51 -06:00
Todd C. Miller
4b1f0c4176
Remove support for the TIOCGSIZE ioctl. Systems that use this
...
rather than TIOCGWINSZ are too old for sudo to build on anyway.
2017-02-26 16:41:25 -07:00
Todd C. Miller
e5dee1557e
Add NOTBEFORE and NOTAFTER command options similar to what is
...
already available in LDAP.
2017-02-18 15:35:48 -07:00
Todd C. Miller
47b82acd78
fix typo that prevented compilation on FreeBSD
2017-02-14 13:19:45 -07:00
Todd C. Miller
4dad181be3
Link vsyslog.lo directly into vsyslog_test to make sure the syslog()
...
stub gets called. Otherwise, the real syslog will get called via
libutil on AIX.
2017-02-13 20:33:42 -07:00
Todd C. Miller
f59327bc5c
Fix final test with a format > 2048 bytes.
...
Keep track of tests run in the syslog() stub so we can
detect if the stub is not being called.
2017-02-13 20:30:45 -07:00
Todd C. Miller
1a59ab8b74
only run vsyslog_test if it exists
2017-01-15 19:13:26 -07:00
Todd C. Miller
63deb77705
Add regress for vsyslog replacement.
2017-01-15 19:07:59 -07:00
Todd C. Miller
a957a657b0
Double the size of new_fmt[] and remove an extraneous break in the
...
%m handling that was leftover from an earlier edit.
2017-01-13 16:39:31 -07:00
Todd C. Miller
921ad88ab8
Fix typo, want vsnprintf not snprintf.
2017-01-13 16:30:44 -07:00
Todd C. Miller
2f0295373a
When waiting for the parent to grant us the tty, use nanosleep
...
instead of spinning to avoid hogging the CPU.
2017-01-12 10:44:26 -07:00
Todd C. Miller
e8f612ead4
Fix a clang warning on macOS
2016-12-02 09:34:08 -07:00
Todd C. Miller
334350af45
id_t is 64-bits on FreeBSD so use strtoll() there.
...
Fixes the strtoid regress.
2016-11-30 07:32:59 -07:00
Todd C. Miller
6c5936296f
Add SUDO_DEBUG_INSTANCE_ERROR return value for sudo_debug_register()
...
and check for it in places where we check the return value of
sudo_debug_register().
2016-11-21 06:37:23 -10:00
Todd C. Miller
e797fc643f
Plug memory leak when a particular Path is set more than once.
2016-11-16 13:57:50 -07:00
Todd C. Miller
6dff4ac7fd
Always define _PATH_SUDO_NOEXEC, _PATH_SUDO_SESH, _PATH_SUDO_PLUGIN_DIR,
...
even if only defined to NULL. This means the accessors can always be
present.
Use RTLD_PRELOAD_VAR instead of _PATH_SUDO_NOEXEC to tell when
noexec is available.
Add ENABLE_SUDO_PLUGIN_API and use it instead of _PATH_SUDO_PLUGIN_DIR
to tell when the plugin API is available.
Add sudo_conf_clear_paths() to clear the path values so the
regress tests are not affected by compile-time settings.
2016-11-16 10:13:26 -07:00
Todd C. Miller
8cb9f298bd
Get rid of struct sudo_conf_paths and just use #defined index values
...
to access the path values.
Make all accessors available even when the feature is not enabled.
2016-11-15 15:41:41 -07:00
Todd C. Miller
bdbb3e9855
Add ASAN_CFLAGS and ASAN_LDFLAGS and use -Wc prefix in ASAN_LDFLAGS
...
to prevent libtool from strippign them out.
Avoid using ASAN flags when building sudo_noexec.so.
2016-11-15 10:15:36 -07:00
Todd C. Miller
66af45eb24
Add regress for noexec functionality
2016-11-14 14:21:08 -07:00
Todd C. Miller
b5e3a7aef2
Cast len from size_t to uint64_t before bit shifting since we are
...
adding to count which is also uint64_t. Quiets a PVS-Studio warning.
2016-11-11 10:59:42 -07:00
Todd C. Miller
8133cdfdf6
Use sys/stat.h defines instead of bare octal values.
2016-11-07 13:36:05 -07:00
Todd C. Miller
f3c7e0f83b
Update error output to match quoting changes.
2016-11-03 11:16:09 -06:00