Todd C. Miller [Thu, 12 Jan 2012 15:18:57 +0000 (10:18 -0500)]
Keep track of the last token returned. On error, if the last token
was COMMENT, decrement sudolineno since the error most likely
occurred on the preceding line. Previously we always uses sudolineno-1
which will give the wrong line number for errors within a line.
Todd C. Miller [Mon, 10 Oct 2011 17:13:42 +0000 (13:13 -0400)]
Ignore set_logname (which is now the default) for sudoedit since
we want the LOGNAME, USER and USERNAME environment variables to
refer to the calling user since that is who the editor runs as.
This allows the editor to find the user's startup files.
Fixes bugzilla #515
Todd C. Miller [Tue, 27 Sep 2011 20:29:27 +0000 (16:29 -0400)]
Modify the authentication API such that the init and cleanup functions
are always called, regardless of whether or not we are going to
verify a password. This is needed for proper PAM session support.
Todd C. Miller [Sat, 17 Sep 2011 00:03:07 +0000 (20:03 -0400)]
Remove --with-CC option; it doesn't work correctly now that we use
libtool. Users can get the same effect by setting the CC
environment variable when running configure.
Todd C. Miller [Fri, 16 Sep 2011 23:57:12 +0000 (19:57 -0400)]
Use PAM by default on AIX 6 and higher.
Fix some square brackets in case statements that needed to be
doubled up. While here, use $OSMAJOR when it makes sense.
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.