Todd C. Miller [Thu, 19 Aug 1999 16:30:09 +0000 (16:30 +0000)]
sudoers_lookup() now returns a bitmap instead of an int. This makes it
possible to express things like "failed to validate because user not listed
for this host". Some thigns that were previously VALIDATE_FOO are now
FLAG_FOO. This may change later on.
Reorganized code in log_auth() and sudo.c to deal with above changes.
Safer versions of push/pushcp with in the do { ... } while (0) style
parse.yacc now saves info on the stack to allow parse.c to determine
if a user was listed, but not for the host he/she tried to run on.
Todd C. Miller [Tue, 17 Aug 1999 15:29:47 +0000 (15:29 +0000)]
o NewArgv and NewArgc don't need to be externally visible.
o If pedantic > 1, it is a parse error.
o Add -s (strict) option to visudo which sets pedantic to 2.
Todd C. Miller [Sat, 14 Aug 1999 15:36:47 +0000 (15:36 +0000)]
In struct sudo_auth, turn need_root and configured into flags and
add a flag to specify an auth method is running alone (the only
one). Pass auth methods their sudo_auth pointer, not the data
pointer. This allows us to get at the flags and tell if we are the
only auth method. That, in turn, allows the method to be able to
decide what should/should not be a fatal error. Currently only
rfc1938 uses it this way, which allows us to kill the OTP_ONLY
define and te hackery that went with it. With access to the
sudo_auth struct, methods can also get at a string holding their
cannonical name (useful in error messages).
Todd C. Miller [Sat, 14 Aug 1999 15:34:55 +0000 (15:34 +0000)]
o --with-otp deprecated, use --without-passwd instead
o real dependencies in the Makefile
o --with-devel option to enable yacc, lex, and -Wall
o style -- "foo -> bar" becomes "foo->bar"
o ALL goes back to being a token, not a string but don't leak memory
o rename hsotspec -> host in parse.yacc
Todd C. Miller [Thu, 12 Aug 1999 16:24:10 +0000 (16:24 +0000)]
o Digital UNIX needs to check for *snprintf() before -ldb is added to LIBS
since -ldb includes a bogus snprintf().
o Add forward refs for struct mbuf and struct rtentry for Digital UNIX.
o Reorder some functions in snprintf.c to fix -Wall
o Add missing includes to fix more -Wall
Todd C. Miller [Thu, 12 Aug 1999 14:37:27 +0000 (14:37 +0000)]
o Add a "pedentic" flag to the parser. This makes sudo warn in cases
where an alias may be used before it is defined. Only turned on for visudo
and testsudoers.
o Add --disable-authentication option that makes sudo not require
authentication by default. The PASSWD tag can be used to require
authentication for an entry. We no longer overload --without-passwd.
Todd C. Miller [Thu, 12 Aug 1999 14:29:12 +0000 (14:29 +0000)]
Break 'WORD' regexp def into HOSTNAME and USERNAME. These days a
username can contain just about anything so be very permissive.
Also drop the unused \. punctuation.
Todd C. Miller [Mon, 9 Aug 1999 22:25:17 +0000 (22:25 +0000)]
o add a 'val' element to aliasinfo struct and move -> parse.h
o find_alias() now returns an aliasinfo * instead of boolean
o add_alias() now takes a value parameter to store in the aliasinfo.val
o The cmnd, hostspec, runasuser, and user rules now return:
1) positive match
0) negative match (due to '!')
-1) no match
This means setting $$ explicitly in all cases, which I should have done in
the first place. It also means that we always store a value that is != -1
and when we see a '!' we can set *_matches to !rv if rv != -1.
The upshot of all of this is that '!' now works the way it should in
lists and some of the rules are more uniform and sensible.
Todd C. Miller [Mon, 9 Aug 1999 14:35:53 +0000 (14:35 +0000)]
Allow a list of users as the first thing in a user spec, not just a
single entry. This makes things more uniform, though it does allow
you to write user specs that are hard to read.
Todd C. Miller [Sat, 7 Aug 1999 09:59:43 +0000 (09:59 +0000)]
o Move lock_file() and touch() into fileops.c so visudo can use them
o Visudo now locks the sudoers temp file instead of bailing when
the temp file already exists. This fixes the problem of stale
temp files but it does *require* that you not try to put the
temp file in a world-writable directory. This shoud not be
an issue as the temp file should live in the same dir as sudoers.
o Visudo now only installs the temp file as sudoers if it changed.
Todd C. Miller [Fri, 6 Aug 1999 09:37:03 +0000 (09:37 +0000)]
o /etc/stmp -> /etc/sudoers.tmp since solaris uses stmp as shadow temp file
o _PATH_SUDO_SUDOERS -> _PATH_SUDOERS and _PATH_SUDO_STMP -> _PATH_SUDOERS_TMP
Todd C. Miller [Thu, 5 Aug 1999 10:55:14 +0000 (10:55 +0000)]
Sigh, some versions of make (like Solaris's) don't deal with $< like
I would expect. Both GNU and BSD makes get this right but...
So, we just expand $< inline at the cost of some ugliness.
Todd C. Miller [Wed, 4 Aug 1999 17:28:47 +0000 (17:28 +0000)]
o Add '!' correctly when expanding Aliases.
o Add shortcut macros for append() to make things more readable.
o The separator in append() is now a string instead of a char.
o In append(), only prepend the separator if the last char is not a '!'.
This is a hack but it greatly simplifies '!' handling.
o In -l mode, Runas lists and NOPASSWD/PASSWD tags are now inherited
across entries in a list (matches current behavior).
o Fix formatting in -l mode such that items in a list are separated by
a space. Greatlt improves readability.
o Space for name field in struct aliasinfo is now allocated dyanically
instead of using a (big) buffer.
o In add_alias(), only search the list once (lsearch instead of lfind + lsearch)
Todd C. Miller [Wed, 4 Aug 1999 09:35:56 +0000 (09:35 +0000)]
o Simpler '!' support now that the lexer deals with multiple !'s for us.
o In the case of opFOO, have FOO give a boolean return value and set
foo_matches in opFOO, not FOO.
o Treat 'ALL' as a string since it gets fill()'d in parse.lex--fixes a
small memory leak. In the long run it may be better to just fix parse.lex
and make ALL back into a token. However, having it be a string is useful
since it can be easily passed back to the parent rule if we so desire.
Todd C. Miller [Wed, 4 Aug 1999 07:54:34 +0000 (07:54 +0000)]
o Remove some unnecessary backslashes
o collapse multiple !'s by using !+ and checking if yyleng is even or odd.
this allows us to simplify ! handling in parse.yacc
Todd C. Miller [Wed, 28 Jul 1999 09:21:00 +0000 (09:21 +0000)]
Use dirs instead of files for timestamp. This allows tty and non-tty
schemes to coexist reasonably. Note, however, that when you update
a tty ticket, the mtime on the user dir gets updated as well.
Todd C. Miller [Wed, 28 Jul 1999 09:17:14 +0000 (09:17 +0000)]
Fix getprpwnam() checking on SCO. Need to link with "-lprot -lx" when
linking test program, not just -lprot. Also add check for getspnam().
The SCO docs indicate that /etc/shadow can be used but this may be a lie.
Todd C. Miller [Thu, 22 Jul 1999 19:48:27 +0000 (19:48 +0000)]
auth API change. There is now an init method that gets run before
the main loop. This allows auth routines to differentiate between
initialization that happens once vs. setup that needs to run each time
through the loop.
Todd C. Miller [Thu, 22 Jul 1999 13:01:20 +0000 (13:01 +0000)]
o Document -K flag and update meaning of -k flag.
o BSD-style copyright
o Document clearing of BIND resolver environment variables
o Clarify bit about shared libs
o suggest rc files create /tmp/.odus if your OS gives away files
Todd C. Miller [Thu, 22 Jul 1999 12:55:17 +0000 (12:55 +0000)]
o no longer contains sudo 1.1/1.2 code
o BSD copyright
o use new logging routines
o simplified flow of control
o BIND resolver additions to badenv_table
Todd C. Miller [Thu, 22 Jul 1999 12:46:29 +0000 (12:46 +0000)]
o tgetpass.c is no longer optional
o kill DCE_OBJS, add AUTH_OBJS
o kill --disable-tgetpass
o add --without-passwd
o changes to fill in AUTH_OBJS for new auth api
o check for strerror(), v?snprintf() and v?asprintf()
o replace --with-AuthSRV with --with-fwtk