2 * Copyright (c) 1996, 1998-2000 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: parse.h,v 1.9 2000/03/23 04:38:20 millert Exp $
41 * Data structure used in parsing sudoers;
42 * top of stack values are the ones that
43 * apply when parsing is done & can be
44 * accessed by *_matches macros
46 #define STACKINCREMENT (32)
56 * Data structure describing a command in the
64 #define user_matches (match[top-1].user)
65 #define cmnd_matches (match[top-1].cmnd)
66 #define host_matches (match[top-1].host)
67 #define runas_matches (match[top-1].runas)
68 #define no_passwd (match[top-1].nopass)
71 * Structure containing command matches if "sudo -l" is used.
73 struct command_match {
84 * Structure describing an alias match in parser.
93 * Structure containing Cmnd_Alias's if "sudo -l" is used.
95 struct generic_alias {
103 /* The matching stack and number of entries on it. */
104 extern struct matchstack *match;
110 int addr_matches __P((char *));
111 int command_matches __P((char *, char *, char *, char *));
112 int hostname_matches __P((char *, char *, char *));
113 int netgr_matches __P((char *, char *, char *, char *));
114 int usergr_matches __P((char *, char *));
116 #endif /* _SUDO_PARSE_H */