Coverage Report

Created: 2025-10-13 06:08

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/sudo/plugins/sudoers/regress/fuzz/fuzz_stubs.c
Line
Count
Source
1
/*
2
 * Copyright (c) 2021 Todd C. Miller <Todd.Miller@sudo.ws>
3
 *
4
 * Permission to use, copy, modify, and distribute this software for any
5
 * purpose with or without fee is hereby granted, provided that the above
6
 * copyright notice and this permission notice appear in all copies.
7
 *
8
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
 */
16
17
#include <config.h>
18
19
#include <sys/socket.h>
20
21
#include <stdarg.h>
22
#include <stdio.h>
23
#include <stdlib.h>
24
#include <string.h>
25
#include <fcntl.h>
26
#include <pwd.h>
27
#include <unistd.h>
28
#if defined(HAVE_STDINT_H)
29
# include <stdint.h>
30
#elif defined(HAVE_INTTYPES_H)
31
# include <inttypes.h>
32
#endif
33
#include <netinet/in.h>
34
#include <arpa/inet.h>
35
#ifdef NEED_RESOLV_H
36
# include <arpa/nameser.h>
37
# include <resolv.h>
38
#endif /* NEED_RESOLV_H */
39
#include <netdb.h>
40
41
#include <sudoers.h>
42
#include <timestamp.h>
43
#include <interfaces.h>
44
45
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size);
46
47
struct interface_list *
48
get_interfaces(void)
49
148
{
50
148
    static struct interface_list empty = SLIST_HEAD_INITIALIZER(interfaces);
51
148
    return &empty;
52
148
}
53
54
void
55
init_eventlog_config(void)
56
32.7k
{
57
32.7k
    return;
58
32.7k
}
59
60
int
61
group_plugin_query(const char *user, const char *group, const struct passwd *pw)
62
0
{
63
0
    return false;
64
0
}
65
66
bool
67
set_perms(const struct sudoers_context *ctx, int perm)
68
59.4k
{
69
59.4k
    return true;
70
59.4k
}
71
72
bool
73
restore_perms(void)
74
17.6k
{
75
17.6k
    return true;
76
17.6k
}
77
78
bool
79
rewind_perms(void)
80
23.7k
{
81
23.7k
    return true;
82
23.7k
}
83
84
bool
85
sudo_nss_can_continue(const struct sudo_nss *nss, int match)
86
16
{
87
    return true;
88
16
}