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.
Todd C. Miller [Mon, 27 Aug 2012 19:38:57 +0000 (15:38 -0400)]
Pass on SIGTSTP to the command if it was sent by a user process
(not the kernel or the terminal) when we are not I/O logging and
set the default SIGTSTP handler when we re-send the signal to
ourself, restoring our handler after we resume.
Todd C. Miller [Mon, 27 Aug 2012 19:33:31 +0000 (15:33 -0400)]
Shells typically change their process group when they start up so
that they can implement job control. Most well-behaved shells
change the pgrp back to its original value before suspending so we
must not try to restore in that case, lest we race with the child
upon resume, potentially stopping sudo with SIGTTOU while the command
continues to run. Some shells, such as pdksh, just suspend the
shell by sending SIGSTOP to themselves without restoring the pgrp.
In this case we need to change the pgrp back for them.
Should fix bug #568