Todd C. Miller [Sat, 22 Oct 2011 18:28:33 +0000 (14:28 -0400)]
Wrap error/errorx and warning/warningx functions with debug statements.
Disable wrapping for standalone sudoers programs as well as memory
allocation functions (to avoid infinite recursion).
Todd C. Miller [Wed, 12 Oct 2011 12:24:13 +0000 (08:24 -0400)]
Override and ignore the --disable-static option. Sudo already runs
libtool with -tag=disable-static where applicable and we need non-PIC
objects to build the executables.
Todd C. Miller [Mon, 10 Oct 2011 17:10:24 +0000 (13:10 -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 [Mon, 10 Oct 2011 15:10:59 +0000 (11:10 -0400)]
Instead of trying to grow the buffer in make_grlist_item(), simply
increase the total length, free the old buffer and allocate a new
one. This is less error prone and saves us from having to adjust
all the pointers in the buffer. This code path is only taken when
there are groups longer than the length of the user field in struct
utmp or utmpx, which should be quite rare.
Todd C. Miller [Tue, 27 Sep 2011 17:18:46 +0000 (13:18 -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 [Tue, 27 Sep 2011 15:13:44 +0000 (11:13 -0400)]
Fix a PAM_USER mismatch in session open/close. We update PAM_USER
to the target user immediately before setting resource limits, which
is after the monitor process has forked (so it has the old value).
Also, if the user did not authenticate, there is no pamh in the
monitor so we need to init pam here too. This means we end up
calling pam_start() twice, which should be fixed, but at least the
session is always properly closed now.
Todd C. Miller [Fri, 23 Sep 2011 23:37:21 +0000 (19:37 -0400)]
Quiet a false positive found by several static analysis tools.
These tools don't know that log_error() does not return (it longjmps
to error_jmp which returns to the sudo front-end).
Todd C. Miller [Thu, 8 Sep 2011 13:36:24 +0000 (09:36 -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 [Tue, 9 Aug 2011 18:54:42 +0000 (14:54 -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 and testsudoers poke sudo_defs_table[] which is
a bit naughty, but avoids requiring stub functions in visudo and
the tests.
Todd C. Miller [Fri, 29 Jul 2011 14:10:40 +0000 (10:10 -0400)]
Go back to escaping the command args for "sudo -i" and "sudo -s"
before calling the plugin. Otherwise, spaces in the command args
are not treated properly. The sudoers plugin will unescape non-spaces
to make matching easier.
Todd C. Miller [Wed, 27 Jul 2011 16:11:33 +0000 (12:11 -0400)]
Don't try to audit failure if the runas user does not exist. We don't
have the user's command at this point so there is nothing to audit.
Add a NULL check in audit_success() and audit_failure() just to be
on the safe side.
Todd C. Miller [Mon, 25 Jul 2011 13:17:18 +0000 (09:17 -0400)]
Remove fallback to per-group lookup when matching groups in sudoers.
The sudo front-end will now use getgrouplist() to get the user's
list of groups if getgroups() fails or returns zero groups so we
always have a list of the user's groups. For systems with
mbr_check_membership() which support more that NGROUPS_MAX groups
(Mac OS X), skip the call to getgroups() and use getgrouplist() so
we get all the groups.