Todd C. Miller
d160dac355
Add test to exercise RunasSpec without a RunasUser.
2021-02-26 10:05:45 -07:00
Todd C. Miller
2e0ca52b50
Remove unused regress files.
2021-02-26 10:04:51 -07:00
Todd C. Miller
b3ef60312c
Don't try to run getters if we failed to parse the config file.
2021-02-26 05:37:50 -07:00
Todd C. Miller
3fc5932be0
Add a stub getaddrinfo(3) to avoid a DNS timeout in CIfuzz.
2021-02-25 21:12:03 -07:00
Todd C. Miller
8b545e561c
Fix runchroot, runcwd, tty_tickets. Add timestampowner.
2021-02-25 20:06:35 -07:00
Todd C. Miller
65b598602b
Only add command_info to garbage collector on successful return.
...
Otherwise it will be freed on failure.
2021-02-25 19:48:46 -07:00
Todd C. Miller
3595fd5504
Add user millert to group sudo, which is often the exempt group.
2021-02-25 19:41:31 -07:00
Todd C. Miller
d75db837bd
Add some defaults settings in sudo_file_parse().
...
We don't have a real policy file but we still want to exercise callbacks
in sudoers.c.
2021-02-25 19:40:46 -07:00
Todd C. Miller
48669edd35
Do not free sudo_user.iolog_{file,path} in sudo_user_free().
...
They are not dynamically allocated.
2021-02-25 19:37:27 -07:00
Todd C. Miller
80e223b6c8
Remove unnecessary warnings, we want to fail silently.
2021-02-25 16:15:47 -07:00
Todd C. Miller
df1b431110
No longer need to stub out eventlog config functions.
2021-02-25 16:08:55 -07:00
Todd C. Miller
f5d7db56e7
Call public getters in logsrvd.conf fuzzer and add to corpus.
...
Now exercises the syslog config erorr path.
2021-02-25 16:00:31 -07:00
Todd C. Miller
65df01dd71
Add more passes to policy fuzzer
...
Now execises list, list other user and show_version.
2021-02-25 15:27:46 -07:00
Todd C. Miller
b3b80fe6df
Implement sudoers_policy_deregister_hooks()
...
Register/deregister hooks in fuzz_policy and also call show_version().
2021-02-25 15:02:09 -07:00
Todd C. Miller
e6dc13229f
Add sudoers debug register/deregister.
2021-02-25 13:35:29 -07:00
Todd C. Miller
7bafd52fac
Remove unnecessary break statement.
2021-02-25 13:19:55 -07:00
Todd C. Miller
0d04bbdbe2
Include a sha384 digest in the test corpus.
2021-02-25 13:13:32 -07:00
Todd C. Miller
ea341e2d34
Parse sudoers file in the C locale.
2021-02-25 13:08:12 -07:00
Todd C. Miller
24e1774ce3
Add regress test with all current Defaults settings.
...
Currently skips SELinux and Solaris privilege settings.
2021-02-25 11:26:55 -07:00
Todd C. Miller
e7b414ce4e
Move env hooks into sudoers_hooks.c.
2021-02-24 19:09:46 -07:00
Todd C. Miller
f82890e5d7
No need to call check_defaults() and check_aliases() in quiet mode.
2021-02-24 19:09:16 -07:00
Todd C. Miller
b4e86a911f
sudoers_gc_init() is not currently used
2021-02-24 19:08:43 -07:00
Todd C. Miller
38c381a0cc
Split fmtsudoers.c into the parts used by sudoers plugin and cvtsudoers.
...
Only testsudoers and cvtsudoers use the full set of formatting functions.
2021-02-24 17:14:51 -07:00
Todd C. Miller
39e80e47ba
Check defaults settings too.
2021-02-24 16:44:15 -07:00
Todd C. Miller
05767145b3
Add fuzzer-specific stubs source file.
2021-02-24 16:43:59 -07:00
Todd C. Miller
792407fbe5
Do not overwrite existing ChangeLog file if there is no hg/git dir.
...
We don't want "make install" from a source tarball to nuke the ChangeLog.
2021-02-24 16:06:18 -07:00
Todd C. Miller
1ae4c1bf67
Remove fuzzer targets in "make clean"
2021-02-24 15:25:44 -07:00
Todd C. Miller
39774e2389
Ignore fuzzer targets
2021-02-24 15:23:16 -07:00
Todd C. Miller
a3f38fac0c
Set program name in fuzzers so we get consisten warnings.
2021-02-24 15:14:58 -07:00
Todd C. Miller
9d27880af8
Use real eventlog config fuctions instead of stubs.
2021-02-24 15:08:53 -07:00
Todd C. Miller
b93aad4e95
Move iolog info log writing to iolog_loginfo.c
2021-02-24 15:01:37 -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
dba37768bb
Stub out eventlog and iolog configuration setters.
2021-02-24 13:02:14 -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
33551acd1f
Split base64 encode/decode functions into separate source files.
...
They are independent functions.
2021-02-24 12:20:36 -07:00
Todd C. Miller
f35d9c8be1
fuzz_printf and fuzz_conversation can be stubs.
2021-02-24 11:31:43 -07:00
Todd C. Miller
9f5aed70a1
Exercise tilde expansion if used in runcwd or runchroot.
2021-02-23 19:37:19 -07:00
Todd C. Miller
c702957879
Move alias checking code out of visudo.c and into check_aliases.c.
2021-02-23 19:07:12 -07:00
Todd C. Miller
2a0ba4008c
Check aliases in fuzz_sudoers if the policy parsed correctly.
2021-02-23 18:48:47 -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
c71a397368
We don't need to link fuzz_sudoers with file.c.
2021-02-23 16:39:32 -07:00
Todd C. Miller
03e610dab5
Strings in dictionary files need to be quoted.
2021-02-23 12:38:02 -07:00
Todd C. Miller
081e219e23
Add dictionary files for fuzzers where possible.
2021-02-23 11:28:47 -07:00
Todd C. Miller
e0761b9e3b
Also free safe_cmnd so it doesn't leak.
2021-02-22 20:18:49 -07:00
Todd C. Miller
322e0b3693
Return NOT_FOUND from the set_cmnd_path() stub since we don't set user_cmnd.
...
The purpose of set_cmnd_path() is to reset user_cmnd based on a new
runchroot. For the stub version we don't modify user_cmnd and so
must not return a status of FOUND.
Fixes oss-fuzz issue #31250 which only affected the fuzzer and not sudo.
2021-02-22 19:53:08 -07:00
Todd C. Miller
5fc6b8c177
Fix fuzz_sudoers output matching.
2021-02-22 16:43:34 -07:00
Todd C. Miller
4adc11e335
Print "running" and "executed" lines to stderr like libfuzzer does.
2021-02-22 15:43:45 -07:00