Commit Graph

19 Commits

Author SHA1 Message Date
Todd C. Miller
304dc46d7f Add efree() for consistency with emalloc() et al. Allows us to rely
on C89 behavior (free(NULL) is valid) even on K&R.
2005-03-29 14:29:47 +00:00
Todd C. Miller
778d587063 Update copyright years. 2005-02-12 22:56:07 +00:00
Todd C. Miller
3b8b88407f Add __unused to rcsids 2005-01-27 15:42:30 +00:00
Todd C. Miller
a58012cfff Only check group vector in usergr_matches() if we are matching the
invoking or list user.  Always check the group members, even if
there was a group vector.
2005-01-01 17:41:21 +00:00
Todd C. Miller
94f606fbf6 Deal with user_stat being NULL as it is for visudo and testsudoers. 2004-11-24 21:44:54 +00:00
Todd C. Miller
0cddfc3684 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"
2004-11-19 20:03:33 +00:00
Todd C. Miller
2c2daa8eca Use: #include <config.h>
Not: #include "config.h"
That way we get the correct config.h when build dir != src dir
2004-11-19 18:39:14 +00:00
Todd C. Miller
596d1ef5a4 Only do string comparisons on the group members if there is no
supplemental group list.
2004-11-16 23:40:58 +00:00
Todd C. Miller
0ed2557959 remove bogus XXX comment 2004-11-16 17:02:58 +00:00
Todd C. Miller
3e97ace970 Get rid of alias_matches and correctly fall through to the non-alias
cases when there is no alias with the specified name.
2004-11-16 16:10:09 +00:00
Todd C. Miller
9846e562ad Implement group caching and use the passwd and group caches throughout. 2004-11-16 04:24:11 +00:00
Todd C. Miller
fd46c2c3ef Properly negate the return value of alias_matches() when appropriate. 2004-11-15 19:43:47 +00:00
Todd C. Miller
61ba998eec Make hostname_matches() return TRUE for a match, else FALSE like the
caller expects.
2004-11-15 19:38:31 +00:00
Todd C. Miller
814103ee29 Use runas_matches in alias_matches() now that we have it. 2004-11-15 18:06:11 +00:00
Todd C. Miller
d076091ab3 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.
2004-11-15 17:33:52 +00:00
Todd C. Miller
244eec5cdb Use userpw_matches() to compare usernames, not strcmp(), since the latter
checks for "#uid".
2004-11-15 14:59:03 +00:00
Todd C. Miller
99158cc7ef add cast to uid_t 2004-11-15 14:50:03 +00:00
Todd C. Miller
e26e40df8a Store aliases in a red-black tree. 2004-11-15 03:55:22 +00:00
Todd C. Miller
56e8b2fcf8 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.
2004-10-26 22:14:01 +00:00