Print this page
7029 want per-process exploit mitigation features (secflags)
7030 want basic address space layout randomization (aslr)
7031 noexec_user_stack should be a secflag
7032 want a means to forbid mappings around NULL.
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/cmd/zonecfg/zonecfg.h
+++ new/usr/src/cmd/zonecfg/zonecfg.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
24 24 */
25 25
26 26 #ifndef _ZONECFG_H
27 27 #define _ZONECFG_H
28 28
29 29 /*
30 30 * header file for zonecfg command
31 31 */
32 32
33 33 #ifdef __cplusplus
34 34 extern "C" {
35 35 #endif
36 36
37 37 #include <unistd.h>
38 38
39 39 #define Z_ERR 1
40 40 #define Z_USAGE 2
41 41 #define Z_REPEAT 3
42 42
43 43 #define CMD_ADD 0
44 44 #define CMD_CANCEL 1
45 45 #define CMD_CLEAR 2
46 46 #define CMD_COMMIT 3
47 47 #define CMD_CREATE 4
48 48 #define CMD_DELETE 5
49 49 #define CMD_END 6
50 50 #define CMD_EXIT 7
51 51 #define CMD_EXPORT 8
52 52 #define CMD_HELP 9
53 53 #define CMD_INFO 10
54 54 #define CMD_REMOVE 11
55 55 #define CMD_REVERT 12
56 56 #define CMD_SELECT 13
57 57 #define CMD_SET 14
58 58 #define CMD_VERIFY 15
59 59
60 60 #define CMD_MIN CMD_ADD
61 61 #define CMD_MAX CMD_VERIFY
62 62
63 63 /* resource types: increment RT_MAX when expanding this list */
64 64 #define RT_UNKNOWN 0
65 65 #define RT_ZONENAME 1 /* really a property, but for info ... */
66 66 #define RT_ZONEPATH 2 /* really a property, but for info ... */
67 67 #define RT_AUTOBOOT 3 /* really a property, but for info ... */
68 68 #define RT_POOL 4 /* really a property, but for info ... */
69 69 #define RT_FS 5
70 70 #define RT_NET 6
71 71 #define RT_DEVICE 7
72 72 #define RT_RCTL 8
73 73 #define RT_ATTR 9
74 74 #define RT_DATASET 10
75 75 #define RT_LIMITPRIV 11 /* really a property, but for info ... */
76 76 #define RT_BOOTARGS 12 /* really a property, but for info ... */
77 77 #define RT_BRAND 13 /* really a property, but for info ... */
78 78 #define RT_DCPU 14
79 79 #define RT_MCAP 15
80 80 #define RT_MAXLWPS 16 /* really a rctl alias property, but for info */
81 81 #define RT_MAXSHMMEM 17 /* really a rctl alias property, but for info */
82 82 #define RT_MAXSHMIDS 18 /* really a rctl alias property, but for info */
↓ open down ↓ |
82 lines elided |
↑ open up ↑ |
83 83 #define RT_MAXMSGIDS 19 /* really a rctl alias property, but for info */
84 84 #define RT_MAXSEMIDS 20 /* really a rctl alias property, but for info */
85 85 #define RT_SHARES 21 /* really a rctl alias property, but for info */
86 86 #define RT_SCHED 22 /* really a property, but for info ... */
87 87 #define RT_IPTYPE 23 /* really a property, but for info ... */
88 88 #define RT_PCAP 24
89 89 #define RT_HOSTID 25 /* really a property, but for info ... */
90 90 #define RT_ADMIN 26
91 91 #define RT_FS_ALLOWED 27
92 92 #define RT_MAXPROCS 28 /* really a rctl alias property, but for info */
93 +#define RT_SECFLAGS 29
93 94
94 95 #define RT_MIN RT_UNKNOWN
95 -#define RT_MAX RT_MAXPROCS
96 +#define RT_MAX RT_SECFLAGS
96 97
97 98 /* property types: increment PT_MAX when expanding this list */
98 99 #define PT_UNKNOWN 0
99 100 #define PT_ZONENAME 1
100 101 #define PT_ZONEPATH 2
101 102 #define PT_AUTOBOOT 3
102 103 #define PT_POOL 4
103 104 #define PT_DIR 5
104 105 #define PT_SPECIAL 6
105 106 #define PT_TYPE 7
106 107 #define PT_OPTIONS 8
107 108 #define PT_ADDRESS 9
108 109 #define PT_PHYSICAL 10
109 110 #define PT_NAME 11
110 111 #define PT_VALUE 12
111 112 #define PT_MATCH 13
112 113 #define PT_PRIV 14
113 114 #define PT_LIMIT 15
114 115 #define PT_ACTION 16
115 116 #define PT_RAW 17
116 117 #define PT_LIMITPRIV 18
117 118 #define PT_BOOTARGS 19
118 119 #define PT_BRAND 20
119 120 #define PT_NCPUS 21
120 121 #define PT_IMPORTANCE 22
121 122 #define PT_SWAP 23
122 123 #define PT_LOCKED 24
123 124 #define PT_SHARES 25
124 125 #define PT_MAXLWPS 26
125 126 #define PT_MAXSHMMEM 27
126 127 #define PT_MAXSHMIDS 28
127 128 #define PT_MAXMSGIDS 29
128 129 #define PT_MAXSEMIDS 30
129 130 #define PT_MAXLOCKEDMEM 31
↓ open down ↓ |
24 lines elided |
↑ open up ↑ |
130 131 #define PT_MAXSWAP 32
131 132 #define PT_SCHED 33
132 133 #define PT_IPTYPE 34
133 134 #define PT_DEFROUTER 35
134 135 #define PT_HOSTID 36
135 136 #define PT_USER 37
136 137 #define PT_AUTHS 38
137 138 #define PT_FS_ALLOWED 39
138 139 #define PT_MAXPROCS 40
139 140 #define PT_ALLOWED_ADDRESS 41
141 +#define PT_DEFAULT 42
142 +#define PT_LOWER 43
143 +#define PT_UPPER 44
140 144
141 145 #define PT_MIN PT_UNKNOWN
142 -#define PT_MAX PT_ALLOWED_ADDRESS
146 +#define PT_MAX PT_UPPER
143 147
144 148 #define MAX_EQ_PROP_PAIRS 3
145 149
146 150 #define PROP_VAL_SIMPLE 0
147 151 #define PROP_VAL_COMPLEX 1
148 152 #define PROP_VAL_LIST 2
149 153
150 154 #define PROP_VAL_MIN PROP_VAL_SIMPLE
151 155 #define PROP_VAL_MAX PROP_VAL_LIST
152 156
153 157 /*
154 158 * If any subcommand is ever modified to take more than three arguments,
155 159 * this will need to be incremented.
156 160 */
157 161 #define MAX_SUBCMD_ARGS 3
158 162
159 163 typedef struct complex_property {
160 164 int cp_type; /* from the PT_* list above */
161 165 char *cp_value;
162 166 struct complex_property *cp_next;
163 167 } complex_property_t, *complex_property_ptr_t;
164 168
165 169 typedef struct list_property {
166 170 char *lp_simple;
167 171 complex_property_ptr_t lp_complex;
168 172 struct list_property *lp_next;
169 173 } list_property_t, *list_property_ptr_t;
170 174
171 175 typedef struct property_value {
172 176 int pv_type; /* from the PROP_VAL_* list above */
173 177 char *pv_simple;
174 178 complex_property_ptr_t pv_complex;
175 179 list_property_ptr_t pv_list;
176 180 } property_value_t, *property_value_ptr_t;
177 181
178 182 typedef struct cmd {
179 183 char *cmd_name;
180 184 void (*cmd_handler)(struct cmd *);
181 185 int cmd_res_type;
182 186 int cmd_prop_nv_pairs;
183 187 int cmd_prop_name[MAX_EQ_PROP_PAIRS];
184 188 property_value_ptr_t cmd_property_ptr[MAX_EQ_PROP_PAIRS];
185 189 int cmd_argc;
186 190 char *cmd_argv[MAX_SUBCMD_ARGS + 1];
187 191 } cmd_t;
188 192
189 193 #define HELP_USAGE 0x01
190 194 #define HELP_SUBCMDS 0x02
191 195 #define HELP_SYNTAX 0x04
192 196 #define HELP_RESOURCES 0x08
193 197 #define HELP_PROPS 0x10
194 198 #define HELP_META 0x20
195 199 #define HELP_NETADDR 0x40
196 200 #define HELP_RES_SCOPE 0x80
197 201
198 202 #define HELP_RES_PROPS (HELP_RESOURCES | HELP_PROPS)
199 203
200 204 extern void add_func(cmd_t *);
201 205 extern void cancel_func(cmd_t *);
202 206 extern void commit_func(cmd_t *);
203 207 extern void create_func(cmd_t *);
204 208 extern void delete_func(cmd_t *);
205 209 extern void end_func(cmd_t *);
206 210 extern void exit_func(cmd_t *);
207 211 extern void export_func(cmd_t *);
208 212 extern void help_func(cmd_t *);
209 213 extern void info_func(cmd_t *);
210 214 extern void remove_func(cmd_t *);
211 215 extern void revert_func(cmd_t *);
212 216 extern void select_func(cmd_t *);
213 217 extern void set_func(cmd_t *);
214 218 extern void verify_func(cmd_t *);
215 219 extern void clear_func(cmd_t *);
216 220
217 221 extern cmd_t *alloc_cmd(void);
218 222 extern complex_property_ptr_t alloc_complex(void);
219 223 extern list_property_ptr_t alloc_list(void);
220 224 extern void free_cmd(cmd_t *cmd);
221 225 extern void free_complex(complex_property_ptr_t complex);
222 226 extern void free_list(list_property_ptr_t list);
223 227 extern void free_outer_list(list_property_ptr_t list);
224 228
225 229 extern void usage(boolean_t verbose, uint_t flags);
226 230
227 231 extern FILE *yyin;
228 232 extern char *res_types[];
229 233 extern char *prop_types[];
230 234
231 235 /*
232 236 * NOTE: Only Lex and YACC should use the following functions.
233 237 */
234 238 extern void assert_no_unclaimed_tokens(void);
235 239 extern char *claim_token(char *);
236 240
237 241 #ifdef __cplusplus
238 242 }
239 243 #endif
240 244
241 245 #endif /* _ZONECFG_H */
↓ open down ↓ |
89 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX