2 * Copyright (c) 1999-2001 Todd C. Miller <Todd.Miller@courtesan.com>
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
16 * 3. The name of the author may not be used to endorse or promote products
17 * derived from this software without specific prior written permission.
19 * 4. Products derived from this software may not be called "Sudo" nor
20 * may "Sudo" appear in their names without specific prior written
21 * permission from the author.
23 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
24 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
25 * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
26 * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
29 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
30 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
31 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
32 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 * $Sudo: defaults.h,v 1.23 2001/12/14 19:54:56 millert Exp $
37 #ifndef _SUDO_DEFAULTS_H
38 #define _SUDO_DEFAULTS_H
42 struct list_member *next;
52 * Structure describing compile-time and run-time options.
54 struct sudo_defs_types {
63 struct list_member *list;
68 * Four types of defaults: strings, integers, and flags.
69 * Also, T_INT or T_STR may be ANDed with T_BOOL to indicate that
70 * a value is not required. Flags are boolean by nature...
85 #define T_LOGFAC 0x007
87 #define T_LOGPRI 0x008
89 #define T_PWFLAG 0x009
98 * Indexes into sudo_defs_table
100 #include <def_data.h>
101 #define I_LOGFAC I_SYSLOG_IFAC
102 #define I_GOODPRI I_SYSLOG_IGOODPRI
103 #define I_BADPRI I_SYSLOG_IBADPRI
106 * Macros for accessing sudo_defs_table.
108 #define def_flag(_i) (sudo_defs_table[(_i)].sd_un.flag)
109 #define def_ival(_i) (sudo_defs_table[(_i)].sd_un.ival)
110 #define def_str(_i) (sudo_defs_table[(_i)].sd_un.str)
111 #define def_list(_i) (sudo_defs_table[(_i)].sd_un.list)
112 #define def_mode(_i) (sudo_defs_table[(_i)].sd_un.mode)
117 void dump_default __P((void));
118 int set_default __P((char *, char *, int));
119 void init_defaults __P((void));
120 void list_options __P((void));
122 extern struct sudo_defs_types sudo_defs_table[];
124 #endif /* _SUDO_DEFAULTS_H */