Todd C. Miller [Thu, 23 Jul 2015 13:46:25 +0000 (07:46 -0600)]
In term_restore(), only restores the terminal if we are in the
foregroup process group. Instead of calling tcgetpgrp(), which is
racy, we set a temporary handler for SIGTTOU and check whether it
was received after a failed call to tcsetattr().
Todd C. Miller [Thu, 23 Jul 2015 13:36:27 +0000 (07:36 -0600)]
syscall restarting is broken on Mac OS X when interrupted by a tty
signal so restart tcsetattr() by hand. For details, see.
http://openradar.appspot.com/radar?id=6402578615107584
Todd C. Miller [Thu, 19 Feb 2015 21:18:13 +0000 (14:18 -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 [Tue, 10 Feb 2015 15:26:49 +0000 (08:26 -0700)]
In pp_files_expand() set _target to be empty. Fixes a problem with
Solaris sh where simply using typeset doesn't causes the variable
to be treated as local so we can inadvertantly inherit a value from
a previous call.
Todd C. Miller [Tue, 10 Feb 2015 03:52:50 +0000 (20:52 -0700)]
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 [Mon, 9 Feb 2015 23:34:06 +0000 (16:34 -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 [Wed, 5 Mar 2014 13:06:26 +0000 (06:06 -0700)]
Remove some extraneous markup; from Ingo Schwarze
* No need to explicitly end a macro with No before | because | counts
as middle punctuation and falls out of the macro, anyway.
* No need to explicitly re-open in-line macros after | because |
counts as middle punctuation and the macros resume afterwards,
anyway.
* Simplify the mnemonic remarks regarding the option letters, no need
for manual font and spacing control with No and Ns.
* Trim Ns No to just Ns, it already implies No.
Todd C. Miller [Wed, 5 Mar 2014 13:06:26 +0000 (06:06 -0700)]
Check for illegal characters in the NIS domain name. RHEL (and
perhaps other Linux distros) use the string "(none)" instead of an
empty string when there is no actual NIS-style domain name. Bug #596
Todd C. Miller [Fri, 28 Feb 2014 22:08:30 +0000 (15:08 -0700)]
Merge from sudo trunk:
Ignore EOVERFLOW from pstat_getproc(). The HP-UX kernel appears
to return this in certain situations but it appears to be harmless
at least insofar as retrieving the tty goes.
Handle d_type == DT_UNKNOWN when resolving the device to a name.
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.
AIX may have a 64-bit pr_ttydev that we need to convert to 32-bit
before we try to match it against st_rdev.
Break out of the loop if sudo_ttyname_scan() returns non-NULL.
Fixes a problem finding the tty name when it is not in /dev/pts.
Todd C. Miller [Fri, 28 Feb 2014 22:04:36 +0000 (15:04 -0700)]
Avoid a crash on Mac OS X 10.8 (at least) when we close libdispatch's
fds out from under it before executing the command. Switch to just
setting the close on exec flag instead.
Todd C. Miller [Thu, 31 Jan 2013 16:10:23 +0000 (11:10 -0500)]
Remove ttyname() fall back code on systems where we can query the
kernel for the tty device via /proc or sysctl(). If there is no
controlling tty, it is better to just treat the tty as unknown
rather than to blindly use what is hooked up to std{in,out,err}.
Todd C. Miller [Tue, 15 Jan 2013 19:54:49 +0000 (14:54 -0500)]
Do not inform the user that the command was not permitted by the
policy if they do not successfully authenticate. This is a regression
introduced in sudo 1.7.10.
Todd C. Miller [Tue, 1 Jan 2013 21:23:37 +0000 (16:23 -0500)]
No need to restore default signal handler for SIGSTOP as it is not
catchable. Attempting to do so is harmless but sigaction() will
fail and set errno to EINVAL which makes it looks like there is an
error.
Todd C. Miller [Mon, 24 Sep 2012 19:09:32 +0000 (15:09 -0400)]
Fix running commands that need the terminal in the background when
I/O logging is enabled. E.g. "sudo vi &". When the command is
foregrounded, it will now resume properly.