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
Todd C. Miller [Fri, 30 Jan 2015 20:07:21 +0000 (13:07 -0700)]
Avoid setting the tty to non-blocking mode so "sudoreplay | cat"
(for example) works as expected. We only read a single byte from
the keyboard and only when interactive anyway so this should be fine.
Todd C. Miller [Fri, 30 Jan 2015 17:45:15 +0000 (10:45 -0700)]
Avoid a cppcheck warning about undefined behavior (using the address
of a stack buffer - 1) and fix a memory leak of the iov when
doing nl->crnl conversion.
Todd C. Miller [Thu, 29 Jan 2015 21:08:30 +0000 (14:08 -0700)]
Add support for querying netgroups directly via LDAP since there
is no other way to look up all the netgroups for a user (unlike
regular groups). This introduces netgroup_base and netgroup_search_filter
options to ldap.conf. Based on a diff from Steven Soulen.
Todd C. Miller [Wed, 10 Dec 2014 21:00:12 +0000 (14:00 -0700)]
Remove artificial limit on length of pattern and string. It is
possible to use fnmatch() on things other than paths (such as
arguments) so a limit of PATH_MAX does not make sense. Fixes a bug
where rules would fail to match if the length of the arguments were
larger than PATH_MAX (usually 1024).
Todd C. Miller [Tue, 18 Nov 2014 21:05:51 +0000 (14:05 -0700)]
Defer registration of the SIGCHLD handler until just before we exec
the command. Fixes a problem where pam_gnome_keyring installs its
own SIGCHLD handler and may not restore the original one. As a
result, we now have to explicitly wait for the askpass helper to
finish. Bug #657
Todd C. Miller [Thu, 13 Nov 2014 03:33:41 +0000 (20:33 -0700)]
In set_fqdn() we neeed to set user_runhost/user_srunhost at the
same time we set user_host/user_shost since that is what
hostlist_matches() uses. Bug #678
Todd C. Miller [Tue, 11 Nov 2014 22:29:19 +0000 (15:29 -0700)]
No need to keep specifying ".Nm foo" since the Nm macro remembers
the argument it was first called with and uses it if none is
specified. Also fix a few minor formatting errors and
regen bulleted lists in the .man.in files.