Todd C. Miller
189817a313
Fix regexp for matching a CIDR-style IPv4 netmask. From Marc Espie.
2011-04-29 11:22:49 -04:00
Todd C. Miller
c6ad6d29e5
Treat a missing includedir like an empty one and do not return an error.
2011-04-14 14:27:11 -04:00
Todd C. Miller
c82e29f274
Add '!' token to lex tracing
2011-03-31 13:42:05 -04:00
Todd C. Miller
ca32055fd8
Avoid using pre or post increment in a parameter to a ctype(3)
...
function as it might be a macro that causes the increment to happen
more than once.
2011-03-31 12:48:01 -04:00
Todd C. Miller
041b1a896a
Add back missing #include of config.h
2011-03-28 14:50:55 -04:00
Todd C. Miller
e3ff59e506
Use bitwise AND instead of modulus to check for length being odd.
...
A newline in the middle of a string is an error unless a line
continuation character is used.
2011-03-27 17:12:45 -04:00
Todd C. Miller
45b82039be
Move lexer globals initialization into init_lexer.
2011-03-27 09:45:42 -04:00
Todd C. Miller
aed50b4d7b
Fix a potential crash when a non-regular file is present in an
...
includedir. Fixes bz #452
2011-03-27 09:27:43 -04:00
Todd C. Miller
31c164dae1
Make an empty group or netgroup a syntax error.
2011-03-24 11:00:30 -04:00
Todd C. Miller
784d0dda37
Allow a group ID in the User_Spec.
2011-03-24 10:37:34 -04:00
Todd C. Miller
fe1bc681ba
Return an error for the empty string when a word is expected.
...
Allow an ID for per-user or per-runas Defaults.
2011-03-23 18:51:57 -04:00
Todd C. Miller
06bf685b33
Restore ability to define TRACELEXER and have trace output go to stderr.
2011-03-21 17:57:38 -04:00
Todd C. Miller
a2297743aa
Restore old behavior of setting sawspace = TRUE for command line
...
args when a line continuation character is hit to avoid causing
problems for existing sudoers files.
2011-03-21 17:46:50 -04:00
Todd C. Miller
c7dd8399eb
If we match a rule anchored to the beginning of a line after parsing
...
a line continuation character, return an ERROR token. It would be
nicer to use REJECT instead but that substantially slows down the
lexer.
2011-03-21 12:48:33 -04:00
Todd C. Miller
edfb5cd7a2
Move LEXTRACE macro to toke.h so we can use it in yyerror().
2011-03-21 12:39:06 -04:00
Todd C. Miller
a27b3f3407
Make lex tracing settable at run-time in testsudoers via the -t
...
flag. Trace output goes to stderr. Will be used by regress tests
to check lexer.
2011-03-20 21:25:57 -04:00
Todd C. Miller
f083e72a57
Allow whitespace after the modifier in a Defaults entry.
...
E.g. "Defaults: username set_home"
2011-03-20 12:24:36 -04:00
Todd C. Miller
6170002e6f
We normaly transition from GOTDEFS to STARTDEFS on whitespace, but
...
if that whitespace is followed by a comma, we want to treat it as
part of a list and not transition.
2011-03-17 16:36:13 -04:00
Todd C. Miller
88e35a1932
Fix parsing of double-quoted names in Defaultd and Aliases which was
...
broken in 601d97ea8792.
2011-03-17 15:06:55 -04:00
Todd C. Miller
342e351d58
match quoted strings the same way whether in a Defaults line or as
...
a user/group/netgroup name. Fixes escaped double quotes in quoted
user/group/netgroup names.
2011-01-31 15:13:51 -05:00
Todd C. Miller
ae2f7638f5
standardize on "return foo;" rather than "return(foo);" or "return (foo);"
2011-01-24 15:15:18 -05:00
Todd C. Miller
f7f8b6867e
Update copyright year to 2011
2011-01-20 16:46:56 -05:00
Todd C. Miller
4cc6322b48
Move fill macro to toke.h
2011-01-08 19:34:31 -05:00
Todd C. Miller
400b6ffe20
Split tokenizer utility functions out into toke_util.c
2011-01-08 15:42:39 -05:00
Todd C. Miller
866ffd0bdb
ANSIfy
2011-01-08 15:15:30 -05:00
Todd C. Miller
39d1167f33
Include config.h before any other includes to make sure we get the
...
right value for _FILE_OFFSET_BITS.
2010-11-09 08:55:55 -05:00
Todd C. Miller
5403757edf
Add missing LOG_INPUT/LOG_OUTPUT support in the lexer.
2010-09-07 17:16:05 -04:00
Todd C. Miller
1229406720
Add %option noinput
2010-08-02 18:17:51 -04:00
Todd C. Miller
fd6b72f48e
Add suport for negated user/host/command lists in a Defaults entry.
...
E.g. Defaults:!baduser noexec
2010-07-07 14:33:27 -04:00
Todd C. Miller
30fe4a067c
Set usrinfo for AIX
...
Set adminstrative domain for the process when looking up user's
password or group info and when preparing for execve().
Include strings.h even if string.h exists since they may define
different things. Fixes warnings on AIX and others.
2010-06-29 13:08:05 -04:00
Todd C. Miller
27a94faf73
A comment character may not be part of a command line argument
...
unless it is quoted with a backslash. Fixes parsing of:
testuser ALL=NOPASSWD: /usr/bin/wl #comment foo bar
closes bz #441
2010-06-10 17:52:51 -04:00
Todd C. Miller
32d4697a89
Do not override value of keepopen global, instead restore it to the
...
value we pushed onto the stack when popping.
2010-06-10 16:36:41 -04:00
Todd C. Miller
303da7b820
If a file in a #includedir has improper permissions or owner just
...
skip it. This prevents packages that incorrectly install a file
into /etc/sudoers.d from breaking sudo so easily. Syntax errors
in #includedir files still result in a parse error (for now).
2010-06-08 16:53:38 -04:00
Todd C. Miller
d5ae4c7d87
Kill __P in sudoers
2010-03-17 19:56:27 -04:00
Todd C. Miller
9b0205846b
Initial bits of sudoers plugin; still needs work.
2010-03-14 19:58:47 -04:00
Todd C. Miller
e90fa482f9
Rework source layout in preparation for modular sudo.
2010-02-20 09:14:01 -05:00