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.
Todd C. Miller [Tue, 27 Jul 2010 13:49:54 +0000 (09:49 -0400)]
Add setlocale() so the command line arguments that use floating
point work in different locales. Since sudo now logs the timing
data in the C locale we must Parse the seconds in the timing file
manually instead of using strtod(). Furthermore, sudo 1.7.3 logged
the number of seconds with the user's locale so if the decimal point
is not '.' try using the locale-specific version.
Todd C. Miller [Thu, 22 Jul 2010 17:47:32 +0000 (13:47 -0400)]
Install sudoers as /etc/sudoers on RPM and debian systems where the
package manager will not replace a user-modified configuration file.
This fixes upgrades from the vendor sudo packages.
Todd C. Miller [Thu, 22 Jul 2010 17:42:59 +0000 (13:42 -0400)]
RPM: use %config(noreplace) instead of %config for volatile This
results in the new file being installed with a .rpmnew suffix instead
of the file being replaced and the old one renamed with a .rpmsave
suffix.
Todd C. Miller [Tue, 20 Jul 2010 16:40:37 +0000 (12:40 -0400)]
setauthdb() only sets the "old" registry if it was set by a previous
call to setauthdb(). To restore the original value, passing NULL
(or an empty string) to setauthdb() is sufficient.
Todd C. Miller [Fri, 16 Jul 2010 18:05:03 +0000 (14:05 -0400)]
Restore RLIMIT_NPROC after the uid switch if it appears that runas_setup()
did not do it for us. Fixes a bash script problem on SuSE with RLIMIT_NPROC
set to RLIM_INFINITY.
Todd C. Miller [Thu, 15 Jul 2010 19:12:34 +0000 (15:12 -0400)]
Use tab indents to reduce the chance of problem with <<-
Fix the debian %set section, pp does not set pp_deb_distro
Uncomment %sudo line in sudoers for debian
Uncomment some env_keep lines for RHEL, SLES and debian to more
closely match the vendor sudoers files.
Add /etc/pam.d to %files
Remove the /etc/sudo-ldap.conf symlink on debian for ldap flavor