Bug Summary

File:src/usr.sbin/config/obj/gram.c
Warning:line 665, column 12
Use of zero-allocated memory

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple amd64-unknown-openbsd7.0 -analyze -disable-free -disable-llvm-verifier -discard-value-names -main-file-name gram.c -analyzer-store=region -analyzer-opt-analyze-nested-blocks -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -mrelocation-model pic -pic-level 1 -pic-is-pie -mframe-pointer=all -relaxed-aliasing -fno-rounding-math -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-feature +retpoline-indirect-calls -target-feature +retpoline-indirect-branches -tune-cpu generic -debugger-tuning=gdb -fcoverage-compilation-dir=/usr/src/usr.sbin/config/obj -resource-dir /usr/local/lib/clang/13.0.0 -I /usr/src/usr.sbin/config -I . -internal-isystem /usr/local/lib/clang/13.0.0/include -internal-externc-isystem /usr/include -O2 -fdebug-compilation-dir=/usr/src/usr.sbin/config/obj -ferror-limit 19 -fwrapv -D_RET_PROTECTOR -ret-protector -fgnuc-version=4.2.1 -vectorize-loops -vectorize-slp -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-valloc -fno-builtin-free -fno-builtin-strdup -fno-builtin-strndup -analyzer-output=html -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /home/ben/Projects/vmm/scan-build/2022-01-12-194120-40624-1 -x c gram.c
1#include <stdlib.h>
2#include <string.h>
3#define YYBYACC1 1
4#define YYMAJOR1 1
5#define YYMINOR9 9
6#define YYLEXyylex() yylex()
7#define YYEMPTY-1 -1
8#define yyclearin(yychar=(-1)) (yychar=(YYEMPTY-1))
9#define yyerrok(yyerrflag=0) (yyerrflag=0)
10#define YYRECOVERING()(yyerrflag!=0) (yyerrflag!=0)
11#define YYPREFIX"yy" "yy"
12#line 2 "/usr/src/usr.sbin/config/gram.y"
13/* $OpenBSD: gram.y,v 1.25 2021/11/28 19:26:03 deraadt Exp $ */
14/* $NetBSD: gram.y,v 1.14 1997/02/02 21:12:32 thorpej Exp $ */
15
16/*
17 * Copyright (c) 1992, 1993
18 * The Regents of the University of California. All rights reserved.
19 *
20 * This software was developed by the Computer Systems Engineering group
21 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and
22 * contributed to Berkeley.
23 *
24 * All advertising materials mentioning features or use of this software
25 * must display the following acknowledgement:
26 * This product includes software developed by the University of
27 * California, Lawrence Berkeley Laboratories.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 * 1. Redistributions of source code must retain the above copyright
33 * notice, this list of conditions and the following disclaimer.
34 * 2. Redistributions in binary form must reproduce the above copyright
35 * notice, this list of conditions and the following disclaimer in the
36 * documentation and/or other materials provided with the distribution.
37 * 3. Neither the name of the University nor the names of its contributors
38 * may be used to endorse or promote products derived from this software
39 * without specific prior written permission.
40 *
41 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
42 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
45 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51 * SUCH DAMAGE.
52 *
53 * from: @(#)gram.y 8.1 (Berkeley) 6/6/93
54 */
55
56#include <sys/types.h>
57#include <ctype.h>
58#include <stdio.h>
59#include <stdlib.h>
60#include <limits.h>
61#include <string.h>
62#include <errno(*__errno()).h>
63#include "config.h"
64#include "sem.h"
65
66#define FORMAT(n)((n) > -10 && (n) < 10 ? "%d" : "0x%x") ((n) > -10 && (n) < 10 ? "%d" : "0x%x")
67
68#define stop(s)error(s), exit(1) error(s), exit(1)
69
70int include(const char *, int);
71void yyerror(const char *);
72int yylex(void);
73
74static struct config conf; /* at most one active at a time */
75
76/* the following is used to recover nvlist space after errors */
77static struct nvlist *alloc[1000];
78static int adepth;
79#define new0(n,s,p,i,x)(alloc[adepth++] = newnv(n, s, p, i, x)) (alloc[adepth++] = newnv(n, s, p, i, x))
80#define new_n(n)(alloc[adepth++] = newnv(n, ((void *)0), ((void *)0), 0, ((void
*)0)))
new0(n, NULL, NULL, 0, NULL)(alloc[adepth++] = newnv(n, ((void *)0), ((void *)0), 0, ((void
*)0)))
81#define new_nx(n, x)(alloc[adepth++] = newnv(n, ((void *)0), ((void *)0), 0, x)) new0(n, NULL, NULL, 0, x)(alloc[adepth++] = newnv(n, ((void *)0), ((void *)0), 0, x))
82#define new_ns(n, s)(alloc[adepth++] = newnv(n, s, ((void *)0), 0, ((void *)0))) new0(n, s, NULL, 0, NULL)(alloc[adepth++] = newnv(n, s, ((void *)0), 0, ((void *)0)))
83#define new_si(s, i)(alloc[adepth++] = newnv(((void *)0), s, ((void *)0), i, ((void
*)0)))
new0(NULL, s, NULL, i, NULL)(alloc[adepth++] = newnv(((void *)0), s, ((void *)0), i, ((void
*)0)))
84#define new_nsi(n,s,i)(alloc[adepth++] = newnv(n, s, ((void *)0), i, ((void *)0))) new0(n, s, NULL, i, NULL)(alloc[adepth++] = newnv(n, s, ((void *)0), i, ((void *)0)))
85#define new_np(n, p)(alloc[adepth++] = newnv(n, ((void *)0), p, 0, ((void *)0))) new0(n, NULL, p, 0, NULL)(alloc[adepth++] = newnv(n, ((void *)0), p, 0, ((void *)0)))
86#define new_s(s)(alloc[adepth++] = newnv(((void *)0), s, ((void *)0), 0, ((void
*)0)))
new0(NULL, s, NULL, 0, NULL)(alloc[adepth++] = newnv(((void *)0), s, ((void *)0), 0, ((void
*)0)))
87#define new_p(p)(alloc[adepth++] = newnv(((void *)0), ((void *)0), p, 0, ((void
*)0)))
new0(NULL, NULL, p, 0, NULL)(alloc[adepth++] = newnv(((void *)0), ((void *)0), p, 0, ((void
*)0)))
88#define new_px(p, x)(alloc[adepth++] = newnv(((void *)0), ((void *)0), p, 0, x)) new0(NULL, NULL, p, 0, x)(alloc[adepth++] = newnv(((void *)0), ((void *)0), p, 0, x))
89
90#define fx_atom(s)(alloc[adepth++] = newnv(s, ((void *)0), ((void *)0), 0, ((void
*)0)))
new0(s, NULL, NULL, FX_ATOM, NULL)(alloc[adepth++] = newnv(s, ((void *)0), ((void *)0), 0, ((void
*)0)))
91#define fx_not(e)(alloc[adepth++] = newnv(((void *)0), ((void *)0), ((void *)0
), 1, e))
new0(NULL, NULL, NULL, FX_NOT, e)(alloc[adepth++] = newnv(((void *)0), ((void *)0), ((void *)0
), 1, e))
92#define fx_and(e1, e2)(alloc[adepth++] = newnv(((void *)0), ((void *)0), e1, 2, e2)
)
new0(NULL, NULL, e1, FX_AND, e2)(alloc[adepth++] = newnv(((void *)0), ((void *)0), e1, 2, e2)
)
93#define fx_or(e1, e2)(alloc[adepth++] = newnv(((void *)0), ((void *)0), e1, 3, e2)
)
new0(NULL, NULL, e1, FX_OR, e2)(alloc[adepth++] = newnv(((void *)0), ((void *)0), e1, 3, e2)
)
94
95static void cleanup(void);
96static void setmachine(const char *, const char *);
97static void check_maxpart(void);
98
99#line 90 "/usr/src/usr.sbin/config/gram.y"
100#ifndef YYSTYPE_DEFINED
101#define YYSTYPE_DEFINED
102typedef union {
103 struct attr *attr;
104 struct devbase *devb;
105 struct deva *deva;
106 struct nvlist *list;
107 const char *str;
108 int val;
109} YYSTYPE;
110#endif /* YYSTYPE_DEFINED */
111#line 112 "gram.c"
112#define AND257 257
113#define AT258 258
114#define ATTACH259 259
115#define BUILD260 260
116#define COMPILE_WITH261 261
117#define CONFIG262 262
118#define DEFINE263 263
119#define DEFOPT264 264
120#define DEVICE265 265
121#define DISABLE266 266
122#define DUMPS267 267
123#define ENDFILE268 268
124#define XFILE269 269
125#define XOBJECT270 270
126#define FLAGS271 271
127#define INCLUDE272 272
128#define XMACHINE273 273
129#define MAJOR274 274
130#define MAKEOPTIONS275 275
131#define MAXUSERS276 276
132#define MAXPARTITIONS277 277
133#define MINOR278 278
134#define ON279 279
135#define OPTIONS280 280
136#define PSEUDO_DEVICE281 281
137#define ROOT282 282
138#define SOURCE283 283
139#define SWAP284 284
140#define WITH285 285
141#define NEEDS_COUNT286 286
142#define NEEDS_FLAG287 287
143#define RMOPTIONS288 288
144#define ENABLE289 289
145#define NUMBER290 290
146#define PATHNAME291 291
147#define WORD292 292
148#define EMPTY293 293
149#define YYERRCODE256 256
150const short yylhs[] =
151 { -1,
152 39, 0, 34, 34, 40, 40, 40, 40, 35, 35,
153 35, 37, 1, 1, 42, 43, 2, 2, 3, 3,
154 3, 3, 3, 4, 5, 5, 6, 6, 7, 7,
155 8, 9, 9, 41, 36, 36, 44, 44, 44, 45,
156 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
157 13, 13, 14, 14, 16, 16, 11, 12, 12, 15,
158 15, 17, 17, 18, 18, 19, 19, 19, 20, 29,
159 29, 29, 31, 31, 21, 21, 22, 22, 10, 46,
160 46, 47, 38, 38, 48, 48, 48, 49, 49, 49,
161 49, 49, 49, 49, 49, 49, 49, 49, 52, 52,
162 55, 50, 50, 51, 51, 56, 56, 53, 54, 54,
163 57, 57, 57, 25, 25, 26, 26, 30, 58, 58,
164 32, 32, 27, 27, 28, 28, 28, 23, 23, 24,
165 24, 33, 33,
166};
167const short yylen[] =
168 { 2,
169 0, 10, 2, 0, 3, 3, 2, 1, 3, 4,
170 1, 1, 1, 3, 5, 4, 1, 0, 1, 2,
171 3, 3, 3, 1, 2, 0, 1, 1, 2, 0,
172 1, 2, 0, 2, 2, 0, 2, 1, 2, 1,
173 1, 1, 3, 2, 4, 6, 4, 2, 3, 4,
174 1, 0, 3, 1, 1, 1, 1, 2, 0, 3,
175 0, 1, 0, 3, 1, 2, 1, 4, 2, 1,
176 1, 1, 1, 2, 2, 0, 3, 1, 1, 3,
177 1, 3, 2, 0, 2, 1, 2, 1, 1, 1,
178 2, 2, 2, 2, 3, 4, 4, 6, 3, 1,
179 3, 3, 1, 3, 1, 1, 3, 1, 2, 1,
180 3, 3, 3, 3, 1, 1, 1, 4, 1, 0,
181 1, 0, 2, 1, 1, 2, 1, 2, 0, 2,
182 2, 2, 0,
183};
184const short yydefred[] =
185 { 4,
186 0, 0, 11, 0, 0, 0, 0, 8, 36, 3,
187 0, 0, 34, 0, 0, 0, 7, 6, 0, 9,
188 5, 0, 0, 0, 0, 0, 12, 0, 0, 0,
189 0, 0, 0, 38, 36, 42, 40, 41, 35, 0,
190 10, 39, 57, 0, 0, 44, 0, 13, 0, 0,
191 0, 0, 48, 0, 0, 37, 0, 0, 43, 0,
192 24, 0, 0, 0, 26, 0, 19, 30, 0, 0,
193 81, 0, 0, 49, 36, 56, 55, 0, 54, 0,
194 0, 0, 62, 0, 45, 14, 20, 0, 0, 0,
195 0, 0, 0, 50, 0, 47, 79, 78, 0, 0,
196 0, 0, 0, 0, 66, 0, 60, 0, 23, 0,
197 27, 28, 25, 15, 0, 21, 31, 29, 82, 80,
198 0, 1, 58, 53, 46, 73, 70, 71, 0, 69,
199 72, 0, 64, 32, 77, 84, 74, 68, 0, 0,
200 0, 0, 0, 0, 0, 0, 0, 86, 0, 90,
201 88, 89, 83, 0, 87, 108, 0, 0, 0, 100,
202 94, 0, 0, 103, 0, 105, 0, 123, 0, 85,
203 0, 0, 0, 0, 110, 0, 0, 0, 0, 121,
204 0, 0, 125, 0, 0, 119, 0, 0, 0, 109,
205 101, 99, 107, 102, 51, 96, 104, 126, 97, 129,
206 0, 116, 113, 117, 111, 112, 0, 0, 0, 0,
207 0, 0, 128, 98, 0, 114, 132, 131, 130, 118,
208};
209const short yydgoto[] =
210 { 1,
211 49, 65, 66, 67, 89, 113, 92, 118, 114, 98,
212 69, 103, 196, 78, 59, 79, 82, 83, 84, 105,
213 74, 99, 208, 213, 206, 207, 149, 185, 130, 204,
214 131, 181, 214, 2, 9, 16, 35, 139, 136, 10,
215 36, 37, 38, 39, 40, 70, 71, 153, 154, 163,
216 167, 159, 157, 174, 160, 164, 175, 187,
217};
218const short yysindex[] =
219 { 0,
220 0, 40, 0, -247, -250, -246, -218, 0, 0, 0,
221 35, 64, 0, -9, 66, 52, 0, 0, 67, 0,
222 0, 68, -213, -212, -211, -213, 0, -208, -207, -38,
223 -204, -203, -213, 0, 0, 0, 0, 0, 0, 78,
224 0, 0, 0, -169, -33, 0, -33, 0, -13, -5,
225 -213, -199, 0, 34, 52, 0, -249, -86, 0, 34,
226 0, -198, -197, -5, 0, -28, 0, 0, 36, -25,
227 0, -192, -193, 0, 0, 0, 0, -40, 0, 41,
228 -191, -21, 0, 61, 0, 0, 0, -30, -230, -5,
229 -5, -181, -183, 0, -213, 0, 0, 0, 65, 52,
230 -184, -249, 34, 9, 0, 41, 0, -86, 0, -182,
231 0, 0, 0, 0, 74, 0, 0, 0, 0, 0,
232 -193, 0, 0, 0, 0, 0, 0, 0, -177, 0,
233 0, 21, 0, 0, 0, 0, 0, 0, -10, 105,
234 -176, -175, -172, -173, -171, -170, 81, 0, -138, 0,
235 0, 0, 0, 114, 0, 0, -231, 70, 82, 0,
236 0, 71, 83, 0, -165, 0, 84, 0, -210, 0,
237 -150, -150, -150, -231, 0, 9, -175, 9, -173, 0,
238 -133, -158, 0, 72, -241, 0, -225, -225, -225, 0,
239 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
240 -154, 0, 0, 0, 0, 0, -120, -237, -140, -225,
241 -151, -39, 0, 0, -148, 0, 0, 0, 0, 0,};
242const short yyrindex[] =
243 { 0,
244 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
245 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
246 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
247 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
248 0, 0, 0, 0, 130, 0, 3, 0, 8, -1,
249 0, 0, 0, 131, 0, 0, 0, 18, 0, 131,
250 0, 0, 0, 0, 0, 11, 0, 0, 0, 0,
251 0, 0, 0, 0, 0, 0, 0, 13, 0, -22,
252 0, 0, 0, 20, 0, 0, 0, 0, 136, 0,
253 0, 137, 0, 0, 0, 0, 0, 0, 138, 0,
254 0, 0, 131, 0, 0, 0, 0, 0, 0, 0,
255 0, 0, 0, 0, 6, 0, 0, 0, 0, 0,
256 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
257 0, 0, 0, 0, 0, 0, 0, 0, 149, 0,
258 0, 0, 0, 0, 0, 0, -108, 0, 0, 0,
259 0, 0, 0, 0, 0, 0, 0, 0, 141, 0,
260 0, 16, 142, 0, 2, 0, 143, 0, 0, 0,
261 -222, -222, -222, 144, 0, 0, 0, 0, 0, 0,
262 145, 0, 0, -8, -7, 0, 0, 0, 0, 0,
263 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
264 0, 0, 0, 0, 0, 0, 7, 146, 0, 0,
265 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,};
266const short yygindex[] =
267 { 0,
268 0, 107, -27, 95, 0, 0, 0, 0, 0, 38,
269 42, 0, -24, 0, 113, 60, 0, 55, 0, 58,
270 -45, 0, 0, 0, -44, -149, 0, 0, -146, 0,
271 0, 0, 0, 0, 0, -6, -41, 0, 0, 0,
272 5, 26, 28, 0, 0, 0, 73, 0, 0, 0,
273 0, 0, 0, 0, -4, -3, -2, -132,
274};
275#define YYTABLESIZE333 333
276const short yytable[] =
277 { 148,
278 20, 127, 52, 102, 81, 129, 11, 91, 18, 91,
279 109, 122, 61, 75, 85, 22, 115, 18, 95, 63,
280 17, 67, 59, 218, 195, 106, 64, 63, 55, 191,
281 110, 193, 76, 211, 64, 171, 88, 203, 205, 188,
282 189, 13, 77, 12, 17, 14, 22, 199, 201, 8,
283 172, 120, 173, 129, 212, 111, 112, 125, 122, 106,
284 61, 34, 115, 116, 44, 219, 202, 47, 100, 120,
285 59, 183, 15, 18, 54, 21, 41, 42, 43, 45,
286 46, 184, 48, 50, 51, 52, 53, 56, 57, 58,
287 72, 73, 86, 90, 61, 90, 93, 96, 97, 94,
288 106, 104, 67, 107, 108, 117, 119, 123, 121, 134,
289 62, 91, 137, 138, 155, 156, 158, 161, 162, 169,
290 165, 166, 168, 170, 180, 177, 179, 182, 186, 22,
291 176, 178, 195, 197, 198, 209, 210, 215, 217, 61,
292 76, 220, 63, 150, 65, 33, 16, 75, 2, 124,
293 93, 91, 92, 95, 52, 133, 68, 87, 135, 60,
294 200, 124, 133, 132, 151, 216, 152, 120, 0, 0,
295 0, 190, 192, 0, 0, 194, 0, 0, 0, 0,
296 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
297 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
298 0, 0, 0, 0, 0, 80, 0, 0, 0, 0,
299 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
300 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
301 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
302 0, 0, 0, 0, 101, 140, 0, 0, 0, 0,
303 126, 141, 127, 128, 0, 0, 0, 127, 28, 29,
304 0, 5, 127, 52, 142, 143, 22, 122, 18, 144,
305 145, 17, 0, 115, 0, 0, 0, 146, 61, 0,
306 127, 147, 19, 127, 52, 18, 61, 0, 115, 0,
307 115, 22, 22, 18, 18, 3, 17, 17, 126, 4,
308 127, 128, 0, 0, 0, 0, 0, 22, 0, 0,
309 23, 5, 6, 0, 24, 25, 26, 0, 0, 27,
310 28, 29, 7, 5, 0, 30, 0, 31, 32, 0,
311 0, 0, 33,
312};
313const short yycheck[] =
314 { 10,
315 10, 10, 10, 44, 91, 45, 2, 38, 10, 38,
316 41, 10, 10, 55, 60, 10, 10, 10, 44, 33,
317 10, 44, 10, 63, 266, 10, 40, 33, 35, 176,
318 261, 178, 282, 271, 40, 267, 64, 187, 188, 172,
319 173, 292, 292, 291, 10, 292, 41, 289, 274, 10,
320 282, 274, 284, 45, 292, 286, 287, 103, 100, 44,
321 58, 10, 90, 91, 23, 212, 292, 26, 75, 292,
322 58, 282, 291, 10, 33, 10, 10, 10, 292, 292,
323 292, 292, 291, 291, 123, 290, 290, 10, 258, 123,
324 290, 58, 291, 124, 292, 124, 61, 290, 292, 125,
325 292, 61, 125, 125, 44, 287, 290, 292, 44, 292,
326 124, 38, 290, 93, 10, 292, 292, 290, 292, 258,
327 292, 292, 42, 10, 290, 44, 44, 44, 279, 124,
328 61, 61, 266, 292, 63, 290, 257, 278, 290, 10,
329 10, 290, 125, 139, 125, 10, 10, 10, 0, 258,
330 10, 10, 10, 10, 10, 10, 50, 63, 121, 47,
331 185, 102, 108, 106, 139, 210, 139, 95, -1, -1,
332 -1, 174, 177, -1, -1, 179, -1, -1, -1, -1,
333 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
334 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
335 -1, -1, -1, -1, -1, 292, -1, -1, -1, -1,
336 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
337 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
338 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
339 -1, -1, -1, -1, 285, 256, -1, -1, -1, -1,
340 290, 262, 292, 293, -1, -1, -1, 266, 269, 270,
341 -1, 272, 271, 271, 275, 276, 261, 266, 261, 280,
342 281, 261, -1, 267, -1, -1, -1, 288, 292, -1,
343 289, 292, 292, 292, 292, 287, 292, -1, 282, -1,
344 284, 286, 287, 286, 287, 256, 286, 287, 290, 260,
345 292, 293, -1, -1, -1, -1, -1, 256, -1, -1,
346 259, 272, 273, -1, 263, 264, 265, -1, -1, 268,
347 269, 270, 283, 272, -1, 274, -1, 276, 277, -1,
348 -1, -1, 281,
349};
350#define YYFINAL1 1
351#ifndef YYDEBUG0
352#define YYDEBUG0 0
353#endif
354#define YYMAXTOKEN293 293
355#if YYDEBUG0
356const char * const yyname[] =
357 {
358"end-of-file",0,0,0,0,0,0,0,0,0,"'\\n'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3590,0,"'!'",0,0,0,0,"'&'",0,"'('","')'","'*'",0,"','","'-'",0,0,0,0,0,0,0,0,0,0,0,
3600,"':'",0,0,"'='",0,"'?'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
361"'['",0,"']'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"'{'",
362"'|'","'}'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3630,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3640,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
3650,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"AND","AT","ATTACH","BUILD","COMPILE_WITH",
366"CONFIG","DEFINE","DEFOPT","DEVICE","DISABLE","DUMPS","ENDFILE","XFILE",
367"XOBJECT","FLAGS","INCLUDE","XMACHINE","MAJOR","MAKEOPTIONS","MAXUSERS",
368"MAXPARTITIONS","MINOR","ON","OPTIONS","PSEUDO_DEVICE","ROOT","SOURCE","SWAP",
369"WITH","NEEDS_COUNT","NEEDS_FLAG","RMOPTIONS","ENABLE","NUMBER","PATHNAME",
370"WORD","EMPTY",
371};
372const char * const yyrule[] =
373 {"$accept : Configuration",
374"$$1 :",
375"Configuration : topthings machine_spec dev_defs dev_eof dev_defs dev_eof dev_defs dev_eof $$1 specs",
376"topthings : topthings topthing",
377"topthings :",
378"topthing : SOURCE PATHNAME '\\n'",
379"topthing : BUILD PATHNAME '\\n'",
380"topthing : include '\\n'",
381"topthing : '\\n'",
382"machine_spec : XMACHINE WORD '\\n'",
383"machine_spec : XMACHINE WORD WORD '\\n'",
384"machine_spec : error",
385"dev_eof : ENDFILE",
386"pathnames : PATHNAME",
387"pathnames : pathnames '|' PATHNAME",
388"file : XFILE pathnames fopts fflgs rule",
389"object : XOBJECT PATHNAME fopts oflgs",
390"fopts : fexpr",
391"fopts :",
392"fexpr : fatom",
393"fexpr : '!' fatom",
394"fexpr : fexpr '&' fexpr",
395"fexpr : fexpr '|' fexpr",
396"fexpr : '(' fexpr ')'",
397"fatom : WORD",
398"fflgs : fflgs fflag",
399"fflgs :",
400"fflag : NEEDS_COUNT",
401"fflag : NEEDS_FLAG",
402"oflgs : oflgs oflag",
403"oflgs :",
404"oflag : NEEDS_FLAG",
405"rule : COMPILE_WITH WORD",
406"rule :",
407"include : INCLUDE WORD",
408"dev_defs : dev_defs dev_def",
409"dev_defs :",
410"dev_def : one_def '\\n'",
411"dev_def : '\\n'",
412"dev_def : error '\\n'",
413"one_def : file",
414"one_def : object",
415"one_def : include",
416"one_def : DEFINE WORD interface_opt",
417"one_def : DEFOPT WORD",
418"one_def : DEVICE devbase interface_opt attrs_opt",
419"one_def : ATTACH devbase AT atlist devattach_opt attrs_opt",
420"one_def : MAXUSERS NUMBER NUMBER NUMBER",
421"one_def : MAXPARTITIONS NUMBER",
422"one_def : PSEUDO_DEVICE devbase attrs_opt",
423"one_def : MAJOR '{' majorlist '}'",
424"disable : DISABLE",
425"disable :",
426"atlist : atlist ',' atname",
427"atlist : atname",
428"atname : WORD",
429"atname : ROOT",
430"devbase : WORD",
431"devattach_opt : WITH WORD",
432"devattach_opt :",
433"interface_opt : '{' loclist_opt '}'",
434"interface_opt :",
435"loclist_opt : loclist",
436"loclist_opt :",
437"loclist : locdef ',' loclist",
438"loclist : locdef",
439"locdef : WORD locdefault",
440"locdef : WORD",
441"locdef : '[' WORD locdefault ']'",
442"locdefault : '=' value",
443"value : WORD",
444"value : EMPTY",
445"value : signed_number",
446"signed_number : NUMBER",
447"signed_number : '-' NUMBER",
448"attrs_opt : ':' attrs",
449"attrs_opt :",
450"attrs : attrs ',' attr",
451"attrs : attr",
452"attr : WORD",
453"majorlist : majorlist ',' majordef",
454"majorlist : majordef",
455"majordef : devbase '=' NUMBER",
456"specs : specs spec",
457"specs :",
458"spec : config_spec '\\n'",
459"spec : '\\n'",
460"spec : error '\\n'",
461"config_spec : file",
462"config_spec : object",
463"config_spec : include",
464"config_spec : OPTIONS opt_list",
465"config_spec : RMOPTIONS ropt_list",
466"config_spec : MAKEOPTIONS mkopt_list",
467"config_spec : MAXUSERS NUMBER",
468"config_spec : CONFIG conf sysparam_list",
469"config_spec : PSEUDO_DEVICE WORD npseudo disable",
470"config_spec : device_instance AT attachment ENABLE",
471"config_spec : device_instance AT attachment disable locators flags_opt",
472"mkopt_list : mkopt_list ',' mkoption",
473"mkopt_list : mkoption",
474"mkoption : WORD '=' value",
475"opt_list : opt_list ',' option",
476"opt_list : option",
477"ropt_list : ropt_list ',' WORD",
478"ropt_list : WORD",
479"option : WORD",
480"option : WORD '=' value",
481"conf : WORD",
482"sysparam_list : sysparam_list sysparam",
483"sysparam_list : sysparam",
484"sysparam : ROOT on_opt dev_spec",
485"sysparam : SWAP on_opt swapdev_list",
486"sysparam : DUMPS on_opt dev_spec",
487"swapdev_list : dev_spec AND swapdev_list",
488"swapdev_list : dev_spec",
489"dev_spec : WORD",
490"dev_spec : major_minor",
491"major_minor : MAJOR NUMBER MINOR NUMBER",
492"on_opt : ON",
493"on_opt :",
494"npseudo : NUMBER",
495"npseudo :",
496"device_instance : WORD '*'",
497"device_instance : WORD",
498"attachment : ROOT",
499"attachment : WORD '?'",
500"attachment : WORD",
501"locators : locators locator",
502"locators :",
503"locator : WORD value",
504"locator : WORD '?'",
505"flags_opt : FLAGS NUMBER",
506"flags_opt :",
507};
508#endif
509#ifdef YYSTACKSIZE10000
510#undef YYMAXDEPTH10000
511#define YYMAXDEPTH10000 YYSTACKSIZE10000
512#else
513#ifdef YYMAXDEPTH10000
514#define YYSTACKSIZE10000 YYMAXDEPTH10000
515#else
516#define YYSTACKSIZE10000 10000
517#define YYMAXDEPTH10000 10000
518#endif
519#endif
520#define YYINITSTACKSIZE200 200
521/* LINTUSED */
522int yydebug;
523int yynerrs;
524int yyerrflag;
525int yychar;
526short *yyssp;
527YYSTYPE *yyvsp;
528YYSTYPE yyval;
529YYSTYPE yylval;
530short *yyss;
531short *yysslim;
532YYSTYPE *yyvs;
533unsigned int yystacksize;
534int yyparse(void);
535#line 424 "/usr/src/usr.sbin/config/gram.y"
536
537void
538yyerror(const char *s)
539{
540
541 error("%s", s);
542}
543
544/*
545 * Cleanup procedure after syntax error: release any nvlists
546 * allocated during parsing the current line.
547 */
548static void
549cleanup(void)
550{
551 struct nvlist **np;
552 int i;
553
554 for (np = alloc, i = adepth; --i >= 0; np++)
555 nvfree(*np);
556 adepth = 0;
557}
558
559static void
560setmachine(const char *mch, const char *mcharch)
561{
562 char buf[PATH_MAX1024];
563
564 machine = mch;
565 machinearch = mcharch;
566
567 (void)snprintf(buf, sizeof buf, "arch/%s/conf/files.%s", machine, machine);
568 if (include(buf, ENDFILE268) != 0)
569 exit(1);
570
571 if (machinearch != NULL((void *)0))
572 (void)snprintf(buf, sizeof buf, "arch/%s/conf/files.%s",
573 machinearch, machinearch);
574 else
575 strlcpy(buf, _PATH_DEVNULL"/dev/null", sizeof buf);
576 if (include(buf, ENDFILE268) != 0)
577 exit(1);
578
579 if (include("conf/files", ENDFILE268) != 0)
580 exit(1);
581}
582
583static void
584check_maxpart(void)
585{
586 if (maxpartitions <= 0) {
587 stop("cannot proceed without maxpartitions specifier")error("cannot proceed without maxpartitions specifier"), exit
(1)
;
588 }
589}
590#line 583 "gram.c"
591/* allocate initial stack or double stack size, up to YYMAXDEPTH */
592static int yygrowstack(void)
593{
594 unsigned int newsize;
595 long sslen;
596 short *newss;
597 YYSTYPE *newvs;
598
599 if ((newsize = yystacksize) == 0)
3
Assuming the condition is false
4
Taking false branch
600 newsize = YYINITSTACKSIZE200;
601 else if (newsize >= YYMAXDEPTH10000)
5
Assuming 'newsize' is < YYMAXDEPTH
6
Taking false branch
602 return -1;
603 else if ((newsize *= 2) > YYMAXDEPTH10000)
7
Assuming the condition is false
8
Taking false branch
604 newsize = YYMAXDEPTH10000;
605 sslen = yyssp - yyss;
606#ifdef SIZE_MAX
607#define YY_SIZE_MAX0xffffffffU SIZE_MAX
608#else
609#define YY_SIZE_MAX0xffffffffU 0xffffffffU
610#endif
611 if (newsize && YY_SIZE_MAX0xffffffffU / newsize < sizeof *newss)
9
Assuming 'newsize' is 0
612 goto bail;
613 newss = (short *)realloc(yyss, newsize * sizeof *newss);
614 if (newss == NULL((void *)0))
10
Assuming 'newss' is not equal to NULL
11
Taking false branch
615 goto bail;
616 yyss = newss;
617 yyssp = newss + sslen;
618 if (newsize
11.1
'newsize' is 0
&& YY_SIZE_MAX0xffffffffU / newsize < sizeof *newvs)
619 goto bail;
620 newvs = (YYSTYPE *)realloc(yyvs, newsize * sizeof *newvs);
621 if (newvs == NULL((void *)0))
12
Assuming 'newvs' is not equal to NULL
13
Taking false branch
622 goto bail;
623 yyvs = newvs;
624 yyvsp = newvs + sslen;
625 yystacksize = newsize;
626 yysslim = yyss + newsize - 1;
627 return 0;
628bail:
629 if (yyss)
630 free(yyss);
631 if (yyvs)
632 free(yyvs);
633 yyss = yyssp = NULL((void *)0);
634 yyvs = yyvsp = NULL((void *)0);
635 yystacksize = 0;
636 return -1;
637}
638
639#define YYABORTgoto yyabort goto yyabort
640#define YYREJECTgoto yyabort goto yyabort
641#define YYACCEPTgoto yyaccept goto yyaccept
642#define YYERRORgoto yyerrlab goto yyerrlab
643int
644yyparse(void)
645{
646 int yym, yyn, yystate;
647#if YYDEBUG0
648 const char *yys;
649
650 if ((yys = getenv("YYDEBUG")))
651 {
652 yyn = *yys;
653 if (yyn >= '0' && yyn <= '9')
654 yydebug = yyn - '0';
655 }
656#endif /* YYDEBUG */
657
658 yynerrs = 0;
659 yyerrflag = 0;
660 yychar = (-1);
661
662 if (yyss == NULL((void *)0) && yygrowstack()) goto yyoverflow;
1
Assuming 'yyss' is equal to NULL
2
Calling 'yygrowstack'
14
Returning from 'yygrowstack'
15
Taking false branch
663 yyssp = yyss;
664 yyvsp = yyvs;
665 *yyssp = yystate = 0;
16
Use of zero-allocated memory
666
667yyloop:
668 if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
669 if (yychar < 0)
670 {
671 if ((yychar = yylex()) < 0) yychar = 0;
672#if YYDEBUG0
673 if (yydebug)
674 {
675 yys = 0;
676 if (yychar <= YYMAXTOKEN293) yys = yyname[yychar];
677 if (!yys) yys = "illegal-symbol";
678 printf("%sdebug: state %d, reading %d (%s)\n",
679 YYPREFIX"yy", yystate, yychar, yys);
680 }
681#endif
682 }
683 if ((yyn = yysindex[yystate]) && (yyn += yychar) >= 0 &&
684 yyn <= YYTABLESIZE333 && yycheck[yyn] == yychar)
685 {
686#if YYDEBUG0
687 if (yydebug)
688 printf("%sdebug: state %d, shifting to state %d\n",
689 YYPREFIX"yy", yystate, yytable[yyn]);
690#endif
691 if (yyssp >= yysslim && yygrowstack())
692 {
693 goto yyoverflow;
694 }
695 *++yyssp = yystate = yytable[yyn];
696 *++yyvsp = yylval;
697 yychar = (-1);
698 if (yyerrflag > 0) --yyerrflag;
699 goto yyloop;
700 }
701 if ((yyn = yyrindex[yystate]) && (yyn += yychar) >= 0 &&
702 yyn <= YYTABLESIZE333 && yycheck[yyn] == yychar)
703 {
704 yyn = yytable[yyn];
705 goto yyreduce;
706 }
707 if (yyerrflag) goto yyinrecovery;
708#if defined(__GNUC__4)
709 goto yynewerror;
710#endif
711yynewerror:
712 yyerror("syntax error");
713#if defined(__GNUC__4)
714 goto yyerrlab;
715#endif
716yyerrlab:
717 ++yynerrs;
718yyinrecovery:
719 if (yyerrflag < 3)
720 {
721 yyerrflag = 3;
722 for (;;)
723 {
724 if ((yyn = yysindex[*yyssp]) && (yyn += YYERRCODE256) >= 0 &&
725 yyn <= YYTABLESIZE333 && yycheck[yyn] == YYERRCODE256)
726 {
727#if YYDEBUG0
728 if (yydebug)
729 printf("%sdebug: state %d, error recovery shifting\
730 to state %d\n", YYPREFIX"yy", *yyssp, yytable[yyn]);
731#endif
732 if (yyssp >= yysslim && yygrowstack())
733 {
734 goto yyoverflow;
735 }
736 *++yyssp = yystate = yytable[yyn];
737 *++yyvsp = yylval;
738 goto yyloop;
739 }
740 else
741 {
742#if YYDEBUG0
743 if (yydebug)
744 printf("%sdebug: error recovery discarding state %d\n",
745 YYPREFIX"yy", *yyssp);
746#endif
747 if (yyssp <= yyss) goto yyabort;
748 --yyssp;
749 --yyvsp;
750 }
751 }
752 }
753 else
754 {
755 if (yychar == 0) goto yyabort;
756#if YYDEBUG0
757 if (yydebug)
758 {
759 yys = 0;
760 if (yychar <= YYMAXTOKEN293) yys = yyname[yychar];
761 if (!yys) yys = "illegal-symbol";
762 printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
763 YYPREFIX"yy", yystate, yychar, yys);
764 }
765#endif
766 yychar = (-1);
767 goto yyloop;
768 }
769yyreduce:
770#if YYDEBUG0
771 if (yydebug)
772 printf("%sdebug: state %d, reducing by rule %d (%s)\n",
773 YYPREFIX"yy", yystate, yyn, yyrule[yyn]);
774#endif
775 yym = yylen[yyn];
776 if (yym)
777 yyval = yyvsp[1-yym];
778 else
779 memset(&yyval, 0, sizeof yyval);
780 switch (yyn)
781 {
782case 1:
783#line 148 "/usr/src/usr.sbin/config/gram.y"
784{ check_maxpart(); }
785break;
786case 5:
787#line 156 "/usr/src/usr.sbin/config/gram.y"
788{ if (!srcdir) srcdir = yyvsp[-1].str; }
789break;
790case 6:
791#line 157 "/usr/src/usr.sbin/config/gram.y"
792{ if (!builddir) builddir = yyvsp[-1].str; }
793break;
794case 9:
795#line 162 "/usr/src/usr.sbin/config/gram.y"
796{ setmachine(yyvsp[-1].str,NULL((void *)0)); }
797break;
798case 10:
799#line 163 "/usr/src/usr.sbin/config/gram.y"
800{ setmachine(yyvsp[-2].str,yyvsp[-1].str); }
801break;
802case 11:
803#line 164 "/usr/src/usr.sbin/config/gram.y"
804{ stop("cannot proceed without machine specifier")error("cannot proceed without machine specifier"), exit(1); }
805break;
806case 12:
807#line 167 "/usr/src/usr.sbin/config/gram.y"
808{ enddefs(); checkfiles(); }
809break;
810case 13:
811#line 170 "/usr/src/usr.sbin/config/gram.y"
812{ yyval.list = new_nsi(yyvsp[0].str, NULL, 0)(alloc[adepth++] = newnv(yyvsp[0].str, ((void *)0), ((void *)
0), 0, ((void *)0)))
; }
813break;
814case 14:
815#line 171 "/usr/src/usr.sbin/config/gram.y"
816{ (yyval.list = yyvsp[-2].list)->nv_next = new_nsi(yyvsp[0].str, NULL, 0)(alloc[adepth++] = newnv(yyvsp[0].str, ((void *)0), ((void *)
0), 0, ((void *)0)))
; }
817break;
818case 15:
819#line 177 "/usr/src/usr.sbin/config/gram.y"
820{ addfile(yyvsp[-3].list, yyvsp[-2].list, yyvsp[-1].val, yyvsp[0].str); }
821break;
822case 16:
823#line 180 "/usr/src/usr.sbin/config/gram.y"
824{ addobject(yyvsp[-2].str, yyvsp[-1].list, yyvsp[0].val); }
825break;
826case 17:
827#line 184 "/usr/src/usr.sbin/config/gram.y"
828{ yyval.list = yyvsp[0].list; }
829break;
830case 18:
831#line 185 "/usr/src/usr.sbin/config/gram.y"
832{ yyval.list = NULL((void *)0); }
833break;
834case 19:
835#line 188 "/usr/src/usr.sbin/config/gram.y"
836{ yyval.list = yyvsp[0].list; }
837break;
838case 20:
839#line 189 "/usr/src/usr.sbin/config/gram.y"
840{ yyval.list = fx_not(yyvsp[0].list)(alloc[adepth++] = newnv(((void *)0), ((void *)0), ((void *)0
), 1, yyvsp[0].list))
; }
841break;
842case 21:
843#line 190 "/usr/src/usr.sbin/config/gram.y"
844{ yyval.list = fx_and(yyvsp[-2].list, yyvsp[0].list)(alloc[adepth++] = newnv(((void *)0), ((void *)0), yyvsp[-2].
list, 2, yyvsp[0].list))
; }
845break;
846case 22:
847#line 191 "/usr/src/usr.sbin/config/gram.y"
848{ yyval.list = fx_or(yyvsp[-2].list, yyvsp[0].list)(alloc[adepth++] = newnv(((void *)0), ((void *)0), yyvsp[-2].
list, 3, yyvsp[0].list))
; }
849break;
850case 23:
851#line 192 "/usr/src/usr.sbin/config/gram.y"
852{ yyval.list = yyvsp[-1].list; }
853break;
854case 24:
855#line 195 "/usr/src/usr.sbin/config/gram.y"
856{ yyval.list = fx_atom(yyvsp[0].str)(alloc[adepth++] = newnv(yyvsp[0].str, ((void *)0), ((void *)
0), 0, ((void *)0)))
; }
857break;
858case 25:
859#line 198 "/usr/src/usr.sbin/config/gram.y"
860{ yyval.val = yyvsp[-1].val | yyvsp[0].val; }
861break;
862case 26:
863#line 199 "/usr/src/usr.sbin/config/gram.y"
864{ yyval.val = 0; }
865break;
866case 27:
867#line 202 "/usr/src/usr.sbin/config/gram.y"
868{ yyval.val = FI_NEEDSCOUNT0x02; }
869break;
870case 28:
871#line 203 "/usr/src/usr.sbin/config/gram.y"
872{ yyval.val = FI_NEEDSFLAG0x04; }
873break;
874case 29:
875#line 206 "/usr/src/usr.sbin/config/gram.y"
876{ yyval.val = yyvsp[-1].val | yyvsp[0].val; }
877break;
878case 30:
879#line 207 "/usr/src/usr.sbin/config/gram.y"
880{ yyval.val = 0; }
881break;
882case 31:
883#line 210 "/usr/src/usr.sbin/config/gram.y"
884{ yyval.val = OI_NEEDSFLAG0x02; }
885break;
886case 32:
887#line 213 "/usr/src/usr.sbin/config/gram.y"
888{ yyval.str = yyvsp[0].str; }
889break;
890case 33:
891#line 214 "/usr/src/usr.sbin/config/gram.y"
892{ yyval.str = NULL((void *)0); }
893break;
894case 34:
895#line 217 "/usr/src/usr.sbin/config/gram.y"
896{ include(yyvsp[0].str, 0); }
897break;
898case 37:
899#line 228 "/usr/src/usr.sbin/config/gram.y"
900{ adepth = 0; }
901break;
902case 39:
903#line 230 "/usr/src/usr.sbin/config/gram.y"
904{ cleanup(); }
905break;
906case 43:
907#line 236 "/usr/src/usr.sbin/config/gram.y"
908{ (void)defattr(yyvsp[-1].str, yyvsp[0].list); }
909break;
910case 44:
911#line 237 "/usr/src/usr.sbin/config/gram.y"
912{ defoption(yyvsp[0].str); }
913break;
914case 45:
915#line 239 "/usr/src/usr.sbin/config/gram.y"
916{ defdev(yyvsp[-2].devb, 0, yyvsp[-1].list, yyvsp[0].list); }
917break;
918case 46:
919#line 241 "/usr/src/usr.sbin/config/gram.y"
920{ defdevattach(yyvsp[-1].deva, yyvsp[-4].devb, yyvsp[-2].list, yyvsp[0].list); }
921break;
922case 47:
923#line 242 "/usr/src/usr.sbin/config/gram.y"
924{ setdefmaxusers(yyvsp[-2].val, yyvsp[-1].val, yyvsp[0].val); }
925break;
926case 48:
927#line 243 "/usr/src/usr.sbin/config/gram.y"
928{ maxpartitions = yyvsp[0].val; }
929break;
930case 49:
931#line 244 "/usr/src/usr.sbin/config/gram.y"
932{ defdev(yyvsp[-1].devb,1,NULL((void *)0),yyvsp[0].list); }
933break;
934case 51:
935#line 248 "/usr/src/usr.sbin/config/gram.y"
936{ yyval.val = 1; }
937break;
938case 52:
939#line 249 "/usr/src/usr.sbin/config/gram.y"
940{ yyval.val = 0; }
941break;
942case 53:
943#line 252 "/usr/src/usr.sbin/config/gram.y"
944{ yyval.list = new_nx(yyvsp[0].str, yyvsp[-2].list)(alloc[adepth++] = newnv(yyvsp[0].str, ((void *)0), ((void *)
0), 0, yyvsp[-2].list))
; }
945break;
946case 54:
947#line 253 "/usr/src/usr.sbin/config/gram.y"
948{ yyval.list = new_n(yyvsp[0].str)(alloc[adepth++] = newnv(yyvsp[0].str, ((void *)0), ((void *)
0), 0, ((void *)0)))
; }
949break;
950case 55:
951#line 256 "/usr/src/usr.sbin/config/gram.y"
952{ yyval.str = yyvsp[0].str; }
953break;
954case 56:
955#line 257 "/usr/src/usr.sbin/config/gram.y"
956{ yyval.str = NULL((void *)0); }
957break;
958case 57:
959#line 260 "/usr/src/usr.sbin/config/gram.y"
960{ yyval.devb = getdevbase((char *)yyvsp[0].str); }
961break;
962case 58:
963#line 263 "/usr/src/usr.sbin/config/gram.y"
964{ yyval.deva = getdevattach(yyvsp[0].str); }
965break;
966case 59:
967#line 264 "/usr/src/usr.sbin/config/gram.y"
968{ yyval.deva = NULL((void *)0); }
969break;
970case 60:
971#line 267 "/usr/src/usr.sbin/config/gram.y"
972{ yyval.list = new_nx("", yyvsp[-1].list)(alloc[adepth++] = newnv("", ((void *)0), ((void *)0), 0, yyvsp
[-1].list))
; }
973break;
974case 61:
975#line 268 "/usr/src/usr.sbin/config/gram.y"
976{ yyval.list = NULL((void *)0); }
977break;
978case 62:
979#line 271 "/usr/src/usr.sbin/config/gram.y"
980{ yyval.list = yyvsp[0].list; }
981break;
982case 63:
983#line 272 "/usr/src/usr.sbin/config/gram.y"
984{ yyval.list = NULL((void *)0); }
985break;
986case 64:
987#line 276 "/usr/src/usr.sbin/config/gram.y"
988{ (yyval.list = yyvsp[-2].list)->nv_next = yyvsp[0].list; }
989break;
990case 65:
991#line 277 "/usr/src/usr.sbin/config/gram.y"
992{ yyval.list = yyvsp[0].list; }
993break;
994case 66:
995#line 281 "/usr/src/usr.sbin/config/gram.y"
996{ yyval.list = new_nsi(yyvsp[-1].str, yyvsp[0].str, 0)(alloc[adepth++] = newnv(yyvsp[-1].str, yyvsp[0].str, ((void *
)0), 0, ((void *)0)))
; }
997break;
998case 67:
999#line 282 "/usr/src/usr.sbin/config/gram.y"
1000{ yyval.list = new_nsi(yyvsp[0].str, NULL, 0)(alloc[adepth++] = newnv(yyvsp[0].str, ((void *)0), ((void *)
0), 0, ((void *)0)))
; }
1001break;
1002case 68:
1003#line 283 "/usr/src/usr.sbin/config/gram.y"
1004{ yyval.list = new_nsi(yyvsp[-2].str, yyvsp[-1].str, 1)(alloc[adepth++] = newnv(yyvsp[-2].str, yyvsp[-1].str, ((void
*)0), 1, ((void *)0)))
; }
1005break;
1006case 69:
1007#line 286 "/usr/src/usr.sbin/config/gram.y"
1008{ yyval.str = yyvsp[0].str; }
1009break;
1010case 70:
1011#line 289 "/usr/src/usr.sbin/config/gram.y"
1012{ yyval.str = yyvsp[0].str; }
1013break;
1014case 71:
1015#line 290 "/usr/src/usr.sbin/config/gram.y"
1016{ yyval.str = yyvsp[0].str; }
1017break;
1018case 72:
1019#line 291 "/usr/src/usr.sbin/config/gram.y"
1020{
1021 char bf[40];
1022
1023 (void)snprintf(bf, sizeof bf,
1024 FORMAT(yyvsp[0].val)((yyvsp[0].val) > -10 && (yyvsp[0].val) < 10 ? "%d"
: "0x%x")
, yyvsp[0].val);
1025 yyval.str = intern(bf);
1026 }
1027break;
1028case 73:
1029#line 300 "/usr/src/usr.sbin/config/gram.y"
1030{ yyval.val = yyvsp[0].val; }
1031break;
1032case 74:
1033#line 301 "/usr/src/usr.sbin/config/gram.y"
1034{ yyval.val = -yyvsp[0].val; }
1035break;
1036case 75:
1037#line 304 "/usr/src/usr.sbin/config/gram.y"
1038{ yyval.list = yyvsp[0].list; }
1039break;
1040case 76:
1041#line 305 "/usr/src/usr.sbin/config/gram.y"
1042{ yyval.list = NULL((void *)0); }
1043break;
1044case 77:
1045#line 308 "/usr/src/usr.sbin/config/gram.y"
1046{ yyval.list = new_px(yyvsp[0].attr, yyvsp[-2].list)(alloc[adepth++] = newnv(((void *)0), ((void *)0), yyvsp[0].attr
, 0, yyvsp[-2].list))
; }
1047break;
1048case 78:
1049#line 309 "/usr/src/usr.sbin/config/gram.y"
1050{ yyval.list = new_p(yyvsp[0].attr)(alloc[adepth++] = newnv(((void *)0), ((void *)0), yyvsp[0].attr
, 0, ((void *)0)))
; }
1051break;
1052case 79:
1053#line 312 "/usr/src/usr.sbin/config/gram.y"
1054{ yyval.attr = getattr(yyvsp[0].str); }
1055break;
1056case 82:
1057#line 319 "/usr/src/usr.sbin/config/gram.y"
1058{ setmajor(yyvsp[-2].devb, yyvsp[0].val); }
1059break;
1060case 85:
1061#line 331 "/usr/src/usr.sbin/config/gram.y"
1062{ adepth = 0; }
1063break;
1064case 87:
1065#line 333 "/usr/src/usr.sbin/config/gram.y"
1066{ cleanup(); }
1067break;
1068case 94:
1069#line 342 "/usr/src/usr.sbin/config/gram.y"
1070{ setmaxusers(yyvsp[0].val); }
1071break;
1072case 95:
1073#line 343 "/usr/src/usr.sbin/config/gram.y"
1074{ addconf(&conf); }
1075break;
1076case 96:
1077#line 344 "/usr/src/usr.sbin/config/gram.y"
1078{ addpseudo(yyvsp[-2].str, yyvsp[-1].val, yyvsp[0].val); }
1079break;
1080case 97:
1081#line 345 "/usr/src/usr.sbin/config/gram.y"
1082{ enabledev(yyvsp[-3].str, yyvsp[-1].str); }
1083break;
1084case 98:
1085#line 347 "/usr/src/usr.sbin/config/gram.y"
1086{ adddev(yyvsp[-5].str, yyvsp[-3].str, yyvsp[-1].list, yyvsp[0].val, yyvsp[-2].val); }
1087break;
1088case 101:
1089#line 354 "/usr/src/usr.sbin/config/gram.y"
1090{ addmkoption(yyvsp[-2].str, yyvsp[0].str); }
1091break;
1092case 104:
1093#line 361 "/usr/src/usr.sbin/config/gram.y"
1094{ removeoption(yyvsp[0].str); }
1095break;
1096case 105:
1097#line 362 "/usr/src/usr.sbin/config/gram.y"
1098{ removeoption(yyvsp[0].str); }
1099break;
1100case 106:
1101#line 365 "/usr/src/usr.sbin/config/gram.y"
1102{ addoption(yyvsp[0].str, NULL((void *)0)); }
1103break;
1104case 107:
1105#line 366 "/usr/src/usr.sbin/config/gram.y"
1106{ addoption(yyvsp[-2].str, yyvsp[0].str); }
1107break;
1108case 108:
1109#line 369 "/usr/src/usr.sbin/config/gram.y"
1110{ conf.cf_name = yyvsp[0].str;
1111 conf.cf_lineno = currentline();
1112 conf.cf_root = NULL((void *)0);
1113 conf.cf_swap = NULL((void *)0);
1114 conf.cf_dump = NULL((void *)0); }
1115break;
1116case 111:
1117#line 380 "/usr/src/usr.sbin/config/gram.y"
1118{ setconf(&conf.cf_root, "root", yyvsp[0].list); }
1119break;
1120case 112:
1121#line 381 "/usr/src/usr.sbin/config/gram.y"
1122{ setconf(&conf.cf_swap, "swap", yyvsp[0].list); }
1123break;
1124case 113:
1125#line 382 "/usr/src/usr.sbin/config/gram.y"
1126{ setconf(&conf.cf_dump, "dumps", yyvsp[0].list); }
1127break;
1128case 114:
1129#line 385 "/usr/src/usr.sbin/config/gram.y"
1130{ (yyval.list = yyvsp[-2].list)->nv_next = yyvsp[0].list; }
1131break;
1132case 115:
1133#line 386 "/usr/src/usr.sbin/config/gram.y"
1134{ yyval.list = yyvsp[0].list; }
1135break;
1136case 116:
1137#line 389 "/usr/src/usr.sbin/config/gram.y"
1138{ yyval.list = new_si(yyvsp[0].str, nodev)(alloc[adepth++] = newnv(((void *)0), yyvsp[0].str, ((void *)
0), nodev, ((void *)0)))
; }
1139break;
1140case 117:
1141#line 390 "/usr/src/usr.sbin/config/gram.y"
1142{ yyval.list = new_si(NULL, yyvsp[0].val)(alloc[adepth++] = newnv(((void *)0), ((void *)0), ((void *)0
), yyvsp[0].val, ((void *)0)))
; }
1143break;
1144case 118:
1145#line 393 "/usr/src/usr.sbin/config/gram.y"
1146{ yyval.val = makedev(yyvsp[-2].val, yyvsp[0].val)((dev_t)((((yyvsp[-2].val) & 0xff) << 8) | ((yyvsp[
0].val) & 0xff) | (((yyvsp[0].val) & 0xffff00) <<
8)))
; }
1147break;
1148case 121:
1149#line 399 "/usr/src/usr.sbin/config/gram.y"
1150{ yyval.val = yyvsp[0].val; }
1151break;
1152case 122:
1153#line 400 "/usr/src/usr.sbin/config/gram.y"
1154{ yyval.val = 1; }
1155break;
1156case 123:
1157#line 403 "/usr/src/usr.sbin/config/gram.y"
1158{ yyval.str = starref(yyvsp[-1].str); }
1159break;
1160case 124:
1161#line 404 "/usr/src/usr.sbin/config/gram.y"
1162{ yyval.str = yyvsp[0].str; }
1163break;
1164case 125:
1165#line 407 "/usr/src/usr.sbin/config/gram.y"
1166{ yyval.str = NULL((void *)0); }
1167break;
1168case 126:
1169#line 408 "/usr/src/usr.sbin/config/gram.y"
1170{ yyval.str = wildref(yyvsp[-1].str); }
1171break;
1172case 127:
1173#line 409 "/usr/src/usr.sbin/config/gram.y"
1174{ yyval.str = yyvsp[0].str; }
1175break;
1176case 128:
1177#line 412 "/usr/src/usr.sbin/config/gram.y"
1178{ (yyval.list = yyvsp[0].list)->nv_next = yyvsp[-1].list; }
1179break;
1180case 129:
1181#line 413 "/usr/src/usr.sbin/config/gram.y"
1182{ yyval.list = NULL((void *)0); }
1183break;
1184case 130:
1185#line 416 "/usr/src/usr.sbin/config/gram.y"
1186{ yyval.list = new_ns(yyvsp[-1].str, yyvsp[0].str)(alloc[adepth++] = newnv(yyvsp[-1].str, yyvsp[0].str, ((void *
)0), 0, ((void *)0)))
; }
1187break;
1188case 131:
1189#line 417 "/usr/src/usr.sbin/config/gram.y"
1190{ yyval.list = new_ns(yyvsp[-1].str, NULL)(alloc[adepth++] = newnv(yyvsp[-1].str, ((void *)0), ((void *
)0), 0, ((void *)0)))
; }
1191break;
1192case 132:
1193#line 420 "/usr/src/usr.sbin/config/gram.y"
1194{ yyval.val = yyvsp[0].val; }
1195break;
1196case 133:
1197#line 421 "/usr/src/usr.sbin/config/gram.y"
1198{ yyval.val = 0; }
1199break;
1200#line 1193 "gram.c"
1201 }
1202 yyssp -= yym;
1203 yystate = *yyssp;
1204 yyvsp -= yym;
1205 yym = yylhs[yyn];
1206 if (yystate == 0 && yym == 0)
1207 {
1208#if YYDEBUG0
1209 if (yydebug)
1210 printf("%sdebug: after reduction, shifting from state 0 to\
1211 state %d\n", YYPREFIX"yy", YYFINAL1);
1212#endif
1213 yystate = YYFINAL1;
1214 *++yyssp = YYFINAL1;
1215 *++yyvsp = yyval;
1216 if (yychar < 0)
1217 {
1218 if ((yychar = yylex()) < 0) yychar = 0;
1219#if YYDEBUG0
1220 if (yydebug)
1221 {
1222 yys = 0;
1223 if (yychar <= YYMAXTOKEN293) yys = yyname[yychar];
1224 if (!yys) yys = "illegal-symbol";
1225 printf("%sdebug: state %d, reading %d (%s)\n",
1226 YYPREFIX"yy", YYFINAL1, yychar, yys);
1227 }
1228#endif
1229 }
1230 if (yychar == 0) goto yyaccept;
1231 goto yyloop;
1232 }
1233 if ((yyn = yygindex[yym]) && (yyn += yystate) >= 0 &&
1234 yyn <= YYTABLESIZE333 && yycheck[yyn] == yystate)
1235 yystate = yytable[yyn];
1236 else
1237 yystate = yydgoto[yym];
1238#if YYDEBUG0
1239 if (yydebug)
1240 printf("%sdebug: after reduction, shifting from state %d \
1241to state %d\n", YYPREFIX"yy", *yyssp, yystate);
1242#endif
1243 if (yyssp >= yysslim && yygrowstack())
1244 {
1245 goto yyoverflow;
1246 }
1247 *++yyssp = yystate;
1248 *++yyvsp = yyval;
1249 goto yyloop;
1250yyoverflow:
1251 yyerror("yacc stack overflow");
1252yyabort:
1253 if (yyss)
1254 free(yyss);
1255 if (yyvs)
1256 free(yyvs);
1257 yyss = yyssp = NULL((void *)0);
1258 yyvs = yyvsp = NULL((void *)0);
1259 yystacksize = 0;
1260 return (1);
1261yyaccept:
1262 if (yyss)
1263 free(yyss);
1264 if (yyvs)
1265 free(yyvs);
1266 yyss = yyssp = NULL((void *)0);
1267 yyvs = yyvsp = NULL((void *)0);
1268 yystacksize = 0;
1269 return (0);
1270}