Index: head/usr.sbin/ctld/Makefile =================================================================== --- head/usr.sbin/ctld/Makefile (revision 352123) +++ head/usr.sbin/ctld/Makefile (revision 352124) @@ -1,30 +1,30 @@ # $FreeBSD$ .include CFLAGS+=-I${SRCTOP}/contrib/libucl/include .PATH: ${SRCTOP}/contrib/libucl/include PROG= ctld SRCS= chap.c ctld.c discovery.c isns.c kernel.c keys.c log.c SRCS+= login.c parse.y pdu.c token.l y.tab.h uclparse.c CFLAGS+= -I${.CURDIR} CFLAGS+= -I${SRCTOP}/sys CFLAGS+= -I${SRCTOP}/sys/cam/ctl CFLAGS+= -I${SRCTOP}/sys/dev/iscsi #CFLAGS+= -DICL_KERNEL_PROXY MAN= ctld.8 ctl.conf.5 -LIBADD= bsdxml l md sbuf util ucl m nv +LIBADD= bsdxml md sbuf util ucl m nv YFLAGS+= -v CLEANFILES= y.tab.c y.tab.h y.output WARNS?= 6 NO_WMISSING_VARIABLE_DECLARATIONS= .if ${MK_ISCSI} != "no" CFLAGS+= -DWANT_ISCSI .endif .include Index: head/usr.sbin/ctld/token.l =================================================================== --- head/usr.sbin/ctld/token.l (revision 352123) +++ head/usr.sbin/ctld/token.l (revision 352124) @@ -1,98 +1,99 @@ %{ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2012 The FreeBSD Foundation * All rights reserved. * * This software was developed by Edward Tomasz Napierala under sponsorship * from the FreeBSD Foundation. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * * $FreeBSD$ */ #include #include #include #include "y.tab.h" int lineno; #define YY_DECL int yylex(void) extern int yylex(void); %} +%option noyywrap %option noinput %option nounput %% alias { return ALIAS; } auth-group { return AUTH_GROUP; } auth-type { return AUTH_TYPE; } backend { return BACKEND; } blocksize { return BLOCKSIZE; } chap { return CHAP; } chap-mutual { return CHAP_MUTUAL; } ctl-lun { return CTL_LUN; } debug { return DEBUG; } device-id { return DEVICE_ID; } device-type { return DEVICE_TYPE; } discovery-auth-group { return DISCOVERY_AUTH_GROUP; } discovery-filter { return DISCOVERY_FILTER; } foreign { return FOREIGN; } initiator-name { return INITIATOR_NAME; } initiator-portal { return INITIATOR_PORTAL; } listen { return LISTEN; } listen-iser { return LISTEN_ISER; } lun { return LUN; } maxproc { return MAXPROC; } offload { return OFFLOAD; } option { return OPTION; } path { return PATH; } pidfile { return PIDFILE; } isns-server { return ISNS_SERVER; } isns-period { return ISNS_PERIOD; } isns-timeout { return ISNS_TIMEOUT; } port { return PORT; } portal-group { return PORTAL_GROUP; } redirect { return REDIRECT; } serial { return SERIAL; } size { return SIZE; } tag { return TAG; } target { return TARGET; } timeout { return TIMEOUT; } \"[^"]+\" { yylval.str = strndup(yytext + 1, strlen(yytext) - 2); return STR; } [a-zA-Z0-9\.\-@_/\:\[\]]+ { yylval.str = strdup(yytext); return STR; } \{ { return OPENING_BRACKET; } \} { return CLOSING_BRACKET; } #.*$ /* ignore comments */; \r\n { lineno++; } \n { lineno++; } ; { return SEMICOLON; } [ \t]+ /* ignore whitespace */; . { yylval.str = strdup(yytext); return STR; } %% Index: head/usr.sbin/ndiscvt/Makefile =================================================================== --- head/usr.sbin/ndiscvt/Makefile (revision 352123) +++ head/usr.sbin/ndiscvt/Makefile (revision 352124) @@ -1,29 +1,27 @@ # $FreeBSD$ .PATH: ${SRCTOP}/sys/compat/ndis PROG= ndiscvt SRCS= ndiscvt.c SRCS+= subr_pe.c SRCS+= inf.c inf-token.l inf-parse.y y.tab.h MAN= ndiscvt.8 MAN+= ndisgen.8 WARNS?= 4 NO_WCAST_ALIGN= -LIBADD= l - YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} -I${SRCTOP}/sys CLEANFILES= y.output FILES= windrv_stub.c FILESDIR= ${SHAREDIR}/misc SCRIPTS= ndisgen.sh .include Index: head/usr.sbin/ndiscvt/inf-token.l =================================================================== --- head/usr.sbin/ndiscvt/inf-token.l (revision 352123) +++ head/usr.sbin/ndiscvt/inf-token.l (revision 352124) @@ -1,133 +1,134 @@ %{ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 2003 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include "y.tab.h" int lineno = 1; int yylex(void); void yyerror(const char *); static void update_lineno(const char *cp) { while (*cp) if (*cp++ == '\n') lineno++; } %} +%option noyywrap %option nounput %option noinput %% [ \t]+ ; \n { lineno++; return EOL; } \r ; ;.*$ ; \/\/.*$ ; = { return EQUALS; } , { return COMMA; } \"(\\\"|[^"]|\"\")*\" { int len = strlen(yytext) - 2; int blen = len + 1; char *walker; int i; update_lineno(yytext); yylval.str = (char *)malloc(blen); if (yylval.str == NULL) goto out; walker = yylval.str; for (i = 1; i <= len; i++) { if (yytext[i] == '\"') { switch (yytext[i + 1]) { case '\"': i++; break; default: break; } } if (yytext[i] == '\\') { switch (yytext[i + 1]) { case '\n': i += 2; while(isspace(yytext[i])) i++; break; case '\"': i++; break; case '(': i++; break; default: break; } } *walker++ = yytext[i]; } *walker++ = '\0'; out:; return STRING; } \[[a-zA-Z0-9%&\{\}\-\.\/_\\\*\ ]+\] { int len = strlen(yytext); yytext[len-1] = '\0'; yylval.str = strdup(yytext+1); return SECTION; } [a-zA-Z0-9%&\{\}\-\.\/_\\\*]+ { yylval.str = strdup(yytext); return WORD; } %% void yyerror(const char *s) { errx(1, "line %d: %s%s %s.", lineno, yytext, yytext?":":"", s); }