Todd C. Miller [Tue, 16 Jul 2013 20:04:23 +0000 (14:04 -0600)]
Do not error out if arg to -U option cannot be resolved, that is for
the plugin to decide.
There is no need for runas_user and runas_group to be global, make
them local to parse_args() instead.
Todd C. Miller [Thu, 11 Jul 2013 21:57:40 +0000 (17:57 -0400)]
Remove old bits about sudo setuid problems that should have been
cleaned up in changeset 7917:fa4894896d8a. Also update the mode
of sudo to 04755 to match current packaging.
Todd C. Miller [Thu, 11 Jul 2013 21:50:03 +0000 (17:50 -0400)]
Go back to ignoring the return value of pam_setcred() since with
stacked PAM auth modules a failure from one module may override
PAM_SUCCESS from another. If the first module in the stack fails,
the others may be run (and succeed) but an error will be returned.
This can cause a spurious warning on systems with non-local users
(e.g. pam_ldap or pam_sss) where pam_unix is consulted first.
Todd C. Miller [Tue, 28 May 2013 18:40:45 +0000 (14:40 -0400)]
Restrict default creation of PIE binaries (-fPIE and -pie) to Linux.
OpenBSD also supports PIE but enables it by default so we don't
need to do anything. This fixes problems on systems with a version
of GNU ld that accepts -pie but where the run-time linker doesn't
actually support PIE. Also verify that a trivial PIE binary works
unless PIE is explicitly enabled.
Todd C. Miller [Fri, 24 May 2013 20:47:16 +0000 (16:47 -0400)]
Attempt to detect PIE failure on Solaris 10 with GNU as and GNU ld
where we can end up crashing due to malloc() failures. Sems OK
when Using Sun as and ld.
Todd C. Miller [Wed, 22 May 2013 15:32:08 +0000 (11:32 -0400)]
Replace sequence number-based cycle detection in visudo with a
"used" flag in struct alias. The caller is required to call
alias_put() when it is done with the alias. Inspired by a patch
from Daniel Kopecek.
Todd C. Miller [Fri, 3 May 2013 20:14:12 +0000 (16:14 -0400)]
No longer store the ctime of a devpts tty. The handling of ctime
on devpts in Linux has been changed to conform to POSIX. As a
result we can no longer assume that the ctime will stay unchanged
throughout the life of the session. We store the session ID in the
time stamp file so there is a much smaller chance of the time stamp
file being reused by a new login. While here, store the uid/gid
in the timestamp file too for good measure.
Todd C. Miller [Thu, 25 Apr 2013 14:12:42 +0000 (10:12 -0400)]
Replace DPRINTF with DPRINTF1 and DPRINTF2 macros that use
SUDO_DEBUG_DIAG and SUDO_DEBUG_INFO respectively for logging to the
debug file with the ldap subsystem.
The sudoers_debug setting in ldap.conf is still honored for now but
will be removed in a future release.
Todd C. Miller [Tue, 23 Apr 2013 17:15:22 +0000 (13:15 -0400)]
Use time(&now) instead of now = time(NULL) when storing the current
time in a time_t (better compiler error checking).
Better parsing and printing of 64-bit time_t on 32-bit platforms.
Todd C. Miller [Sun, 21 Apr 2013 14:35:52 +0000 (10:35 -0400)]
Don't check the tty of the parent process. Now that we get the
controlling tty device number from the kernel there is no need. If
the process has really disassociated from the tty then reporting
"unknown" is appropriate.
Todd C. Miller [Tue, 16 Apr 2013 15:52:24 +0000 (11:52 -0400)]
Simplify lbuf append functions by moving the realloc code into
lbuf_expand(). We now expand as needed each time bytes need to be
written to the lbuf. Also handle a NULL pointer being passed in
for paranoia's sake.
Todd C. Miller [Tue, 16 Apr 2013 15:06:55 +0000 (11:06 -0400)]
Zero out struct iolog_details early to avoid a potential (though
unlikely) dereference of stack garbage if we hit a fatal error
before iolog_deserialize_info() is called.
Todd C. Miller [Sun, 14 Apr 2013 11:00:21 +0000 (07:00 -0400)]
Initial implementation of checksum support in sudoers.
Currently supports SHA-224, SHA-256, SHA-384, SHA-512.
TODO: checksum format validation in parser and base64 support.
checksum support for ldap sudoers