Todd C. Miller
05767145b3
Add fuzzer-specific stubs source file.
2021-02-24 16:43:59 -07:00
Todd C. Miller
a56f7daeea
Split iolog_util.c into iolog_loginfo.c and iolog_timing.c.
...
Also rename check_iolog_util -> check_iolog_timing.
2021-02-24 14:40:33 -07:00
Todd C. Miller
2a657e2a12
Move legacy I/O log info file parsing to iolog_legacy.c
2021-02-24 14:34:14 -07:00
Todd C. Miller
4128582723
Move eventlog config code into eventlog_conf.c
2021-02-24 14:25:39 -07:00
Todd C. Miller
f399c449ad
Move eventlog_free() into its own file.
2021-02-24 13:59:17 -07:00
Todd C. Miller
cbd11c44d2
Update Defaults settings after parsing sudoers.
...
Also stub out dump_defaults when fuzzing as it is not used.
2021-02-24 12:29:34 -07:00
Todd C. Miller
5a85543c16
Move alias checking code out of visudo.c and into check_aliases.c.
2021-02-23 18:42:37 -07:00
Todd C. Miller
081e219e23
Add dictionary files for fuzzers where possible.
2021-02-23 11:28:47 -07:00
Todd C. Miller
d235083342
Add simple fuzzer for sudo_logsrvd.conf parser.
2021-02-15 15:52:17 -07:00
Todd C. Miller
25f50e2f07
Add simple fuzzer for sudo.conf parser.
2021-02-15 13:17:26 -07:00
Todd C. Miller
ea7a70e85d
For "make fuzz" only fuzz the seed corpus.
...
This way we avoid files generated by the fuzzer itself.
2021-02-15 07:35:19 -07:00
Todd C. Miller
df2931588a
Fuzz sudoers policy module API.
...
Includes a test case to reproduce CVE-2021-3156.
2021-02-12 15:36:18 -07:00
Todd C. Miller
1f97ef92b7
Move audit.c from libparsesudoers to the sudoers module itself.
...
Now that audit.c contains the audit module it doesn't belong in
libparsesudoers.
2021-02-12 11:13:52 -07:00
Todd C. Miller
41fa461fe1
Add a GNU-compatible version of basename(3).
...
Unlike POSIX basename(3), the GNU variant does not modify its argument.
Note that basename of a path ending in "/" returns an empty string.
2021-02-10 14:26:26 -07:00
Todd C. Miller
63a3f62547
Add fuzz Makefile target and run fuzzer corpus in make check.
2021-02-08 04:56:17 -07:00
Todd C. Miller
30d9497eb6
Add stub library that just feeds files to the fuzzing target.
...
This will allow the fuzzers to be run as part of "make check".
2021-02-07 15:43:51 -07:00
Todd C. Miller
1c02c14c35
Add more test files for fuzzers.
2021-02-05 19:30:00 -07:00
Todd C. Miller
5c2a21350d
fuzzer for I/O log timing files
2021-02-04 19:22:15 -07:00
Todd C. Miller
d2901f4121
Add fuzzer for legacy I/O log info file.
2021-02-03 07:41:20 -07:00
Todd C. Miller
f30670a42f
Plug a few more parser leaks.
2021-02-01 19:56:52 -07:00
Todd C. Miller
1e3cecc608
Add initial fuzzers to be used by oss-fuzz.
...
These are not yet hooked up to the sudo build.
2021-02-01 15:17:57 -07:00
Todd C. Miller
8f114c2aae
Add plugins/sudoers/strvec_join.c
2021-01-28 16:25:48 -07:00
Todd C. Miller
2804c2c78e
Add strlcpy_unescape() function to undo escaping from front-end.
...
Includes unit test.
2021-01-27 15:41:54 -07:00
Todd C. Miller
a5be62c68f
Move safe open code out of sudo_edit.c and into edit_open.c.
2021-01-06 13:01:09 -07:00
Todd C. Miller
06bfbecd64
Add emulation of pread(3) and pwrite(3) for systems without them.
...
This makes it possible to remove some ugly #ifdefs and only affects
very old systems.
2021-01-02 10:43:34 -07:00
Todd C. Miller
e56c3b342b
Rename iolog_plugin.h to log_client.h.
...
It is no longer I/O log specific and is used by sudoers_audit too.
2020-11-09 17:13:04 -07:00
Todd C. Miller
62547746d3
Rename iolog_client -> log_client.
...
The logsrvd client code is now used for more than just I/O logging.
2020-11-09 17:13:04 -07:00
Todd C. Miller
fdae4bdbbb
Add support for file log line wrapping in libeventlog.
2020-10-26 16:16:46 -06:00
Todd C. Miller
8c43340474
Use libeventlog in sudo_logsrvd.
2020-10-26 15:26:02 -06:00
Todd C. Miller
707437f6cb
Refactor eventlog code into a library
2020-10-26 15:24:35 -06:00
Todd C. Miller
32db528689
Add tests for entries without a newline.
2020-09-27 10:31:14 -06:00
Todd C. Miller
7a36d70fc1
Add test for syntax error when defining an alias using a reserved word.
2020-09-25 15:09:36 -06:00
Todd C. Miller
eaa95acb31
Post-process protoc-c files to avoid depending on anonymous unions.
...
Based on a patch from Michael Osipov.
GitHub issue #60
2020-09-04 13:17:51 -06:00
Todd C. Miller
a51d194a73
Add test of multiple syntax errors.
...
Where possible, the portion of the line before the error should be
still be interpreted.
2020-09-02 12:40:39 -06:00
Todd C. Miller
2adde428c5
Fix path to check_exptilde.c
2020-09-02 09:20:19 -06:00
Todd C. Miller
9ff960457a
Add support for runchroot and runcwd to "sudo -l" and cvtsudoers.
2020-09-01 06:26:05 -06:00
Todd C. Miller
86513c78b6
Unit test for exptilde
2020-09-01 06:26:05 -06:00
Todd C. Miller
6bdfd010d2
Add CHROOT and CWD sudoers options.
...
Also matching runchroot and runcwd Defaults settings.
2020-09-01 06:26:00 -06:00
Todd C. Miller
ce97ca28db
Use OpenBSD-compatible freezero() in place of explicit_bzero() + free()
2020-08-10 19:24:33 -06:00
Todd C. Miller
cef6e3687e
Switch from memset_s() -> explicit_bzero().
...
memset_s() (and all of Annex K) is likely to be removed from the
a future version of the standard.
2020-08-10 19:24:32 -06:00
Todd C. Miller
38e28dcbf5
Rename python_plugin.exp.in -> python_plugin.exp
...
There is nothing dynamic in this file.
2020-08-03 10:15:28 -06:00
Todd C. Miller
3b4d4ab8dd
Add missing python_plugin.exp.in file and remove unneeded __dso_public
...
This fixes building the python plugin on systems where the compiler
doesn't support symbol hiding (but wherethe linker does).
2020-08-03 09:53:12 -06:00
Todd C. Miller
d4739533fd
Add regress test to catch swapids() bug when called by iolog_mkdtemp()
2020-06-18 15:14:00 -06:00
Todd C. Miller
d003da33dd
Romanian translation from translationproject.org.
2020-06-11 15:15:58 -06:00
Todd C. Miller
741c6f274e
Add support for @include and @includedir
...
These are less confusing than #include and #includedir when the
hash character is also the comment character.
This commit also adds real parsing of include directives as opposed
to the pure lexer approach used previously. As a result, it is now
possible to include files with spaces by either using a double-quoted
string or escaping the space characters with a backslash.
2020-05-20 13:10:53 -06:00
Todd C. Miller
83d1bee918
Rename sudo_parse_host_port -> iolog_parse_host_port and mv to lib/iolog
...
It is not used outside of the I/O log client and server and the
host:port syntax may change in the future.
2020-05-11 08:47:54 -06:00
Todd C. Miller
7f2585ed0a
Plumb in codespell with a "make spell" target.
2020-05-07 07:50:11 -06:00
Todd C. Miller
009876bf36
Refactor the sudoedit code to copy files so it can be shared.
...
The SELinux sudoedit code now extends the destination file the
same way the non-SELinux version does.
2020-04-21 11:05:32 -06:00
Todd C. Miller
0a10c702be
Split sudo_logsrvd and the python plugin into their own packages.
2020-04-07 14:03:58 -06:00
Todd C. Miller
ee868776de
Include all python plugin files in MANIFEST, not the directory itself.
2020-04-07 14:10:36 -06:00