Commit Graph

10433 Commits

Author SHA1 Message Date
Todd C. Miller
e6d6e9ba05 Bugs #860 and #917 were fixed in 1.9.0. 2020-06-19 06:17:39 -06:00
Todd C. Miller
65edf6344d regen to fix a typo 2020-06-18 15:23:30 -06:00
Todd C. Miller
d4739533fd Add regress test to catch swapids() bug when called by iolog_mkdtemp() 2020-06-18 15:14:00 -06:00
Todd C. Miller
88393fc96f Updated translations from translationproject.org 2020-06-18 07:13:05 -06:00
Todd C. Miller
ce76c9fe8a Document the order in which the plugin open/close functions are called. 2020-06-16 16:20:25 -06:00
Todd C. Miller
bc6e36e940 Fix a typo that prevented swapids() from restoring the original gid.
This led to a regression when the iolog_file setting ends in six or
more X's or when the I/O logs are stored on NFS.
2020-06-16 05:44:57 -06:00
Todd C. Miller
8bb5aedacf Replace master/slave in code with leader/follower. 2020-06-15 16:21:32 -06:00
Todd C. Miller
f093cb2e52 Replace terms master and blacklist in docs and examples. 2020-06-15 14:38:46 -06:00
Todd C. Miller
4a3aff156f Bug #929 2020-06-15 08:06:43 -06:00
Todd C. Miller
bee9950593 Clean up temporary sudoedit files on success; Bug #929
This is a regression introduced in sudo 1.9.0.
2020-06-14 16:40:21 -06:00
Todd C. Miller
ddd3b0eced New Romanian translation 2020-06-12 09:58:22 -06:00
Todd C. Miller
47b2df64cf Add missing entry for the LDAP/SSSD sudoHost regression.
Also add new Romanian translation
2020-06-11 14:57:10 -06:00
Todd C. Miller
7f96e4537c Updated translations from translationproject.org 2020-06-11 15:19:31 -06:00
Todd C. Miller
d003da33dd Romanian translation from translationproject.org. 2020-06-11 15:15:58 -06:00
Todd C. Miller
852d8c7953 Fix a typo in the audit string when "sudo -E" is not allowed. 2020-06-07 08:37:32 -06:00
Todd C. Miller
3e12b99eed Check asprintf() return value. 2020-06-06 19:13:21 -06:00
Todd C. Miller
a339945848 Prefer the python3 in /usr/bin on Solaris.
The /opt/csw version, if it exists, may be a 32-bit version which
we can't link with.  Also handle the case where the /usr/bin/python3
link is missing.
2020-06-06 18:45:28 -06:00
Todd C. Miller
48c2bd0007 Declare getdelim(3) if it exists in libc but is not prototyped in stdio.h.
This can happen on systems with a gcc packages that was built on
and older versions of the OS where getdelim(3) was not present.
2020-06-06 18:45:27 -06:00
Todd C. Miller
17b3f90f74 For python3-config, only use -I and -L/-l from --cflags and --ldflags output.
Otherwise we may get other flags used to build python that conflict
with what sudo uses.
2020-06-06 16:32:10 -06:00
Todd C. Miller
6c881477b6 Build 64-bit binaries and the python package on Solaris 11 and above.
No longer prefer the Solaris Studio C compiler over gcc, it causes
issues with the Python plugin.
2020-06-06 16:07:33 -06:00
Todd C. Miller
8da1f31954 Fix memory leak on error in fmt_info_messages(). 2020-06-06 14:08:34 -06:00
Todd C. Miller
3f4de69497 Update for 1.9.1b1 2020-06-06 07:22:00 -06:00
Todd C. Miller
d4e92164f5 regen for sudo 1.9.1 2020-06-05 10:26:31 -06:00
Todd C. Miller
f047377a07 Add basic support for reject and error audit events to sudoers.
This is only used when logging events from plugins other than sudoers,
such as an approval plugin.  With this change, if an approval
plugin rejects the command the denial will be logged in the
sudoers log file using the message from the approval plugin.
2020-06-04 14:41:35 -06:00
Todd C. Miller
15d93a1ca7 Fix Solaris and BSM audit warnings.
Use BSM audit on Illumos, which lacks Solaris audit.
2020-06-04 14:41:28 -06:00
Todd C. Miller
a5a7215936 Track whether the session was opened in sudoers.
In sudoers_policy_close() only warn about being unable to run the
command if we actually opened the session (and thus passed all
approval plugins).
2020-06-04 13:34:20 -06:00
Todd C. Miller
1198dfc930 Only display an error in the built-in policy close if command is set.
If a policy or approval plugin denies the command, command_details
will not have been filled out.
2020-06-04 13:31:03 -06:00
Todd C. Miller
49e43f580c Avoid passing NULL to printf in match debug code for LDAP/SSSD.
The file name in struct userspec was not set for the LDAP and SSSD
backends.  There is no actual file in this case so set the name to
LDAP/SSSD.  Also add a guard to make sure we don't try to print
NULL in sudoers_lookup_check() if name is left unset.
2020-06-04 11:31:12 -06:00
Todd C. Miller
b40551dc32 Add missing const to linux_audit_command()'s argv function argument. 2020-06-03 20:22:25 -06:00
Todd C. Miller
73c1b04306 When converting LDAP to sudoers, ignore entries with no sudoHost attribute.
Otherwise, sudo_ldap_role_to_priv() will treat a NULL host list as
as the "ALL" wildcard.  This regression was introduced in sudo 1.8.23,
which was the first version to convert LDAP sudoRole objects to
sudoers internal data structures.
Thanks to Andreas Mueller for reporting and debugging this problem.
2020-06-03 20:12:04 -06:00
Todd C. Miller
253e041d3b Load the sudoers module as an audit plugin if loaded as a policy plugin.
Now that logging of successful commands is performed by sudoers as an
audit plugin we need to load sudoers_audit if sudoers_policy is also
loaded.  Otherwise, accpted commands will not be logged.
2020-06-02 14:54:04 -06:00
Todd C. Miller
b519481912 Defer logging of the successful command until approval plugins have run.
This adds audit plugin support to the sudoers module, currently
only used for accept events.  As a result, the sudoers file is now
initially parsed as an audit plugin.
2020-06-02 09:07:46 -06:00
Todd C. Miller
f0dc48548c Add support for "accept" audit events sent by the sudo front-end.
With this change, the sudo front-end will send an "accept" audit
event to the audit plugins after all the I/O logging plugins have
been initialized.  This can be used by an audit plugin that does
not care about the result of the individual policy and approval
plugins and only wants to receive a single "accept" event if all
policy and approval plugins have succeeded.  The plugin_type argument
for events sent by the front-end is SUDO_FRONT_END (0).
2020-06-02 09:07:44 -06:00
Todd C. Miller
a380709215 If event loop fails due to ENXIO, remove /dev/tty events and recover.
This fixes an issue on Solaris 11.4 (and probably others) with "sudo
reboot" when I/O logging is enabled.  Previously, sudo would kill
the command if it was still running after the event loop terminated,
leaving the system in a half-dead state.
2020-06-02 08:59:38 -06:00
Todd C. Miller
592eb7ab49 Don't try to suspend sudo if the user's tty has gone away.
Fixes a problem on Solaris 11.4 (and possibly others) where sudo
continually tries to put itself in the background after the user's
terminal has been revoked.
2020-06-01 14:19:50 -06:00
Todd C. Miller
de31e6d53b Back out WIP code that was mistakenly committed. 2020-06-01 14:04:15 -06:00
Todd C. Miller
a0aaae5541 Don't enable BSM audit on Solaris 10, it is missing AUE_sudo 2020-06-01 13:56:47 -06:00
Todd C. Miller
ad70fb4f1e On Solaris 11.4 the openpty(3) prototype lives in termios.h. 2020-06-01 12:59:29 -06:00
Todd C. Miller
51dc8ad83c Add missing stdlib.h include and fix solaris_audit_failure() error return. 2020-06-01 12:52:00 -06:00
Todd C. Miller
e1aa76de16 Use Solaris audit for Solaris 11, not BSM audit.
BSM audit is no longer supported in Solaris 11.4.
2020-06-01 12:47:38 -06:00
Todd C. Miller
2dd1e1907d Check audit plugins for a close function too before execing command directly.
We cannot exec the command directly if any of the policy or audit
plugins use a close function.
2020-05-26 11:36:17 -06:00
Todd C. Miller
d9cbb7bebd Mention Bug #927. 2020-05-22 15:35:30 -06:00
Todd C. Miller
026caf0081 Add basic support for --runstatedir
If the user specifies --runstatedir but not --with-rundir, use
runstatdir as the parent directory of the sudo rundir.

In the future we may deprecate --with-rundir in favor of --runstatedir
but that will require changes for systems with no /var/run directory.
2020-05-20 18:51:52 -06:00
Todd C. Miller
741c6f274e Add support for @include and @includedir
These are less confusing than #include and #includedir when the
hash character is also the comment character.

This commit also adds real parsing of include directives as opposed
to the pure lexer approach used previously.  As a result, it is now
possible to include files with spaces by either using a double-quoted
string or escaping the space characters with a backslash.
2020-05-20 13:10:53 -06:00
Todd C. Miller
c63ba01e0e In iolog_openat() enable the write bit on pre-existing files if needed.
This prevents problems caused by the change to strip the write bit
from the timing file when it is finished.
2020-05-19 13:14:31 -06:00
Todd C. Miller
7febc39137 In visudo check that an include file is regular file before using it.
Avoids a generic "input in flex scanner failed" error message.
2020-05-19 10:09:56 -06:00
Todd C. Miller
a41d7b545a Fix a memory leak on error when including a file or directory. 2020-05-19 10:09:34 -06:00
Todd C. Miller
5a69831dd4 Sudo 1.9.1 2020-05-18 18:50:50 -06:00
Todd C. Miller
452be1a4c5 Add a follow option (-F) to support replaying a live session.
By default, sudoreplay will exit when it reaches the end of the
timing file.  With the -F option, it will keep going until the
timing file is finished and its write bit is cleared.
2020-05-18 14:27:47 -06:00
Todd C. Miller
0312292e99 Add iolog_clearerr() that acts like clearerr(3).
Works for both compressed and uncompressed I/O logs.
2020-05-18 14:16:47 -06:00