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.
Todd C. Miller [Wed, 6 Feb 2019 13:30:00 +0000 (06:30 -0700)]
On RedHat/CentOS get the OS major version from /etc/redhat-release.
We cannot determine this from the output of "pp --probe" since it
doesn't contain a period to separate the major and minor numbers.
Todd C. Miller [Fri, 25 Jan 2019 17:39:57 +0000 (10:39 -0700)]
Use $ac_cv_search_FUNCTION instead of $ac_lib and $ac_res.
Fixes a problem where libcrypt is not used with autoconf caching.
Adapted from a diff from Adam Labbe.
Todd C. Miller [Sun, 20 Jan 2019 14:49:48 +0000 (07:49 -0700)]
Minor snprintf() usage tweaks:
1) don't assume snprintf() returns -1 on error, check for <0
2) when comparing return value of sizeof(foo), cast the sizeof, not the len
3) cast return value to void in cases where snprintf cannot fail
Todd C. Miller [Mon, 7 Jan 2019 16:50:40 +0000 (09:50 -0700)]
Use PAM_SILENT to prevent pam_lastlog from printing last login
information on RedHat except when explicitly running a shell.
Adapted from a patch from Nir Soffer. Bug #867
Todd C. Miller [Mon, 7 Jan 2019 16:38:03 +0000 (09:38 -0700)]
Fix the default nofiles and stack hard limits.
The table of default hard limits in /etc/security/limits was out
of date with respect to the current documentation. The default
hard limit for nofiles should be unlimited, not 8196. The default
hard limit for stack should be 4194304 blocks (which fits in an
unsigned long on 32-bit platforms).