]> granicus.if.org Git - sudo/log
sudo
20 years agoCache passwd db entries in 2 reb-black trees; one indexed by uid,
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().

20 years agoadd cast to uid_t
Todd C. Miller [Mon, 15 Nov 2004 14:50:03 +0000 (14:50 +0000)]
add cast to uid_t

20 years agomissing free in alias_destroy
Todd C. Miller [Mon, 15 Nov 2004 14:49:48 +0000 (14:49 +0000)]
missing free in alias_destroy

20 years agoCan't use rbapply() for rbdestroy since the destructor is passed a
Todd C. Miller [Mon, 15 Nov 2004 14:49:17 +0000 (14:49 +0000)]
Can't use rbapply() for rbdestroy since the destructor is passed a
data pointer, not a node pointer.

20 years agoCreate and use private versions of setpwent() and endpwent() that
Todd C. Miller [Mon, 15 Nov 2004 04:06:16 +0000 (04:06 +0000)]
Create and use private versions of setpwent() and endpwent() that
set/end the shadow password file too.

20 years agoStore aliases in a red-black tree.
Todd C. Miller [Mon, 15 Nov 2004 03:55:22 +0000 (03:55 +0000)]
Store aliases in a red-black tree.

20 years agored-black tree implementation
Todd C. Miller [Mon, 15 Nov 2004 03:52:54 +0000 (03:52 +0000)]
red-black tree implementation

20 years agoEdit all sudoers file if there were unused or undefined aliases and we
Todd C. Miller [Mon, 15 Nov 2004 03:37:53 +0000 (03:37 +0000)]
Edit all sudoers file if there were unused or undefined aliases and we
are in strict mode.

20 years agoBring back the "secure_path" Defaults option now that Defaults take
Todd C. Miller [Fri, 12 Nov 2004 16:19:19 +0000 (16:19 +0000)]
Bring back the "secure_path" Defaults option now that Defaults take
effect before the path is searched.

20 years agoA user can always list their own entries, even with -u.
Todd C. Miller [Thu, 11 Nov 2004 17:22:30 +0000 (17:22 +0000)]
A user can always list their own entries, even with -u.
Better error message when failing to list another user's entries.

20 years agoThe syntax to list another user's entries is now "-u otheruser -l".
Todd C. Miller [Thu, 11 Nov 2004 17:12:20 +0000 (17:12 +0000)]
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.

20 years agoUpdate env variable info in SECURITY NOTES
Todd C. Miller [Thu, 11 Nov 2004 16:30:01 +0000 (16:30 +0000)]
Update env variable info in SECURITY NOTES

20 years agostrip CDPATH too
Todd C. Miller [Thu, 11 Nov 2004 16:25:20 +0000 (16:25 +0000)]
strip CDPATH too

20 years agostrip exported bash functions from the environment.
Todd C. Miller [Thu, 11 Nov 2004 16:20:59 +0000 (16:20 +0000)]
strip exported bash functions from the environment.

20 years agoOnly reset sudo_user.pw based on SUDO_USER environment variables for
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.

20 years agoExtend LIST_APPEND to deal with appending lists too
Todd C. Miller [Wed, 27 Oct 2004 16:06:52 +0000 (16:06 +0000)]
Extend LIST_APPEND to deal with appending lists too

20 years agoConvert some bitwise AND to ISSET
Todd C. Miller [Tue, 26 Oct 2004 22:39:35 +0000 (22:39 +0000)]
Convert some bitwise AND to ISSET

20 years agotoke.c replaces lex.yy.c
Todd C. Miller [Tue, 26 Oct 2004 22:29:32 +0000 (22:29 +0000)]
toke.c replaces lex.yy.c

20 years agosync
Todd C. Miller [Tue, 26 Oct 2004 22:29:08 +0000 (22:29 +0000)]
sync

20 years agonew parser fixes most of the outstanding bugs
Todd C. Miller [Tue, 26 Oct 2004 22:28:11 +0000 (22:28 +0000)]
new parser fixes most of the outstanding bugs

20 years agoregen
Todd C. Miller [Tue, 26 Oct 2004 22:27:06 +0000 (22:27 +0000)]
regen

20 years agoRework for the new parser.
Todd C. Miller [Tue, 26 Oct 2004 22:26:28 +0000 (22:26 +0000)]
Rework for the new parser.
Now checks for unused aliases in sudoers.

20 years agoRewrite for the new parser. Now supports a -d flag (dump) and adds a -h
Todd C. Miller [Tue, 26 Oct 2004 22:25:34 +0000 (22:25 +0000)]
Rewrite for the new parser.  Now supports a -d flag (dump) and adds a -h
flag (host).  It now defaults to the local hostname unless otherwise
specified.

20 years agoAdd new prototypes.
Todd C. Miller [Tue, 26 Oct 2004 22:23:29 +0000 (22:23 +0000)]
Add new prototypes.
Remove NOMATCH/UNSPEC (now in parse.h)

20 years agoUpdate for new parse. We now call find_path() *after* we have updated
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.

20 years agoWorking LDAP support; also remove a now-unneeded rewind().
Todd C. Miller [Tue, 26 Oct 2004 22:21:02 +0000 (22:21 +0000)]
Working LDAP support; also remove a now-unneeded rewind().

20 years agoAdd NO_STDERR flag.
Todd C. Miller [Tue, 26 Oct 2004 22:20:18 +0000 (22:20 +0000)]
Add NO_STDERR flag.

20 years agoSplit sudo_ldap_check() into three pieces: sudo_ldap_open(),
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.

20 years agoAdd casts to unsigned char for isspace() to quiet a gcc warning.
Todd C. Miller [Tue, 26 Oct 2004 22:17:15 +0000 (22:17 +0000)]
Add casts to unsigned char for isspace() to quiet a gcc warning.

20 years agoAdd prototype for update_defaults()
Todd C. Miller [Tue, 26 Oct 2004 22:16:26 +0000 (22:16 +0000)]
Add prototype for update_defaults()

20 years agoDon't warn about line numbers now that we operate on a set of data
Todd C. Miller [Tue, 26 Oct 2004 22:16:08 +0000 (22:16 +0000)]
Don't warn about line numbers now that we operate on a set of data
structures (or LDAP) and not a file.

20 years agoNo long use lsearch()
Todd C. Miller [Tue, 26 Oct 2004 22:15:05 +0000 (22:15 +0000)]
No long use lsearch()

20 years agoUpdate for new and changed file names.
Todd C. Miller [Tue, 26 Oct 2004 22:14:40 +0000 (22:14 +0000)]
Update for new and changed file names.

20 years agono more BSD lsearch.c
Todd C. Miller [Tue, 26 Oct 2004 22:14:21 +0000 (22:14 +0000)]
no more BSD lsearch.c

20 years agofoo_matches() routines now live in match.c
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.

20 years agoMove parse.lex -> toke.l
Todd C. Miller [Tue, 26 Oct 2004 22:12:47 +0000 (22:12 +0000)]
Move parse.lex -> toke.l
Rename buffer_frob() -> switch_buffer()
WORD no longer needs to exclude '@'
kill yywrap()

20 years agoRewritten parser that converts sudoers into a set of data structures.
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.

20 years agoWe won't be using lsearch() any longer.
Todd C. Miller [Tue, 26 Oct 2004 22:09:22 +0000 (22:09 +0000)]
We won't be using lsearch() any longer.

20 years agosudo should not send mail if someone who runs 'sudo -l' has no entry.
Todd C. Miller [Tue, 26 Oct 2004 22:07:03 +0000 (22:07 +0000)]
sudo should not send mail if someone who runs 'sudo -l' has no entry.

20 years agoregen
Todd C. Miller [Tue, 26 Oct 2004 20:09:14 +0000 (20:09 +0000)]
regen

20 years agoUpdate warnings to match new visudo
Todd C. Miller [Tue, 26 Oct 2004 20:09:01 +0000 (20:09 +0000)]
Update warnings to match new visudo

20 years agoThe new parser doesn't have the old ordering constraints.
Todd C. Miller [Tue, 26 Oct 2004 20:08:47 +0000 (20:08 +0000)]
The new parser doesn't have the old ordering constraints.

20 years agoDocument that -l now takes an optional username argument
Todd C. Miller [Tue, 26 Oct 2004 20:08:24 +0000 (20:08 +0000)]
Document that -l now takes an optional username argument

20 years agoAIX 5.2.0.0 works
Todd C. Miller [Mon, 25 Oct 2004 17:44:54 +0000 (17:44 +0000)]
AIX 5.2.0.0 works

20 years agoIf LDAP_OPT_SUCCESS is not defined, use LDAP_SUCCESS instead.
Todd C. Miller [Mon, 25 Oct 2004 17:38:24 +0000 (17:38 +0000)]
If LDAP_OPT_SUCCESS is not defined, use LDAP_SUCCESS instead.
Fixes a compilation problem with Solaris 9's native LDAP.

Set FLAG_MONITOR when needed.

20 years agoCall sudo_goodpath() *after* changing the cwd to match the traced process.
Todd C. Miller [Sat, 23 Oct 2004 17:32:20 +0000 (17:32 +0000)]
Call sudo_goodpath() *after* changing the cwd to match the traced process.
Fixes relative paths.

20 years agoKill set_perms() stub--it is no longer needed.
Todd C. Miller [Thu, 21 Oct 2004 16:31:19 +0000 (16:31 +0000)]
Kill set_perms() stub--it is no longer needed.

20 years agostay_setuid now requires set_reuid() or setresuid()
Todd C. Miller [Wed, 13 Oct 2004 16:52:51 +0000 (16:52 +0000)]
stay_setuid now requires set_reuid() or setresuid()

20 years agoKill use of POSIX saved uids; they aren't worth bothering with.
Todd C. Miller [Wed, 13 Oct 2004 16:46:19 +0000 (16:46 +0000)]
Kill use of POSIX saved uids; they aren't worth bothering with.

20 years agoremove call to issetugid()
Todd C. Miller [Thu, 7 Oct 2004 20:23:06 +0000 (20:23 +0000)]
remove call to issetugid()

20 years agoRemove warning about wildcards. Now that we use glob() the bug is fixed.
Todd C. Miller [Thu, 7 Oct 2004 18:57:41 +0000 (18:57 +0000)]
Remove warning about wildcards.  Now that we use glob() the bug is fixed.

20 years agoUse glob(3) instead of fnmatch(3) for matching pathnames and stat each
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.

20 years agoDefine HAVE_EXTENDED_GLOB for extended glob (GLOB_TILDE and GLOB_BRACE)
Todd C. Miller [Thu, 7 Oct 2004 18:27:49 +0000 (18:27 +0000)]
Define HAVE_EXTENDED_GLOB for extended glob (GLOB_TILDE and GLOB_BRACE)

20 years agoCheck for a glob() that supports GLOB_BRACE and GLOB_TILDE
Todd C. Miller [Thu, 7 Oct 2004 16:59:54 +0000 (16:59 +0000)]
Check for a glob() that supports GLOB_BRACE and GLOB_TILDE

20 years agoreference glob
Todd C. Miller [Thu, 7 Oct 2004 16:51:56 +0000 (16:51 +0000)]
reference glob

20 years ago4.4BSD glob(3) with fixes from OpenBSD and some unneeded extensions removed.
Todd C. Miller [Thu, 7 Oct 2004 16:50:34 +0000 (16:50 +0000)]
4.4BSD glob(3) with fixes from OpenBSD and some unneeded extensions removed.

20 years ago4.4BSD glob(3) with fixes from OpenBSD and some unneeded extensions removed.
Todd C. Miller [Thu, 7 Oct 2004 16:50:34 +0000 (16:50 +0000)]
4.4BSD glob(3) with fixes from OpenBSD and some unneeded extensions removed.

20 years agoJust return if STRIOCINJECT or STRIOCREPLACE fail. It probably means
Todd C. Miller [Tue, 5 Oct 2004 21:26:38 +0000 (21:26 +0000)]
Just return if STRIOCINJECT or STRIOCREPLACE fail.  It probably means
we are out of space in the stack gap...

20 years agosync
Todd C. Miller [Tue, 5 Oct 2004 21:20:06 +0000 (21:20 +0000)]
sync

20 years agoTake a stab at ldap sudoers support here.
Todd C. Miller [Tue, 5 Oct 2004 20:53:29 +0000 (20:53 +0000)]
Take a stab at ldap sudoers support here.

20 years agoDetach from tracee on SIGHUP, SIGINT and SIGTERM. Now "sudo reboot"
Todd C. Miller [Tue, 5 Oct 2004 19:13:56 +0000 (19:13 +0000)]
Detach from tracee on SIGHUP, SIGINT and SIGTERM.  Now "sudo reboot"
doesn't cause reboot to inadvertanly kill itself.

20 years agoput "monitor" in the proctitle, not "systrace"
Todd C. Miller [Tue, 5 Oct 2004 18:21:26 +0000 (18:21 +0000)]
put "monitor" in the proctitle, not "systrace"

20 years agoWhen modifying the environment, don't replace envp when we can get
Todd C. Miller [Tue, 5 Oct 2004 18:15:35 +0000 (18:15 +0000)]
When modifying the environment, don't replace envp when we can get
away with just rewriting pointers in the traced process.

20 years agoAdd environment updating via STRIOCINJECT (if available).
Todd C. Miller [Tue, 5 Oct 2004 17:46:22 +0000 (17:46 +0000)]
Add environment updating via STRIOCINJECT (if available).

20 years agoregen
Todd C. Miller [Tue, 5 Oct 2004 14:22:26 +0000 (14:22 +0000)]
regen

20 years agoregen
Todd C. Miller [Mon, 4 Oct 2004 20:15:38 +0000 (20:15 +0000)]
regen

20 years agoFix bug introduced in unput() removal; want yyless(0) not yyless(1)
Todd C. Miller [Mon, 4 Oct 2004 20:15:29 +0000 (20:15 +0000)]
Fix bug introduced in unput() removal; want yyless(0) not yyless(1)

20 years agoInclude file is now mon_systrace.h
Todd C. Miller [Mon, 4 Oct 2004 16:09:45 +0000 (16:09 +0000)]
Include file is now mon_systrace.h

20 years agoNo longer call it tracing, it is now "monitoring" which should be more
Todd C. Miller [Mon, 4 Oct 2004 16:07:19 +0000 (16:07 +0000)]
No longer call it tracing, it is now "monitoring" which should be more
a obvious name to non-hackers.

20 years agoFix some XXX
Todd C. Miller [Fri, 1 Oct 2004 19:06:44 +0000 (19:06 +0000)]
Fix some XXX

20 years agoNo need to include syscall.h, use 1024 as the max # of entries (the
Todd C. Miller [Fri, 1 Oct 2004 18:30:20 +0000 (18:30 +0000)]
No need to include syscall.h, use 1024 as the max # of entries (the
max that systrace(4) allows).

Only need to use SYSTR_POLICY_ASSIGN once

Change check_syscall() -> find_handler() and have it return the
handler instead of just running it.  We need this since handler now
have two parts: one part that generates and answer and another that
gets called after the answer is accepted (to do logging).

Add some missing check_exec for emul execv

20 years agoAdd $Sudo$ tags.
Todd C. Miller [Fri, 1 Oct 2004 14:58:15 +0000 (14:58 +0000)]
Add $Sudo$ tags.

20 years agoAdd missing HAVE_LINUX_SYSTRACE_H
Todd C. Miller [Fri, 1 Oct 2004 14:47:14 +0000 (14:47 +0000)]
Add missing HAVE_LINUX_SYSTRACE_H

20 years agoadd trace_systrace.o dependency
Todd C. Miller [Fri, 1 Oct 2004 00:46:21 +0000 (00:46 +0000)]
add trace_systrace.o dependency

20 years agoAlso look for systrace.h in /usr/include/linux
Todd C. Miller [Thu, 30 Sep 2004 23:00:25 +0000 (23:00 +0000)]
Also look for systrace.h in /usr/include/linux

20 years agoMove all struct defs and prototypes into trace_systrace.h and mark all
Todd C. Miller [Thu, 30 Sep 2004 22:27:33 +0000 (22:27 +0000)]
Move all struct defs and prototypes into trace_systrace.h and mark all
but systace_attach() static.

20 years agoAdd support for tracing emulations. At the moment, all emulations are
Todd C. Miller [Thu, 30 Sep 2004 22:14:34 +0000 (22:14 +0000)]
Add support for tracing emulations.  At the moment, all emulations are
compiled in.  It might make sense to #ifdef them in the future, though
this impeeds readability.

20 years agorename systrace.c -> trace_systrace.c
Todd C. Miller [Thu, 30 Sep 2004 21:07:36 +0000 (21:07 +0000)]
rename systrace.c -> trace_systrace.c

20 years agoAllow this to build with a K&R compiler again
Todd C. Miller [Thu, 30 Sep 2004 19:58:10 +0000 (19:58 +0000)]
Allow this to build with a K&R compiler again

20 years agosync
Todd C. Miller [Thu, 30 Sep 2004 17:58:36 +0000 (17:58 +0000)]
sync

20 years agoUse __attribute__((__noreturn__))
Todd C. Miller [Thu, 30 Sep 2004 17:55:21 +0000 (17:55 +0000)]
Use __attribute__((__noreturn__))

20 years agoExit() takes a negative value to indicate it was not called via signal.
Todd C. Miller [Thu, 30 Sep 2004 17:44:24 +0000 (17:44 +0000)]
Exit() takes a negative value to indicate it was not called via signal.

20 years agoregen
Todd C. Miller [Thu, 30 Sep 2004 17:25:51 +0000 (17:25 +0000)]
regen

20 years agoDefine Err() and Errx() that are like err() and errx() but call Exit()
Todd C. Miller [Thu, 30 Sep 2004 17:22:37 +0000 (17:22 +0000)]
Define Err() and Errx() that are like err() and errx() but call Exit()
instead of exit().  Build private copy of alloc.o for visudo that calls
Err() and Errx().

20 years agoregen
Todd C. Miller [Wed, 29 Sep 2004 19:22:38 +0000 (19:22 +0000)]
regen

20 years agosync
Todd C. Miller [Wed, 29 Sep 2004 19:22:15 +0000 (19:22 +0000)]
sync

20 years agoOverhaul visudo for editing multiple files:
Todd C. Miller [Wed, 29 Sep 2004 18:41:38 +0000 (18:41 +0000)]
Overhaul visudo for editing multiple files:
 o visudo has been broken out into functions (more work needed here)
 o each file is now edited before sudoers is re-parsed
 o if a #include line is added that file will be edited too

TODO:
 o cleanup temp files when exiting via err() or errx()
 o continue breaking things out into separate functions

20 years agoAdd keepopen arg to open_sudoers that open_sudoers can use to
Todd C. Miller [Wed, 29 Sep 2004 18:36:33 +0000 (18:36 +0000)]
Add keepopen arg to open_sudoers that open_sudoers can use to
indicate to the caller that the fd should not be closed when it
is done with it.  To be used by visudo to keep locked fds from
being closed prematurely (and thus losing the lock).

20 years agoAdd errorfile global that contains the name of the file that caused the
Todd C. Miller [Wed, 29 Sep 2004 18:33:06 +0000 (18:33 +0000)]
Add errorfile global that contains the name of the file that caused the
error.

20 years agoreturn COMMENT to yacc grammar for a #include line
Todd C. Miller [Wed, 29 Sep 2004 18:30:49 +0000 (18:30 +0000)]
return COMMENT to yacc grammar for a #include line

20 years agoRemove us of unput() in favor of yyless() which is cheaper.
Todd C. Miller [Wed, 29 Sep 2004 18:29:40 +0000 (18:29 +0000)]
Remove us of unput() in favor of yyless() which is cheaper.

20 years agoAllow an empty sudoers file.
Todd C. Miller [Wed, 29 Sep 2004 18:28:46 +0000 (18:28 +0000)]
Allow an empty sudoers file.

20 years agoRewind sudoers_fp now that sudoers_lookup() doesn't do it for us.
Todd C. Miller [Tue, 28 Sep 2004 20:50:33 +0000 (20:50 +0000)]
Rewind sudoers_fp now that sudoers_lookup() doesn't do it for us.

20 years agoregen
Todd C. Miller [Tue, 28 Sep 2004 18:37:08 +0000 (18:37 +0000)]
regen

20 years agoDo signal setup before calling edit_sudoers().
Todd C. Miller [Tue, 28 Sep 2004 18:36:29 +0000 (18:36 +0000)]
Do signal setup before calling edit_sudoers().
Don't shadow the "quiet" global.

20 years agoIf a sudoers file includes other files, edit those too.
Todd C. Miller [Tue, 28 Sep 2004 18:33:06 +0000 (18:33 +0000)]
If a sudoers file includes other files, edit those too.
Does not yes deal with creating the new includes files itself.

20 years agoinit_parser now takes a path
Todd C. Miller [Tue, 28 Sep 2004 18:31:38 +0000 (18:31 +0000)]
init_parser now takes a path

20 years agoMore scaffolding for dealing with multiple sudoers files:
Todd C. Miller [Tue, 28 Sep 2004 18:31:24 +0000 (18:31 +0000)]
More scaffolding for dealing with multiple sudoers files:
 o init_parser() now takes a path used to populate the sudoers global
 o the sudoers global is used to print the correct file in yyerror()
 o when switching to a new sudoers file, perserve old file name and line number

20 years agoKill _PATH_SUDOERS_TMP; it is not meaningful now that we can have multiple
Todd C. Miller [Tue, 28 Sep 2004 18:29:05 +0000 (18:29 +0000)]
Kill _PATH_SUDOERS_TMP; it is not meaningful now that we can have multiple
sudoers files.

20 years agoRewind sudoers_fp in open_sudoers() instead of sudoers_lookup() so
Todd C. Miller [Tue, 28 Sep 2004 17:52:59 +0000 (17:52 +0000)]
Rewind sudoers_fp in open_sudoers() instead of sudoers_lookup() so
we start at the right file position when reading include files.