2 * Copyright (c) 1999-2005, 2008
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.
21 * $Sudo: defaults.h,v 1.33 2008/11/09 14:13:12 millert Exp $
24 #ifndef _SUDO_DEFAULTS_H
25 #define _SUDO_DEFAULTS_H
31 struct list_member *next;
35 char *sval; /* string value */
36 int ival; /* actually an enum */
46 * Structure describing compile-time and run-time options.
48 struct sudo_defs_types {
52 struct def_values *values;
53 int (*callback) __P((char *));
57 enum def_tupple tuple;
60 struct list_member *list;
65 * Four types of defaults: strings, integers, and flags.
66 * Also, T_INT or T_STR may be ANDed with T_BOOL to indicate that
67 * a value is not required. Flags are boolean by nature...
82 #define T_LOGFAC 0x007
84 #define T_LOGPRI 0x008
95 * Argument to update_defaults()
97 #define SETDEF_GENERIC 0x01
98 #define SETDEF_HOST 0x02
99 #define SETDEF_USER 0x04
100 #define SETDEF_RUNAS 0x08
101 #define SETDEF_CMND 0x10
102 #define SETDEF_ALL (SETDEF_GENERIC|SETDEF_HOST|SETDEF_USER|SETDEF_RUNAS|SETDEF_CMND)
107 void dump_default __P((void));
108 int set_default __P((char *, char *, int));
109 void init_defaults __P((void));
110 int update_defaults __P((int));
111 void list_options __P((void));
113 extern struct sudo_defs_types sudo_defs_table[];
115 #endif /* _SUDO_DEFAULTS_H */