Todd C. Miller [Mon, 6 Apr 2015 21:08:37 +0000 (15:08 -0600)]
Install /usr/lib/tmpfiles.d/sudo.conf on systems with systemd but
do not package it. For packages we create /usr/lib/tmpfiles.d/sudo.conf
as needed in the postinstall script.
Todd C. Miller [Thu, 5 Mar 2015 19:27:26 +0000 (12:27 -0700)]
Fix symbol name collision with systems that have their own sha2
implementation. This can result in PAM using the wrong sha2
implementation on Solaris systems configured to use SHA512 for
passwords.
Todd C. Miller [Fri, 27 Feb 2015 14:10:20 +0000 (07:10 -0700)]
Define YYDEBUG to 0 if not already defined so we can protect use
of sudoersdebug with "#if YYDEBUG" like the generated parser does.
From David Michael.
Todd C. Miller [Thu, 26 Feb 2015 16:55:01 +0000 (09:55 -0700)]
Only create /usr/lib/tmpfiles.d/sudo.conf if
/usr/lib/tmpfiles.d/systemd.conf also exists. Some other package
may have created /usr/lib/tmpfiles.d even though it is not used.
Todd C. Miller [Tue, 24 Feb 2015 18:19:21 +0000 (11:19 -0700)]
We cannot (easily) use clock_gettime(CLOCK_MONOTONIC) directly as
it may be present but not implemented. Add sudo_gettime_real() and
sudo_gettime_mono() functions to get the real and monotonic times
respectively. Now sudo_gettime_mono() checks the value of
sysconf(_SC_MONOTONIC_CLOCK) before calling clock_gettime(CLOCK_MONOTONIC)
and falls back on sudo_gettime_real() as needed. The Mach version
of sudo_gettime_mono() uses mach_absolute_time().
This should fix problems with timestamp files on systems where
the CLOCK_MONOTONIC is defined but not actually implemented.
Todd C. Miller [Mon, 23 Feb 2015 18:12:45 +0000 (11:12 -0700)]
Pam conversation function changes:
o use PAM_BUF_ERR as the return value when calloc() fails.
o sanity check the value of num_msg
o remove the workaround for old Apple PAM
o PAM_AUTH_ERR is not a valid PAM conversation function return value
If getpass_error is set after a call to pam_verify (usually because
the user pressed ^C), return AUTH_INTR immediately instead of
checking the pam_verify return value.
Todd C. Miller [Mon, 23 Feb 2015 18:12:43 +0000 (11:12 -0700)]
On AIX use the value of auth_type in /etc/security/login.cfg to
determine whether to use LAM or PAM unless the user specified the
--with-pam or --with-aixauth configure flags.
Todd C. Miller [Thu, 19 Feb 2015 21:17:57 +0000 (14:17 -0700)]
Historically, crypt() returned the empty string on error, which
ensured that crypt("", "") would return "", which supported matcing
empty encrypted passwords with no additional code. Some modern
versions of crypt() (such as glibc) return NULL on error so we need
an explicit test to match an empty plaintext password and an empty
encrypted password.
Todd C. Miller [Mon, 16 Feb 2015 03:30:11 +0000 (20:30 -0700)]
Add mail_all_cmnds to always mail when a user runs a command (or
tries to) including sudoedit. The mail_always flag goes back to
its old semantic of always mailing when sudo is run.
Todd C. Miller [Thu, 19 Feb 2015 16:59:25 +0000 (09:59 -0700)]
Almost no systems actually define OPEN_MAX since it is dynamic on
modern OSes. If sysconf(_SC_OPEN_MAX) ever fails, fall back on
_POSIX_OPEN_MAX instead. We can assume modern systems have sysconf().
Also remove checks for strrchr() and strtoll() for which the HAVE_*
defines are no longer used.
Todd C. Miller [Fri, 6 Feb 2015 18:01:05 +0000 (11:01 -0700)]
Sanity check the TZ environment variable by special casing it in
env_check. The --with-tzdir configure option can be used to
specify the zoneinfo directory if configure doesn't find it.
Todd C. Miller [Thu, 5 Feb 2015 18:17:26 +0000 (11:17 -0700)]
Fix a potential crash when getpwnam() of the running user fails
and we don't replace the negative cached entry with a faked up one.
From Stephane Chazelas
Todd C. Miller [Thu, 5 Feb 2015 18:17:24 +0000 (11:17 -0700)]
Handle sudo_get_grlist() returning NULL which can happen if
getgrouplist() fails even after allocating the appropriate amount
of memory. From Stephane Chazelas