Annotation of src/usr.bin/doas/doas.h, Revision 1.7
1.7 ! tedu 1: /* $OpenBSD: doas.h,v 1.6 2016/06/07 16:49:23 tedu Exp $ */
! 2:
! 3: #include <sys/tree.h>
! 4:
! 5: struct envnode {
! 6: RB_ENTRY(envnode) node;
! 7: const char *key;
! 8: const char *value;
! 9: };
! 10:
! 11: struct env {
! 12: RB_HEAD(envtree, envnode) root;
! 13: u_int count;
! 14: };
! 15:
! 16: RB_PROTOTYPE(envtree, envnode, node, envcmp)
1.1 tedu 17:
18: struct rule {
19: int action;
20: int options;
21: const char *ident;
22: const char *target;
23: const char *cmd;
1.3 zhuk 24: const char **cmdargs;
1.1 tedu 25: const char **envlist;
26: };
27:
28: extern struct rule **rules;
29: extern int nrules, maxrules;
1.4 zhuk 30: extern int parse_errors;
1.1 tedu 31:
32: size_t arraylen(const char **);
1.7 ! tedu 33:
! 34: struct env *createenv(char **);
! 35: struct env *filterenv(struct env *, struct rule *);
! 36: char **flattenenv(struct env *);
1.1 tedu 37:
38: #define PERMIT 1
39: #define DENY 2
40:
41: #define NOPASS 0x1
42: #define KEEPENV 0x2