Attempt to create .deps directory every time we build objects.
[doas.git] / rule.h
blobc16f2c1c0776f60c7ebb659409267e325186c7e4
1 /*
2 * Copyright (c) 2021-2022 Sergey Sushilin <sergeysushilin@protonmail.com>
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.
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.
17 #ifndef _RULE_H
18 #define _RULE_H 1
20 #include <grp.h>
21 #include <pwd.h>
22 #include <sys/types.h>
24 #include "attributes.h"
26 struct str {
27 size_t siz;
28 size_t len;
29 char *buf;
32 #define RULE_ENTRY(declaration) \
33 declaration { \
34 struct { \
35 struct passwd const *pw; \
36 struct group const *gr; \
37 } ident; \
38 struct { \
39 struct passwd const *pw; \
40 } target; \
41 struct { \
42 int argc; \
43 char const *const *const *argv; \
44 }; \
45 struct { \
46 struct env *env; \
47 char const *const *keepenvlist; \
48 char const *const *setenvlist; \
49 char const *const *unsetenvlist; \
50 time_t persist_time; \
51 u_int inheritenv:1; \
52 u_int nopass:1; \
53 u_int nolog:1; \
54 }; \
55 u_int permit:1; \
58 RULE_ENTRY(struct __packed rule);
60 #endif /* _RULE_H */