Todd C. Miller [Mon, 11 May 2015 20:51:32 +0000 (14:51 -0600)]
Instead of trying to make weak functions work on all platforms,
just use a registration function for a plugin-specific setlocale
function. The sudoers version just wraps sudoers_setlocale().
Todd C. Miller [Thu, 7 May 2015 16:33:23 +0000 (10:33 -0600)]
Previously, debug_return_bool was the same as debug_return_int
except that it logged true/false for 1/0. However, this appears
to trigger a bug in some compilers. To avoid this, debug_return_bool
now uses bool, not int. Callers that were passing it an int have
been converted to use debug_return_int instead.
Todd C. Miller [Wed, 22 Apr 2015 19:38:02 +0000 (13:38 -0600)]
Don't use dlsym() to find the libc getenv() since this may allocate
memory on some systems (glibc) which leads to a hang if malloc()
calls getenv() (jemalloc).
Todd C. Miller [Thu, 16 Apr 2015 19:19:04 +0000 (13:19 -0600)]
When creating a passwd struct from a uid that is not in the passwd
database, set pw_gid to the user's gid instead of whatever the user
specified via the -g flag (or 0 if no -g).
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.