Commit Graph

69 Commits

Author SHA1 Message Date
Todd C. Miller
4bc46dc93f regen 2004-08-11 18:29:36 +00:00
Todd C. Miller
bf4f5913d7 regen 2004-08-02 18:45:31 +00:00
Todd C. Miller
2087367461 regen 2004-06-08 19:56:01 +00:00
Todd C. Miller
517d8af5e2 regen 2004-06-08 17:54:05 +00:00
Todd C. Miller
0543ced785 regen 2004-06-06 23:58:35 +00:00
Todd C. Miller
983bdcb223 regen 2004-06-06 20:22:56 +00:00
Todd C. Miller
f8e2108d41 regen 2004-06-05 17:42:16 +00:00
Todd C. Miller
a30d516f68 regen 2004-04-05 16:50:00 +00:00
Todd C. Miller
a872ff0460 regen 2004-02-13 21:37:02 +00:00
Todd C. Miller
a39a63f4fb Regen w/ updated byacc from OpenBSD; fixes a gcc 3.2 issue with generated code. 2004-01-06 06:42:14 +00:00
Todd C. Miller
db230cc520 Merge the NOPASSWD/PASSWD and NOEXEC/EXEC rules so that order is not
important.
2004-01-05 19:56:43 +00:00
Todd C. Miller
8e421c95b8 update copyright year 2004-01-05 17:15:32 +00:00
Todd C. Miller
7536a781f0 Add support for preloading a shared object containing a dummy execve()
function that just sets error and returns -1.  This adds a
"noexec_file" option to load the filename as well as a "noexec" flag
to enable it unconditionally.  There is also a NOEXEC tag that can
be attached to specific commands and an EXEC tag to disable it.
2004-01-05 02:48:09 +00:00
Todd C. Miller
6ad252765b Create def_* macros for each defaults value so we no longer need
the def_{flag,ival,str,list,mode} macros (which have been removed).
This is a step toward more flexible data types in def_data.in.
2003-12-30 22:20:21 +00:00
Todd C. Miller
a822179f56 regen 2003-03-13 20:02:20 +00:00
Todd C. Miller
26d9f4856f regen 2003-01-17 23:10:05 +00:00
Todd C. Miller
d26b608279 regen 2002-11-28 23:43:35 +00:00
Todd C. Miller
08ee411a6b regen 2002-03-16 00:45:48 +00:00
Todd C. Miller
e86de64967 regen 2001-12-30 18:45:41 +00:00
Todd C. Miller
53320cadda regen 2001-12-21 21:49:28 +00:00
Todd C. Miller
722cebb5c4 regen 2001-12-14 19:59:57 +00:00
Todd C. Miller
d684d37a95 regen parser 2001-12-12 20:11:47 +00:00
Todd C. Miller
d956d77528 Move defaults info into its own files from which we generate
.h and .c files.  This makes adding or rearranging variables
much simpler.
2000-12-31 01:38:37 +00:00
Todd C. Miller
1eeb9cb963 When checking to see if the host/user matches in a defaults spec, check
against TRUE, not just non-zero since it might be -1.
2000-03-24 23:58:59 +00:00
Todd C. Miller
ffca544b6c Fully qualified hosts w/ wildcards were not matching the FQHOST token type.
There's really no need for a separate token for fully-qualified vs.
unqualified anymore so FQHOST is now history and hostname_matches
now decides which hostname (short or long) to check based on whether
or not the pattern contains a '.'.
2000-03-23 04:38:22 +00:00
Todd C. Miller
5ce1fa96f2 Add support for wildcards in the hostname. 2000-03-23 04:09:53 +00:00
Todd C. Miller
30c5e442ff fix a yacc (skeleton.c) warning 2000-01-28 01:41:33 +00:00
Todd C. Miller
9abb89750c Regen with yacc that has a memory leak plugged. 2000-01-26 23:14:18 +00:00
Todd C. Miller
0b59a0974d netgr_matches needs to check shost as well as host since they may be different. 2000-01-11 18:20:41 +00:00
Todd C. Miller
625e3e46d0 Make treatment of -l and -v sane wrt NOPASSWD flags. Now allow -l w/o a passwd
if there is *any* entry for the user on the host with a NOPASSWD flag.
For -v, only allow w/o a passwd if *all* entries for the user on the host
w/ the specified runas user have the NOPASSWD flag set.
2000-01-03 04:43:33 +00:00
Todd C. Miller
34d793254d fix parsing of runas lists:
o oprunasuser and runaslist now return a value
o in a runasspec, if a runaslist does not return TRUE, set runas_matches to
  FALSE.  Normally, a runaslist only returns FALSE for explicitly denied
  users.
o since runaslist does not modify the stack there is no need for a push/pop
  in runasalias.
1999-12-05 19:06:09 +00:00
Todd C. Miller
7769bf6a32 o Change defaults stuff to put the value right in the struct.
o Implement mailer_flags
o Store syslog stuff both in int and string form.  Setting the string
  form magically updates the int version.
o Add boolean attribute to strings where it makes sense to say !foo
1999-10-07 21:21:08 +00:00
Todd C. Miller
13bf42675d Add support for "Defaults" line in sudoers to make configuration variables
changable at runtime (and on a global, per-host and per-user basis).
Both the names and the internal representation are still subject to change.
It was necessary to make sudo_user.runas but a char ** instead of a
char * since this value can be changed by a Defaults line.  There is a
similar (but more complicated) issue with sudo_user.prompt but it
is handled differently at the moment.

Add a "-L" flag to list the name of options with their descriptions.  This
may only be temporary.

Move some prototypes to parse.h

Be much less restrictive on what is allowed for a username.
1999-09-08 08:06:28 +00:00
Todd C. Miller
3a8c0ca966 include strings.h everywhere we include string.h 1999-08-28 09:24:15 +00:00
Todd C. Miller
2b28160a5d minor change to first line printed in -l mode 1999-08-26 09:10:50 +00:00
Todd C. Miller
0d38bef9a7 include strcasecmp() for those without it 1999-08-24 17:37:38 +00:00
Todd C. Miller
25d75cea68 these should be generated with byacc, not bison 1999-08-24 16:40:58 +00:00
Todd C. Miller
51350b2c79 In "sudo -l" mode, the type of the stored (expanded) alias was not
stored with the contents.  This could lead to incorrect output
if the sudoers file had different alias types with the same name.
Normal parsing (ie: not in '-l' mode) is unaffected.
1999-08-24 15:58:39 +00:00
Todd C. Miller
bc65b24ed3 regen 1999-08-20 20:32:07 +00:00
Todd C. Miller
804e168d90 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.
1999-08-17 15:29:47 +00:00
Todd C. Miller
b28ac86ab8 In pedantic mode we need to save *all* the aliases, not just those
that match, or we get spurious warnings.
1999-08-17 12:47:53 +00:00
Todd C. Miller
3a8b0be635 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
1999-08-14 15:34:55 +00:00
Todd C. Miller
2386dc1b45 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.
1999-08-12 14:37:27 +00:00
Todd C. Miller
2ce523cd1f 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.
1999-08-09 22:25:17 +00:00
Todd C. Miller
b4a7c5507a parse.yacc 1999-08-09 14:34:23 +00:00
Todd C. Miller
16ab377018 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)
1999-08-04 17:28:47 +00:00
Todd C. Miller
0d5a675f5b regen 1999-08-04 15:31:47 +00:00
Todd C. Miller
0d732401f4 add 4th term to license similar to term 5 in the apache license 1999-07-31 16:19:50 +00:00
Todd C. Miller
7126759483 regen 1999-07-22 13:12:27 +00:00
Todd C. Miller
d22fe7a98d regen 1999-07-08 10:46:46 +00:00