Todd C. Miller [Mon, 6 Feb 2012 20:47:22 +0000 (15:47 -0500)]
More complete fix for LDR_PRELOAD on AIX. The addition of
set_perm(PERM_ROOT) before calling the nss open functions (needed
to avoid a GNU TLS bug) also broke LDR_PRELOAD. Setting the effective
and then real uid to 0 for PERM_ROOT works around the issue.
Todd C. Miller [Mon, 6 Feb 2012 20:46:17 +0000 (15:46 -0500)]
More complete fix for LDR_PRELOAD on AIX. The addition of
set_perm(PERM_ROOT) before calling the nss open functions (needed
to avoid a GNU TLS bug) also broke LDR_PRELOAD. Setting the effective
and then real uid to 0 for PERM_ROOT works around the issue.
Todd C. Miller [Mon, 6 Feb 2012 18:37:26 +0000 (13:37 -0500)]
Set real uid to root before calling sudo_edit() or run_command()
so that the monitor process is owned by root and not by the user.
Otherwise, on AIX at least, the monitor process shows up in ps as
belonging to the user (and can be killed by the user).
Todd C. Miller [Mon, 6 Feb 2012 18:37:11 +0000 (13:37 -0500)]
For PERM_ROOT when using setreuid(), only set the euid to 0 prior
to the call to setuid(0) if the current euid is non-zero. This
effectively restores the state of things prior to rev 7bfeb629fccb.
Fixes a problem on AIX where LDR_PRELOAD was not being honored for
the command being executed.
Todd C. Miller [Mon, 6 Feb 2012 18:33:46 +0000 (13:33 -0500)]
Set real uid to root before calling sudo_edit() or run_command()
so that the monitor process is owned by root and not by the user.
Otherwise, on AIX at least, the monitor process shows up in ps as
belonging to the user (and can be killed by the user).
Todd C. Miller [Mon, 6 Feb 2012 18:29:19 +0000 (13:29 -0500)]
For PERM_ROOT when using setreuid(), only set the euid to 0 prior
to the call to setuid(0) if the current euid is non-zero. This
effectively restores the state of things prior to rev 7bfeb629fccb.
Fixes a problem on AIX where LDR_PRELOAD was not being honored for
the command being executed.
Todd C. Miller [Fri, 3 Feb 2012 19:59:36 +0000 (14:59 -0500)]
Normally, sudo disables core dumps while it is running. This
behavior can now be modified at run time with a line in sudo.conf
like "Set disable_coredumps false"
Todd C. Miller [Fri, 3 Feb 2012 19:57:03 +0000 (14:57 -0500)]
Normally, sudo disables core dumps while it is running. This
behavior can now be modified at run time with a line in sudo.conf
like "Set disable_coredumps false"
Todd C. Miller [Wed, 1 Feb 2012 16:28:21 +0000 (11:28 -0500)]
Error out if user specified --with-pam but we can't find the headers
or library. Also throw an error if the headers are present but the
library is not and vice versa.
Todd C. Miller [Wed, 1 Feb 2012 16:27:50 +0000 (11:27 -0500)]
Error out if user specified --with-pam but we can't find the headers
or library. Also throw an error if the headers are present but the
library is not and vice versa.
Todd C. Miller [Wed, 25 Jan 2012 21:29:56 +0000 (16:29 -0500)]
The change in 4fe0f357d34b that caused to exit when the monitor
dies created a race condition between the monitor exiting and the
status being read. All we really want to do is make sure that
select() notifies us that there is a status change when the monitor
dies unexpectedly so shutdown the socketpair connected to the monitor
for writing when it dies. That way we can still read the status
that is pending on the socket and select() on Linux will tell us
that the fd is ready.
Todd C. Miller [Wed, 25 Jan 2012 21:29:08 +0000 (16:29 -0500)]
The change in 818e82ecbbfc that caused to exit when the monitor
dies created a race condition between the monitor exiting and the
status being read. All we really want to do is make sure that
select() notifies us that there is a status change when the monitor
dies unexpectedly so shutdown the socketpair connected to the monitor
for writing when it dies. That way we can still read the status
that is pending on the socket and select() on Linux will tell us
that the fd is ready.
Todd C. Miller [Wed, 25 Jan 2012 19:58:36 +0000 (14:58 -0500)]
Refactor disable_execute() and my_execve() into exec_common.c for
use by sesh.c. This fixes NOEXEC when SELinux is used. Instead
of disabling exec in exec_setup(), disable it immediately before
executing the command. Adapted from a diff by Arno Schuring.
Todd C. Miller [Wed, 25 Jan 2012 19:58:02 +0000 (14:58 -0500)]
Refactor disable_execute() and my_execve() into exec_common.c for
use by sesh.c. This fixes NOEXEC when SELinux is used. Instead
of disabling exec in exec_setup(), disable it immediately before
executing the command. Adapted from a diff by Arno Schuring.
Todd C. Miller [Fri, 20 Jan 2012 15:29:22 +0000 (10:29 -0500)]
Add custom version of AC_CHECK_LIB that uses the extra libs in the
cache value name. With this we no longer need to rely on a modified
version of autoconf.
Todd C. Miller [Fri, 20 Jan 2012 15:28:56 +0000 (10:28 -0500)]
Add custom version of AC_CHECK_LIB that uses the extra libs in the
cache value name. With this we no longer need to rely on a modified
version of autoconf.
Todd C. Miller [Thu, 19 Jan 2012 16:08:45 +0000 (11:08 -0500)]
For "sudo -g" prepend the specified group ID to the beginning of
the groups list. This matches BSD convention where the effective
gid is the first entry in the group list. This is required on newer
FreeBSD where the effective gid is not tracked separately and thus
setgroups() changes the egid if this convention is not followed.
Fixes bug #532
Todd C. Miller [Thu, 19 Jan 2012 16:03:22 +0000 (11:03 -0500)]
For "sudo -g" prepend the specified group ID to the beginning of
the groups list. This matches BSD convention where the effective
gid is the first entry in the group list. This is required on newer
FreeBSD where the effective gid is not tracked separately and thus
setgroups() changes the egid if this convention is not followed.
Fixes bug #532
Todd C. Miller [Tue, 17 Jan 2012 15:28:42 +0000 (10:28 -0500)]
When not logging I/O, use a signal handler that only forwards SIGINT,
SIGQUIT and SIGHUP when they are user-generated signals. Fixes a
race in the non-I/O logging path where the command may receive two
keyboard-generated signals; one from the kernel and one from the
sudo process.
Todd C. Miller [Tue, 17 Jan 2012 15:28:21 +0000 (10:28 -0500)]
Only run compat regress tests on compat objects we actually build.
Fixes "make check" in the compat dir for systems that don't implement
character classes in fnmatch() or glob(). Bug #531
Todd C. Miller [Tue, 17 Jan 2012 15:27:33 +0000 (10:27 -0500)]
When not logging I/O, use a signal handler that only forwards SIGINT,
SIGQUIT and SIGHUP when they are user-generated signals. Fixes a
race in the non-I/O logging path where the command may receive two
keyboard-generated signals; one from the kernel and one from the
sudo process.
Todd C. Miller [Mon, 16 Jan 2012 15:40:11 +0000 (10:40 -0500)]
Only run compat regress tests on compat objects we actually build.
Fixes "make check" in the compat dir for systems that don't implement
character classes in fnmatch() or glob(). Bug #531
Todd C. Miller [Fri, 13 Jan 2012 14:49:48 +0000 (09:49 -0500)]
Include parent directories in case they don't already exist. This
fixes a directory permissions problem with the AIX package when the
/usr/local directories don't already exist.
Todd C. Miller [Fri, 13 Jan 2012 14:49:20 +0000 (09:49 -0500)]
Include parent directories in case they don't already exist. This
fixes a directory permissions problem with the AIX package when the
/usr/local directories don't already exist.
Todd C. Miller [Thu, 12 Jan 2012 21:44:07 +0000 (16:44 -0500)]
Add a check for devname() returning a fully-qualified pathname.
None of the devname() implementations do this today but you never
know when this might change.
Todd C. Miller [Thu, 12 Jan 2012 12:50:40 +0000 (07:50 -0500)]
Add a check for devname() returning a fully-qualified pathname.
None of the devname() implementations do this today but you never
know when this might change.
Todd C. Miller [Wed, 11 Jan 2012 20:40:42 +0000 (15:40 -0500)]
The device name returned by devname() does not include the /dev/
prefix so we need to add it ourselves. Also add debug warning if
KERN_PROC sysctl fails or devname() can't resolve the tty device
to a name.