2 * Copyright (c) 1996,1998-2000,2004 Todd C. Miller <Todd.Miller@courtesan.com>
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 * $Sudo: parse.h,v 1.14 2004/08/02 18:44:58 millert Exp $
23 * Data structure used in parsing sudoers;
24 * top of stack values are the ones that
25 * apply when parsing is done & can be
26 * accessed by *_matches macros
28 #define STACKINCREMENT (32)
39 * Data structure describing a command in the
47 #define user_matches (match[top-1].user)
48 #define cmnd_matches (match[top-1].cmnd)
49 #define host_matches (match[top-1].host)
50 #define runas_matches (match[top-1].runas)
51 #define no_passwd (match[top-1].nopass)
52 #define no_execve (match[top-1].noexec)
55 * Structure containing command matches if "sudo -l" is used.
57 struct command_match {
69 * Structure describing an alias match in parser.
78 * Structure containing Cmnd_Alias's if "sudo -l" is used.
80 struct generic_alias {
88 /* The matching stack and number of entries on it. */
89 extern struct matchstack *match;
95 int addr_matches __P((char *));
96 int command_matches __P((char *, char *));
97 int hostname_matches __P((char *, char *, char *));
98 int netgr_matches __P((char *, char *, char *, char *));
99 int userpw_matches __P((char *, char *, struct passwd *));
100 int usergr_matches __P((char *, char *, struct passwd *));
102 #endif /* _SUDO_PARSE_H */