2 * Copyright (c) 1999-2005, 2008-2010
3 * Todd C. Miller <Todd.Miller@courtesan.com>
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * Sponsored in part by the Defense Advanced Research Projects
18 * Agency (DARPA) and Air Force Research Laboratory, Air Force
19 * Materiel Command, USAF, under agreement number F39502-99-1-0512.
22 #ifndef _SUDO_DEFAULTS_H
23 #define _SUDO_DEFAULTS_H
29 struct list_member *next;
33 char *sval; /* string value */
34 int ival; /* actually an enum */
44 * Structure describing compile-time and run-time options.
46 struct sudo_defs_types {
50 struct def_values *values;
51 int (*callback)(const char *);
59 struct list_member *list;
64 * Four types of defaults: strings, integers, and flags.
65 * Also, T_INT, T_FLOAT or T_STR may be ANDed with T_BOOL to indicate that
66 * a value is not required. Flags are boolean by nature...
81 #define T_LOGFAC 0x007
83 #define T_LOGPRI 0x008
96 * Argument to update_defaults() and check_defaults()
98 #define SETDEF_GENERIC 0x01
99 #define SETDEF_HOST 0x02
100 #define SETDEF_USER 0x04
101 #define SETDEF_RUNAS 0x08
102 #define SETDEF_CMND 0x10
103 #define SETDEF_ALL (SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER|SETDEF_RUNAS|SETDEF_CMND)
108 void dump_default(void);
109 void init_defaults(void);
110 bool set_default(char *var, char *val, int op);
111 bool update_defaults(int what);
112 bool check_defaults(int what, bool quiet);
114 extern struct sudo_defs_types sudo_defs_table[];
116 #endif /* _SUDO_DEFAULTS_H */