Todd C. Miller [Fri, 19 Nov 2004 20:03:33 +0000 (20:03 +0000)]
Change an occurence of user_matches() -> runas_matches() missed previously
runas_matches(), host_matches() and cmnd_matches() only really need to pass in
a list of members. user_matches() still needs to pass in a passwd struct
because of "sudo -l"
Todd C. Miller [Fri, 19 Nov 2004 19:46:55 +0000 (19:46 +0000)]
Check def_authenticate, def_noexec and def_monitor when setting return flags.
XXX May be better to just set the defaults directly and get rid of those flags.
Todd C. Miller [Fri, 19 Nov 2004 17:24:20 +0000 (17:24 +0000)]
Add local error/warning functions like err/warn but that call an additional
cleanup routine in the error case. This means we no longer need to compile
a special version of alloc.o for visudo.
Todd C. Miller [Thu, 18 Nov 2004 20:28:53 +0000 (20:28 +0000)]
Add support for VISUAL and EDITOR containing command line args.
If env_editor is not set any args in VISUAL and EDITOR are ignored.
Arguments are also now supported in def_editor.
Todd C. Miller [Mon, 15 Nov 2004 17:33:52 +0000 (17:33 +0000)]
Use ALIAS for the member type when storing an alias instead of
HOSTALIAS/RUNASALIAS/CMNDALIAS/USERALIAS since match.c relies on
the more generic type. Expand runas_matches instead of calling
user_matches() inside of it since user_matches() looks up USERALIASes,
not RUNASALIASes.
Todd C. Miller [Mon, 15 Nov 2004 15:53:53 +0000 (15:53 +0000)]
Add local error/warning functions like err/warn but that call an additional
cleanup routine in the error case. This means we no longer need to compile
a special version of alloc.o for visudo.
Todd C. Miller [Mon, 15 Nov 2004 14:53:05 +0000 (14:53 +0000)]
Cache passwd db entries in 2 reb-black trees; one indexed by uid,
the other by user name. The data returned from the cache should
be considered read-only and is destroyed by sudo_endpwent().
Todd C. Miller [Wed, 27 Oct 2004 16:16:23 +0000 (16:16 +0000)]
Only reset sudo_user.pw based on SUDO_USER environment variables for
real commands and sudoedit. This avoids a confusing message when a
user tries "sudo -l" or "sudo -v" and is denied.
Todd C. Miller [Tue, 26 Oct 2004 22:22:46 +0000 (22:22 +0000)]
Update for new parse. We now call find_path() *after* we have updated
the global defaults based on sudoers. Also adds support for listing
other user's privs if you are root.
Todd C. Miller [Tue, 26 Oct 2004 22:19:58 +0000 (22:19 +0000)]
Split sudo_ldap_check() into three pieces: sudo_ldap_open(),
udo_ldap_update_defaults() and sudo_ldap_check(). This allows
us to connecto to LDAP, apply the default options, find the command
in the user's path, and then check whether the user is allowed to
run it. The important thing here is that the default runas user
may be specified as a default option and that needs to be set
before we search for the command.
Todd C. Miller [Tue, 26 Oct 2004 22:14:01 +0000 (22:14 +0000)]
foo_matches() routines now live in match.c
Added user_matches(), runas_matches(), host_matches(), cmnd_matches()
and alias_matches() that operate on the parsed sudoers file.
Todd C. Miller [Tue, 26 Oct 2004 22:10:55 +0000 (22:10 +0000)]
Rewritten parser that converts sudoers into a set of data structures.
This eliminates ordering issues and makes it possible to apply
sudoers Defaults entries before searching for the command.
Todd C. Miller [Thu, 7 Oct 2004 18:52:51 +0000 (18:52 +0000)]
Use glob(3) instead of fnmatch(3) for matching pathnames and stat each
result that matches the basename of the user's command. This makes
"cd /usr/bin ; sudo ./blah" work when sudoers allows /usr/bin/blah.
Fixes bug #143.