summaryrefslogtreecommitdiff
path: root/parse.yacc
Commit message (Collapse)AuthorAgeFilesLines
* netgr_matches needs to check shost as well as host since they may be different.Todd C. Miller2000-01-111-3/+3
|
* Make treatment of -l and -v sane wrt NOPASSWD flags. Now allow -l w/o a passwdTodd C. Miller2000-01-031-0/+6
| | | | | | 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.
* fix parsing of runas lists:Todd C. Miller1999-12-051-13/+18
| | | | | | | | | 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.
* o Change defaults stuff to put the value right in the struct.Todd C. Miller1999-10-071-6/+6
| | | | | | | 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
* Add support for "Defaults" line in sudoers to make configuration variablesTodd C. Miller1999-09-081-28/+73
| | | | | | | | | | | | | | | | 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.
* include strings.h everywhere we include string.hTodd C. Miller1999-08-281-0/+3
|
* minor change to first line printed in -l modeTodd C. Miller1999-08-261-1/+2
|
* include strcasecmp() for those without itTodd C. Miller1999-08-241-4/+0
|
* In "sudo -l" mode, the type of the stored (expanded) alias was notTodd C. Miller1999-08-241-5/+13
| | | | | | 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.
* sudoers_lookup() now returns a bitmap instead of an int. This makes itTodd C. Miller1999-08-191-9/+17
| | | | | | | | | | | | | | | 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. Added --with-mail-if-no-host option
* o NewArgv and NewArgc don't need to be externally visible.Todd C. Miller1999-08-171-11/+38
| | | | | o If pedantic > 1, it is a parse error. o Add -s (strict) option to visudo which sets pedantic to 2.
* In pedantic mode we need to save *all* the aliases, not just thoseTodd C. Miller1999-08-171-5/+5
| | | | that match, or we get spurious warnings.
* o --with-otp deprecated, use --without-passwd insteadTodd C. Miller1999-08-141-26/+20
| | | | | | | | 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
* o Add a "pedentic" flag to the parser. This makes sudo warn in casesTodd C. Miller1999-08-121-12/+36
| | | | | | | | 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.
* o add a 'val' element to aliasinfo struct and move -> parse.hTodd C. Miller1999-08-091-46/+90
| | | | | | | | | | | | | | 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.
* Allow a list of users as the first thing in a user spec, not just aTodd C. Miller1999-08-091-1/+1
| | | | | single entry. This makes things more uniform, though it does allow you to write user specs that are hard to read.
* o Add '!' correctly when expanding Aliases.Todd C. Miller1999-08-041-148/+159
| | | | | | | | | | | | | | 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)
* o Simpler '!' support now that the lexer deals with multiple !'s for us.Todd C. Miller1999-08-041-74/+71
| | | | | | | | | 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.
* add 4th term to license similar to term 5 in the apache licenseTodd C. Miller1999-07-311-0/+7
|
* BSD-style copyright. Move parser-specific defines and structs into parse.h ↵Todd C. Miller1999-07-221-127/+70
| | | | + other cosmetic changes
* Add contribution info in the main commentTodd C. Miller1999-07-121-1/+2
|
* only save an entry if user_matches && host_matches, even if the stack is ↵Todd C. Miller1999-07-081-3/+3
| | | | empty (fix for previous commit)
* 1) Always save an entry on the stack if it is empty. This fixes theTodd C. Miller1999-07-081-5/+10
| | | | | | | -l and -v flags that were broken by earlier parser changes. 2) In a Runas list, don't negate FALSE -> TRUE since that would make !foo match any time the user specified a runas user (via -u) other than foo.
* Move interface-related defines to interfaces.h so we don't have to includeTodd C. Miller1999-05-171-1/+0
| | | | <netinet/in.h> everywhere.
* o Replace _PASSWD_LEN braindeath with our own SUDO_MAX_PASS.Todd C. Miller1999-05-141-5/+5
| | | | | | | It turns out the old DES crypt does the right thing with passwords longert than 8 characters. o Fix common typo (necesary -> necessary) o Update TODO list
* Function names should be flush with the start of the line so they can be ↵Todd C. Miller1999-04-101-13/+26
| | | | found trivially in an editor and with grep
* free(3) is already void, no need to cast itTodd C. Miller1999-04-101-27/+27
|
* Stash the "safe" path (ie: the one listed in sudoers) to the command insteadTodd C. Miller1999-04-101-2/+4
| | | | of stashing the struct stat. Should be safer.
* You can now specifiy a host list instead of just a host or alias.Todd C. Miller1999-04-071-1/+1
| | | | | Ie: user = host1,host2,ALIAS,!host3 my_command now works.
* Move the push from the beginning of cmndspec to the end. This means weTodd C. Miller1999-04-071-13/+17
| | | | no longer have to do a push at the end of privilege, just reset some values.
* It is now possible to use the '!' operator in a runas list asTodd C. Miller1999-04-061-8/+28
| | | | well as in a Cmnd_Alias, Host_Alias and User_Alias.
* Add VALIDATE_NOT_OK_NOPASS for when user is not allowed to run a commandTodd C. Miller1999-04-061-36/+42
| | | | | | | | | but the NOPASSWD flag was set. Make runasspec, runaslist, runasuser, and nopasswd typeless in parse.yacc Add support for '!' in the runas list Fix double printing of '%' and '+' for groups and netgroups respectively Add *_matched macros (no need for local stack variable). Should only be used directly after a pop (since top must be >= 2).
* Crank version to 1.6 and combine copyright statementsTodd C. Miller1999-04-051-1/+1
|
* Make runas and NOPASSWD tags persistent across entris in a command list.Todd C. Miller1999-04-051-18/+38
| | | | | Add a PASSWD tag to reverse NOPASSWD. When you override a runas or *PASSWD tag the value given becomes the new default for the rest of the command list.
* Fix another parser bug. For a sudoers entry like this:Todd C. Miller1999-03-301-4/+4
| | | | | millert ALL=/bin/ls,(daemon) !/bin/ls sudo would not allow millert to run ls as root.
* Save entries that match a ! command on the matching stack tooTodd C. Miller1999-03-301-1/+1
|
* Fix off by one error introduced in *alloc changesTodd C. Miller1999-03-291-0/+2
|
* ++versionTodd C. Miller1999-03-291-1/+1
|
* Use emalloc/erealloc/estrdupTodd C. Miller1999-03-291-59/+19
|
* Still not right, this fixes it for realTodd C. Miller1999-03-291-9/+13
|
* Fix for previous commitTodd C. Miller1999-03-291-0/+2
|
* Fix a parser bug that was exposed when mixing different runas specsTodd C. Miller1999-03-291-0/+5
| | | | | | | | | | | | and ! commands. For example: millert ALL=(daemon) /usr/bin/whoami,!/bin/ls would allow millert to run whoami as root as well as daemon when it should just allow daemon. The problem was that comma-separated commands in a list shared the same entry on the matching stack. Now they get their own entry iff there is a full match. It may be better to just make the runas spec persistent across all commands in a list like the user and host entries of the matching stack. However, since that is a fairly major change it should gets its own minor rev increase.
* add cast for strdup in places it does not have itTodd C. Miller1999-02-111-2/+2
|
* add explicate copyrightTodd C. Miller1999-02-031-0/+1
|
* add sudo tagsTodd C. Miller1999-01-171-1/+1
|
* crank version and regen filesTodd C. Miller1999-01-171-1/+1
|
* never say "error on line -1"Todd C. Miller1998-11-281-2/+2
|
* make increases of cm_list_size and ga_list_size be similar toTodd C. Miller1998-11-201-2/+2
| | | | increases of stacksize (ie: >= not > in initial compare).
* when we get a syntax error, report it for the previous line sinceTodd C. Miller1998-11-201-2/+3
| | | | that's generally where the error occurred.
* more -WallTodd C. Miller1998-11-181-4/+4
|