2 * Copyright (c) 1996, 1998-2000, 2004, 2007
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 * $Sudo: parse.h,v 1.14.2.2 2008/02/09 14:44:48 millert Exp $
24 * Data structure used in parsing sudoers;
25 * top of stack values are the ones that
26 * apply when parsing is done & can be
27 * accessed by *_matches macros
29 #define STACKINCREMENT (32)
43 * Data structure describing a command in the
52 * SELinux-specific container struct.
53 * Currently just contains a role and type.
60 #define user_matches (match[top-1].user)
61 #define cmnd_matches (match[top-1].cmnd)
62 #define host_matches (match[top-1].host)
63 #define runas_matches (match[top-1].runas)
64 #define no_passwd (match[top-1].nopass)
65 #define no_execve (match[top-1].noexec)
66 #define setenv_ok (match[top-1].setenv)
69 * Structure containing command matches if "sudo -l" is used.
71 struct command_match {
90 * Structure describing an alias match in parser.
99 * Structure containing Cmnd_Alias's if "sudo -l" is used.
101 struct generic_alias {
109 /* The matching stack and number of entries on it. */
110 extern struct matchstack *match;
116 int addr_matches __P((char *));
117 int command_matches __P((char *, char *));
118 int hostname_matches __P((char *, char *, char *));
119 int netgr_matches __P((char *, char *, char *, char *));
120 int userpw_matches __P((char *, char *, struct passwd *));
121 int usergr_matches __P((char *, char *, struct passwd *));
123 #endif /* _SUDO_PARSE_H */