[BACK]Return to defaults.h CVS log [TXT][DIR] Up to [local] / src / usr.bin / sudo

Annotation of src/usr.bin/sudo/defaults.h, Revision 1.4

1.1       millert     1: /*
1.3       millert     2:  * Copyright (c) 1999-2000 Todd C. Miller <Todd.Miller@courtesan.com>
1.1       millert     3:  * All rights reserved.
                      4:  *
                      5:  * Redistribution and use in source and binary forms, with or without
                      6:  * modification, are permitted provided that the following conditions
                      7:  * are met:
                      8:  *
                      9:  * 1. Redistributions of source code must retain the above copyright
                     10:  *    notice, this list of conditions and the following disclaimer.
                     11:  *
                     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.
                     15:  *
                     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.
                     18:  *
                     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.
                     22:  *
                     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.
                     33:  *
1.4     ! millert    34:  * $Sudo: defaults.h,v 1.16 2000/03/22 23:40:09 millert Exp $
1.1       millert    35:  */
                     36:
                     37: #ifndef _SUDO_DEFAULTS_H
                     38: #define _SUDO_DEFAULTS_H
                     39:
                     40: /*
                     41:  * Structure describing compile-time and run-time options.
                     42:  */
                     43: struct sudo_defs_types {
                     44:     char *name;
                     45:     int type;
1.3       millert    46:     char *desc;
1.1       millert    47:     union {
                     48:        int flag;
                     49:        char *str;
                     50:        unsigned int ival;
                     51:        mode_t mode;
                     52:     } sd_un;
                     53: };
                     54:
                     55: /*
                     56:  * Four types of defaults: strings, integers, and flags.
                     57:  * Also, T_INT or T_STR may be ANDed with T_BOOL to indicate that
                     58:  * a value is not required.  Flags are boolean by nature...
                     59:  */
                     60: #undef T_INT
                     61: #define T_INT          0x001
                     62: #undef T_STR
                     63: #define T_STR          0x002
                     64: #undef T_FLAG
                     65: #define T_FLAG         0x003
                     66: #undef T_MODE
                     67: #define T_MODE         0x004
                     68: #undef T_LOGFAC
                     69: #define T_LOGFAC       0x005
                     70: #undef T_LOGPRI
                     71: #define T_LOGPRI       0x006
1.3       millert    72: #undef T_PWFLAG
                     73: #define T_PWFLAG       0x007
1.1       millert    74: #undef T_MASK
                     75: #define T_MASK         0x0FF
                     76: #undef T_BOOL
                     77: #define T_BOOL         0x100
                     78: #undef T_PATH
                     79: #define T_PATH         0x200
                     80:
                     81: /*
                     82:  * Indexes into sudo_defs_table
                     83:  */
                     84:
                     85: /* Integer versions of syslog options.  */
                     86: #define        I_LOGFAC        0       /* syslog facility */
                     87: #define        I_GOODPRI       1       /* syslog priority for successful auth */
                     88: #define        I_BADPRI        2       /* syslog priority for unsuccessful auth */
                     89:
                     90: /* String versions of syslog options.  */
                     91: #define        I_LOGFACSTR     3       /* syslog facility */
                     92: #define        I_GOODPRISTR    4       /* syslog priority for successful auth */
                     93: #define        I_BADPRISTR     5       /* syslog priority for unsuccessful auth */
                     94:
                     95: /* Booleans */
                     96: #define I_LONG_OTP_PROMPT      6
                     97: #define I_IGNORE_DOT           7
                     98: #define I_MAIL_ALWAYS          8
                     99: #define I_MAIL_NOUSER          9
                    100: #define I_MAIL_NOHOST          10
                    101: #define I_MAIL_NOPERMS         11
                    102: #define I_TTY_TICKETS          12
                    103: #define I_LECTURE              13
                    104: #define I_AUTHENTICATE         14
                    105: #define I_ROOT_SUDO            15
                    106: #define I_LOG_HOST             16
                    107: #define I_LOG_YEAR             17
1.3       millert   108: #define I_SHELL_NOARGS         18
                    109: #define I_SET_HOME             19
                    110: #define I_PATH_INFO            20
                    111: #define I_FQDN                 21
                    112: #define I_INSULTS              22
                    113: #define I_REQUIRETTY           23
1.4     ! millert   114: #define I_ENV_EDITOR           24
        !           115: #define I_ROOTPW               25
        !           116: #define I_RUNASPW              26
        !           117: #define I_TARGETPW             27
        !           118: #define I_LOGINCLASS           28
        !           119: #define I_LOGNAME              29
1.1       millert   120:
                    121: /* Integer values */
1.4     ! millert   122: #define        I_LOGLEN        30      /* wrap log file line after N chars */
        !           123: #define        I_TS_TIMEOUT    31      /* timestamp stale after N minutes */
        !           124: #define        I_PW_TIMEOUT    32      /* exit if pass not entered in N minutes */
        !           125: #define        I_PW_TRIES      33      /* exit after N bad password tries */
        !           126: #define        I_UMASK         34      /* umask to use or 0777 to use user's */
1.1       millert   127:
                    128: /* Strings */
1.4     ! millert   129: #define        I_LOGFILE       35      /* path to logfile (or NULL for none) */
        !           130: #define        I_MAILERPATH    36      /* path to sendmail or other mailer */
        !           131: #define        I_MAILERFLAGS   37      /* flags to pass to the mailer */
        !           132: #define        I_MAILTO        38      /* who to send bitch mail to */
        !           133: #define        I_MAILSUB       39      /* subject line of mail msg */
        !           134: #define        I_BADPASS_MSG   40      /* what to say when passwd is wrong */
        !           135: #define        I_TIMESTAMPDIR  41      /* path to timestamp dir */
        !           136: #define        I_EXEMPT_GRP    42      /* no password or PATH override for these */
        !           137: #define        I_PASSPROMPT    43      /* password prompt */
        !           138: #define        I_RUNAS_DEF     44      /* default user to run commands as */
        !           139: #define        I_SECURE_PATH   45      /* set $PATH to this if not NULL */
        !           140: #define        I_EDITOR        46      /* path to editor used by visudo */
1.3       millert   141:
                    142: /* Integer versions of list/verify options */
1.4     ! millert   143: #define I_LISTPW       47
        !           144: #define I_VERIFYPW     48
1.3       millert   145:
                    146: /* String versions of list/verify options */
1.4     ! millert   147: #define I_LISTPWSTR    49
        !           148: #define I_VERIFYPWSTR  50
1.1       millert   149:
                    150: /*
                    151:  * Macros for accessing sudo_defs_table.
                    152:  */
                    153: #define def_flag(_i)   (sudo_defs_table[(_i)].sd_un.flag)
                    154: #define def_ival(_i)   (sudo_defs_table[(_i)].sd_un.ival)
                    155: #define def_str(_i)    (sudo_defs_table[(_i)].sd_un.str)
                    156: #define def_mode(_i)   (sudo_defs_table[(_i)].sd_un.mode)
                    157:
                    158: /*
                    159:  * Prototypes
                    160:  */
                    161: void dump_default      __P((void));
                    162: int set_default                __P((char *, char *, int));
                    163: void init_defaults     __P((void));
                    164: void list_options      __P((void));
                    165:
                    166: extern struct sudo_defs_types sudo_defs_table[];
                    167:
                    168: #endif /* _SUDO_DEFAULTS_H */