2 /* $NetBSD: veriexecctl_conf.l,v 1.13 2009/10/28 17:25:44 christos Exp $ */
5 * Copyright 2005 Elad Efrat <elad@NetBSD.org>
6 * Copyright 2005 Brett Lymn <blymn@netbsd.org>
10 * This code has been donated to The NetBSD Foundation by the Author.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer.
17 * 2. The name of the author may not be used to endorse or promote products
18 * derived from this software withough specific prior written permission
20 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
21 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
22 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
23 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
24 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
25 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
29 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 #include <prop/proplib.h>
41 #include "veriexecctl_parse.h"
49 dequote(const char *s)
58 if (*p == '\\' && *(p+1))
64 buf = malloc(len + 1);
71 if (*p == '\\' && *(p+1))
90 if ((yylval.string = dequote(yytext)) == NULL)
91 err(1, "Cannot allocate string");
95 /* string (fingerprint, type, options) */
97 if ((yylval.string = strdup(yytext)) == NULL)
98 err(1, "Cannot allocate string");
102 /* comments, white-outs */
110 /* eol on a line with data. need a call to ioctl, return eol */
122 warnx("Invalid character '%c' in line %zu",