Commit Graph

3499 Commits

Author SHA1 Message Date
Todd C. Miller
f38c58574a Clarify comments about the data structures 2004-11-19 16:54:55 +00:00
Todd C. Miller
75ad6b81a2 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.
2004-11-18 20:28:53 +00:00
Todd C. Miller
cf02ff7f52 alias_matches() is no more 2004-11-17 19:25:54 +00:00
Todd C. Miller
0e71bf81ac sync 2004-11-17 19:09:21 +00:00
Todd C. Miller
81f5587329 When regenerating the parser, don't replace gram.h unless it has changed. 2004-11-17 18:19:45 +00:00
Todd C. Miller
761695f324 remove Makefile.binary for distclean 2004-11-17 16:56:25 +00:00
Todd C. Miller
b2ef18bbd3 Preserve KRB5CCNAME in zero_env() and add a paranoia check to make sure
we can't overflow new_env.
2004-11-17 16:18:33 +00:00
Todd C. Miller
88ce50751e paranoia when stripping trailing slashes from tempdir. 2004-11-17 15:33:45 +00:00
Todd C. Miller
d427384ae4 Set user_ngroups to 0 if getgroups() returns an error. 2004-11-17 00:00:48 +00:00
Todd C. Miller
f7f282ba13 Add configure check for getgroups() 2004-11-16 23:59:56 +00:00
Todd C. Miller
fc85c6f02d Use supplementary group vector in struct sudo_user. 2004-11-16 23:55:26 +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
cfbf7768ff sync 2004-11-16 21:10:22 +00:00
Todd C. Miller
900db20f7a On Digital UNIX _PATH_VAR_TMP doesn't end with a trailing slash so
chop off any trailing slashes we see and add an explicit one.
2004-11-16 20:54:37 +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
4620e8fa6f Cache non-existent passwd/group entries too. 2004-11-16 15:47:55 +00:00
Todd C. Miller
7679efc432 regen 2004-11-16 15:45:49 +00:00
Todd C. Miller
8680307dbd fix typo 2004-11-16 04:32:29 +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
cf356ed802 Add missing dependencies on gram.h 2004-11-15 18:24:09 +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
74169a83e0 Expand aliases in "sudo -l" mode 2004-11-15 18:00:29 +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
77cb1b56aa Paranoia; zero out pw_passwd before freeing passwd entry. 2004-11-15 17:05:54 +00:00
Todd C. Miller
51375f969f 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.
2004-11-15 15:53:53 +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
ae2e26fd2f 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().
2004-11-15 14:53:05 +00:00
Todd C. Miller
99158cc7ef add cast to uid_t 2004-11-15 14:50:03 +00:00
Todd C. Miller
7ee6d68151 missing free in alias_destroy 2004-11-15 14:49:48 +00:00
Todd C. Miller
ec431b4e3b Can't use rbapply() for rbdestroy since the destructor is passed a
data pointer, not a node pointer.
2004-11-15 14:49:17 +00:00
Todd C. Miller
0b34123a8b Create and use private versions of setpwent() and endpwent() that
set/end the shadow password file too.
2004-11-15 04:06:16 +00:00
Todd C. Miller
e26e40df8a Store aliases in a red-black tree. 2004-11-15 03:55:22 +00:00
Todd C. Miller
72c6f3ba99 red-black tree implementation 2004-11-15 03:52:54 +00:00
Todd C. Miller
f3839f1bf0 Edit all sudoers file if there were unused or undefined aliases and we
are in strict mode.
2004-11-15 03:37:53 +00:00
Todd C. Miller
a768dbc34f Bring back the "secure_path" Defaults option now that Defaults take
effect before the path is searched.
2004-11-12 16:19:19 +00:00
Todd C. Miller
541908f1bd A user can always list their own entries, even with -u.
Better error message when failing to list another user's entries.
2004-11-11 17:22:30 +00:00
Todd C. Miller
a239e60a6a The syntax to list another user's entries is now "-u otheruser -l".
Only root or users with sudo "ALL" may list other user's entries.
2004-11-11 17:12:20 +00:00
Todd C. Miller
85d1ca15a7 Update env variable info in SECURITY NOTES 2004-11-11 16:30:01 +00:00
Todd C. Miller
74b4e439a6 strip CDPATH too 2004-11-11 16:25:20 +00:00
Todd C. Miller
482526bde1 strip exported bash functions from the environment. 2004-11-11 16:20:59 +00:00
Todd C. Miller
29fc2c9475 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.
2004-10-27 16:16:23 +00:00
Todd C. Miller
8ac7915572 Extend LIST_APPEND to deal with appending lists too 2004-10-27 16:06:52 +00:00
Todd C. Miller
4549980664 Convert some bitwise AND to ISSET 2004-10-26 22:39:35 +00:00
Todd C. Miller
7062fd28fd toke.c replaces lex.yy.c 2004-10-26 22:29:32 +00:00
Todd C. Miller
b1d7ccde4f sync 2004-10-26 22:29:08 +00:00
Todd C. Miller
f3d8a11601 new parser fixes most of the outstanding bugs 2004-10-26 22:28:11 +00:00
Todd C. Miller
5744a0bfd6 regen 2004-10-26 22:27:06 +00:00