Todd C. Miller [Tue, 20 Aug 2019 16:33:51 +0000 (10:33 -0600)]
Add user ID to the search filter when matching sudoUser.
We already support group IDs but the user ID was missing.
From sudo-1.8.23-ldapsearchuidfix.patch in RHEL 7.
Todd C. Miller [Mon, 5 Aug 2019 22:30:58 +0000 (16:30 -0600)]
Store signal name, not number in I/O log timing file.
The "SIG" prefix is not used so, e.g. SIGTERM -> "TERM".
This makes the I/O log files portable from one system to another.
Older I/O log files with signal numbers can still be replayed.
Todd C. Miller [Fri, 19 Jul 2019 19:51:23 +0000 (13:51 -0600)]
If the command in sudoers does not exist on the file system, match by name.
We still want to match the command even if it doesn't exist so that the
NOPASSWD flag on sudoers entries with non-existant paths works as expected.
Bug #888.
Todd C. Miller [Mon, 15 Jul 2019 00:51:50 +0000 (18:51 -0600)]
If we are unable to stat() sudoers as non-root, try again as root.
By default, sudo relies soley on group permissions to read sudoers
to make it possible to store sudoers on NFS. However, if /etc/sudoers
is not accessible to non-root uids for some reason, sudo will fail.
Bug #880.
Todd C. Miller [Wed, 3 Jul 2019 19:13:04 +0000 (13:13 -0600)]
Use $libexecdir in default settings used by the documentation.
The web and pdf pages will substitute /usr/local/libexec for $noexec_file.
Also do substitution of variables using exec_prefix even if we don't use
them in the Makefile since the documentation may reference them.
Todd C. Miller [Wed, 3 Jul 2019 13:39:54 +0000 (07:39 -0600)]
Update plugindir even when --disable-shared is specified.
Otherwise, the default value is substituted into the Makefiles and
documentation which may not match --prefix. Bug #886
Todd C. Miller [Tue, 25 Jun 2019 15:45:10 +0000 (09:45 -0600)]
Add ssizeof macro that returns ssize_t.
We can use this instead of casting the result of size_t to int.
Also change checks for snprintf() returning <=0 to <0.
Todd C. Miller [Fri, 21 Jun 2019 03:49:11 +0000 (21:49 -0600)]
Remove the Solaris last login question, add one about HOME.
The PAM session is opened with PAM_SILENT so last login info is not printed.
It is dangerous to preserve HOME from the user's environment.
Todd C. Miller [Thu, 20 Jun 2019 22:32:18 +0000 (16:32 -0600)]
Document why HOME should not be preserved from the user's environment.
Text was adapted from what is already present in the UPGRADE file.
Also mark set_home and always_set_home as obsolete.
Todd C. Miller [Thu, 20 Jun 2019 19:15:46 +0000 (13:15 -0600)]
Remove .cat pages, there is no need for them in the modern world.
Sudo only shipped .cat pages for Irix, which lacked nroff.
Irix is long dead and there are multiple open source nroff options.
Todd C. Miller [Thu, 20 Jun 2019 17:40:47 +0000 (11:40 -0600)]
Don't describe env_editor as a security hole.
Users that are able to edit sudoers can grant themselves permissions
so the fact that visudo runs the editor as root is not a security issue.
Todd C. Miller [Thu, 20 Jun 2019 17:05:15 +0000 (11:05 -0600)]
Fix details of how EDITOR, VISUAL and SUDO_EDITOR are (or are not) preserved.
The description in the editor option was incorrect and didn't mention env_keep.
Reported by Sander Bos
Todd C. Miller [Thu, 20 Jun 2019 16:11:26 +0000 (10:11 -0600)]
Modern visudo locks the actual sudoers file, not the sudoers.tmp file.
Refer to sudoers.tmp as a temporary file, not a lock file.
Reported by Sander Bos
Todd C. Miller [Thu, 20 Jun 2019 02:32:22 +0000 (20:32 -0600)]
In tty_present(), check for /dev/tty if sudo was unable to get the tty name.
For requiretty it is enough to check that /dev/tty is available.
If sudo can't get the tty from the kernel (missing /proc?) that is OK.
Todd C. Miller [Thu, 20 Jun 2019 02:29:08 +0000 (20:29 -0600)]
Don't refuse to use the tty unless /dev/tty is unavailable.
We don't care whether sudo was able to get the tty name from the kernel.
All that really matters is whether we are able to disable echo as needed.
Todd C. Miller [Wed, 19 Jun 2019 20:29:25 +0000 (14:29 -0600)]
Better description of secure_path.
The secure_path option affects the resolution of unqualified commands
as well as the environment that commands run with.
Todd C. Miller [Wed, 19 Jun 2019 20:02:16 +0000 (14:02 -0600)]
Fix a few typos and awkward wording.
Use the singular "they" instead of he/she.
Add back missing text in description of variables starting with ().
Based on changes from Sander Bos.
Todd C. Miller [Wed, 29 May 2019 21:26:57 +0000 (15:26 -0600)]
Use the runhost for "User foo is not allowed to run sudo on bar."
Otherwise, if the -h option is specified sudo will print the local
host name instead of the host specified via -h.
Todd C. Miller [Sun, 26 May 2019 22:29:08 +0000 (16:29 -0600)]
When using AIX auth, don't display the AIX password incorrect message.
Avoids a "3004-300 You entered an invalid login name or password"
message in addition to sudo's own "Sorry, try again" message.
Todd C. Miller [Sun, 28 Apr 2019 13:26:45 +0000 (07:26 -0600)]
Filter out last login messages on HP-UX unless running a shell.
HP-UX in trusted mode will display last login messages as part of
the PAM account management module by libpam_comsec. There is no
way to suppress these messages from the PAM configuration in trusted
mode so we need to filter them in the conversation function. In
regular mode, similar (but different) messages may be produced by
libpam_hpsec.
Todd C. Miller [Sat, 20 Apr 2019 23:28:45 +0000 (17:28 -0600)]
Keep debug fds open in send_mail() to aid in debugging.
Adds closefrom_nodebug() which acts like closefrom(3) but doesn't
close debug fds for use by send_mail().
Also moves the code to exec the mailer to its own function.
Todd C. Miller [Mon, 8 Apr 2019 14:50:03 +0000 (08:50 -0600)]
Restrict the PAM_TTY kludge to Solaris and Linux-PAM.
Setting PAM_TTY to the empty string causes problems with some modules
on HP-UX so restrict it to systems where it is fixes known issues.
Todd C. Miller [Thu, 7 Mar 2019 03:13:40 +0000 (20:13 -0700)]
Ignore EOVERFLOW from pstat_getproc(), it is not a fatal error.
It just means that one of the fields in pstat lacks the precision to
store a value. That's not an issue for pst_highestfd.