Todd C. Miller [Fri, 1 Oct 2010 16:17:01 +0000 (12:17 -0400)]
When iterating over returned LDAP entries, keep looking at remaining
matches even if we have a positive match. This catches negative
matches that may exist in other entries and more closely match the
sudoers file behavior.
Todd C. Miller [Sun, 26 Sep 2010 21:41:35 +0000 (17:41 -0400)]
Add dlopen() emulation for systems without it.
For HP-UX 10, emulate using shl_load().
For others, link sudoers plugin statically and use a lookup
table to emulate dlsym().
Todd C. Miller [Fri, 10 Sep 2010 15:20:32 +0000 (11:20 -0400)]
Instead of using a array to store received signals, open a pipe and
have the signal handler write the signal number to one end and
select() on the other end. This makes it possible to handle signals
similar to I/O without race conditions.
Todd C. Miller [Mon, 6 Sep 2010 11:56:15 +0000 (07:56 -0400)]
When matching the runas user and runas group (-u and -g command
line options), keep track of runas group and runas user matches
separately. Only return a positive match if we have a match for
both runas user and runas group (if specified).
Todd C. Miller [Thu, 26 Aug 2010 15:40:04 +0000 (11:40 -0400)]
If runas_pw changes, reset the stashed runas aux group vector.
Otherwise, if runas_default is set in a per-command Defaults statement,
the command runs with root's aux group vector (i.e. the one that
was used when locating the command).
Todd C. Miller [Wed, 18 Aug 2010 19:26:26 +0000 (15:26 -0400)]
Set dupcheck to TRUE when setting new HOME value if !env_reset but
always_set_home is true. Prevents a duplicate HOME in the environment
(old value plus the new one) introduced in f421f8827340.
Todd C. Miller [Sat, 14 Aug 2010 14:18:49 +0000 (10:18 -0400)]
If the user hits ^C while a password is being read, error out before
reading any further passwords in the pam conversation function.
Otherwise, if multiple PAM auth methods are required, the user will
have to hit ^C for each one.
Todd C. Miller [Sat, 7 Aug 2010 15:08:32 +0000 (11:08 -0400)]
Better handling of versions with a patchlevel. For rpm and deb, use
the patchlevel+1 as the release. For AIX, use the patchlevel as the
4th version number. For the rest, just leave the patchlevel in the
version string.
Todd C. Miller [Fri, 6 Aug 2010 17:55:33 +0000 (13:55 -0400)]
No need to look up shadow password unless we are doing password-style
authentication. This moves the shadow password lookup to the auth
functions that need it.
Todd C. Miller [Fri, 6 Aug 2010 17:54:35 +0000 (13:54 -0400)]
Retain final passwd/group refs until the policy close() function.
Note that this doesn't get called in all cases so putting
this in a cleanup function is probably better.
Todd C. Miller [Wed, 4 Aug 2010 13:58:50 +0000 (09:58 -0400)]
Reference count cached passwd and group structs. The cache holds
one reference itself and another is added by sudo_getgr{gid,nam}
and sudo_getpw{uid,nam}. The final ref on the runas and user passwd
and group structs are persistent for now.
Todd C. Miller [Tue, 3 Aug 2010 19:15:45 +0000 (15:15 -0400)]
Instead of caching struct passwd and struct group in the red-black
tree, store a struct cache_item which includes both the key and
datum. This allows us to user the actual name that was looked up
as the key instead of the contents of struct passwd or struct group.
This matters because the name in the database may not match what
we looked up, due either to case folding or truncation (historically
at 8 characters). Also mark the disabled calls to sudo_freepwcache()
and sudo_freegrcache() as broken since we use cached data for things
like set_perms() and the logging functions. Fixing this would
require making a copy of the structs for user and runas or adding
a reference count (better).
Todd C. Miller [Mon, 2 Aug 2010 19:32:06 +0000 (15:32 -0400)]
Add cross-compile defaults for remaining AC_TRY_RUN usage.
Also add back getgroups() check since AC_FUNC_GETGROUPS defaults
to "no" when cross-compiling.