Todd C. Miller [Sun, 14 Aug 2011 20:00:01 +0000 (16:00 -0400)]
bash 2.x doesd not support the -l flag and exits with an error if
it is specified so use --login instead. This causes an error with
bash 1.x (which uses -login instead) but this version is hopefully
less used than 2.x.
Todd C. Miller [Sun, 14 Aug 2011 15:45:09 +0000 (11:45 -0400)]
Improved background mode support. When not allocating a pty, the
command is run in its own process group. This prevents write access
to the tty. When running in a pty, stdin is not hooked up and we
never read from /dev/tty, which results in similar behavior.
Todd C. Miller [Sun, 14 Aug 2011 14:19:48 +0000 (10:19 -0400)]
Go back to escaping the command args for "sudo -i" and "sudo -s"
in NewArgv before checking sudoers but unescape non-spaces when
building user_args to make sudoers matching easier.
Todd C. Miller [Sat, 13 Aug 2011 22:09:13 +0000 (18:09 -0400)]
When building with gcc on HP-UX, use -march=1.1 to produce portable
binaries on a pa-risc2 host. Previously, the +Dportable option was
used for the HP-UX C compiler but gcc always produced native binaries.
Todd C. Miller [Sat, 13 Aug 2011 18:43:43 +0000 (14:43 -0400)]
If the user specifies a runas group via sudo's -g option that matches
the runas user's group in the passwd database and that group is not
denied in the Runas_Spec, allow it. Thus, if user root's gid in
/etc/passwd is 0, then "sudo -u root -g root id" is allow even if
no groups are present in the Runas_Spec.
Todd C. Miller [Sat, 13 Aug 2011 18:42:57 +0000 (14:42 -0400)]
When checking aliases, also check the contents of the alias in case
there are problems with an alias that is referenced inside another.
Replace the self reference check with real alias cycle detection.
Todd C. Miller [Sat, 13 Aug 2011 18:39:32 +0000 (14:39 -0400)]
Increment alias_seqno before calls to alias_remove_recursive() to
avoid false positives with the alias loop detection. Fixes spurious
warnings about unused aliases when they are nested.
Todd C. Miller [Tue, 9 Aug 2011 18:56:05 +0000 (14:56 -0400)]
Go back to using a callback for runas_default to keep runas_pw in
sync. This is needed to make per-entry runas_default settings work
with LDAP-based sudoers. Instead of declaring it a callback in
def_data.in, sudo pokes sudo_defs_table[] which is a bit naughty,
but avoids requiring stub functions in visudo and testsudoers.
Todd C. Miller [Fri, 10 Jun 2011 19:27:48 +0000 (15:27 -0400)]
Explicitly set mode and owner of /etc/sudoers instead of relying
on "cp -p" to work in the postinstall script. On AIX 6.1 at least
the postinstall script runs before the final file permissions are set.
Todd C. Miller [Fri, 29 Apr 2011 20:07:37 +0000 (16:07 -0400)]
Split ALL, ROLE and TYPE into their own actions. Since you can
only have #ifdefs inside of braces, ROLE and TYPE use a naughty
goto in the non-SELinux case. This is safe because the actions are
in one big switch() statement.
Todd C. Miller [Mon, 18 Apr 2011 13:30:48 +0000 (09:30 -0400)]
Need to do checks for krb5_verify_user, krb5_init_secure_context
and krb5_get_init_creds_opt_alloc regardless of whether or not
krb5-config is present.
Todd C. Miller [Sun, 27 Mar 2011 21:16:15 +0000 (17:16 -0400)]
Use bitwise AND instead of modulus to check for length being odd.
A newline in the middle of a string is an error unless a line
continuation character is used.
Todd C. Miller [Mon, 21 Mar 2011 21:49:16 +0000 (17:49 -0400)]
If we match a rule anchored to the beginning of a line after parsing
a line continuation character, return an ERROR token. It would be
nicer to use REJECT instead but that substantially slows down the
lexer.
Todd C. Miller [Fri, 18 Mar 2011 14:07:51 +0000 (10:07 -0400)]
Save the controlling tty process group before suspending in pty
mode. Previously, we assumed that the child pgrp == child pid
(which is usually, but not always, the case).
Todd C. Miller [Thu, 17 Mar 2011 20:42:28 +0000 (16:42 -0400)]
We normaly transition from GOTDEFS to STARTDEFS on whitespace, but
if that whitespace is followed by a comma, we want to treat it as
part of a list and not transition.
Todd C. Miller [Wed, 16 Mar 2011 16:02:42 +0000 (12:02 -0400)]
Save the controlling tty process group before suspending so we can
restore it when we resume. Fixes job control problems on Linux
caused by the previous attemp to fix resuming a shell when I/O
logging not enabled.
Todd C. Miller [Wed, 16 Mar 2011 15:55:54 +0000 (11:55 -0400)]
In handle_signals(), restart the read() on EINTR to make sure we keep up
with the signal pipe. Don't return -1 on EAGAIN, it just means we have
emptied the pipe.