Index: stable/11/sbin/devd/Makefile =================================================================== --- stable/11/sbin/devd/Makefile (revision 352279) +++ stable/11/sbin/devd/Makefile (revision 352280) @@ -1,25 +1,25 @@ # $FreeBSD$ .include PACKAGE=runtime PROG_CXX=devd SRCS= devd.cc token.l parse.y y.tab.h MAN= devd.8 devd.conf.5 WARNS?= 3 NO_SHARED?=YES -LIBADD= l util +LIBADD= util YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} CLEANFILES= y.output .if ${MK_TESTS} != "no" SUBDIR+= tests .endif .include Index: stable/11/sbin/devd/token.l =================================================================== --- stable/11/sbin/devd/token.l (revision 352279) +++ stable/11/sbin/devd/token.l (revision 352280) @@ -1,114 +1,115 @@ %{ /*- * DEVD (Device action daemon) * * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2002 M. Warner Losh . * 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. * * 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 #include "devd.h" #include "y.tab.h" int lineno = 1; static void update_lineno(const char *cp) { while (*cp) if (*cp++ == '\n') lineno++; } %} +%option noyywrap %option nounput %option noinput %% [ \t]+ ; \n lineno++; ; { return SEMICOLON; } #.*$ ; \/\/.*$ ; \/\*([^*]|(\*+([^*\/])))*\*+\/ { update_lineno(yytext); } \{ { return BEGINBLOCK; } \} { return ENDBLOCK; } [0-9]+ { yylval.i = atoi(yytext); return NUMBER; } \"[^"]+\" { int len = strlen(yytext) - 2; char *walker; int i; update_lineno(yytext); if ((yylval.str = (char *) malloc(len + 1)) == NULL) goto out; walker = yylval.str; for (i = 1; i <= len; i++) { if (yytext[i] == '\\' && yytext[i + 1] == '\n') { i += 2; while(isspace(yytext[i])) i++; } *walker++ = yytext[i]; } *walker++ = '\0'; out:; return STRING; } options { return OPTIONS; } set { return SET; } directory { return DIRECTORY; } pid-file { return PID_FILE; } attach { return ATTACH; } detach { return DETACH; } device-name { return DEVICE_NAME; } media-type { return MEDIA_TYPE; } class { return CLASS; } subdevice { return SUBDEVICE; } action { return ACTION; } match { return MATCH; } nomatch { return NOMATCH; } notify { return NOTIFY; } [A-Za-z][A-Za-z0-9_-]* { yylval.str = strdup(yytext); return ID; } %% void yyerror(const char *s) { syslog(LOG_ERR, "line %d: %s%s %s.\n", lineno, yytext, yytext?":":"", s); } Index: stable/11/usr.sbin/apmd/Makefile =================================================================== --- stable/11/usr.sbin/apmd/Makefile (revision 352279) +++ stable/11/usr.sbin/apmd/Makefile (revision 352280) @@ -1,19 +1,17 @@ # $FreeBSD$ PROG= apmd MAN= apmd.8 MANSUBDIR= /i386 SRCS= apmd.c apmdlex.l apmdparse.y y.tab.h PACKAGE=apm WARNS?= 3 -LIBADD= l - CFLAGS+= -I${.CURDIR} test: ./apmd -d -f etc/apmd.conf -n .include Index: stable/11/usr.sbin/apmd/apmdlex.l =================================================================== --- stable/11/usr.sbin/apmd/apmdlex.l (revision 352279) +++ stable/11/usr.sbin/apmd/apmdlex.l (revision 352280) @@ -1,119 +1,120 @@ %{ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * APM (Advanced Power Management) Event Dispatcher * * Copyright (c) 1999 Mitsuru IWASAKI * Copyright (c) 1999 KOIE Hidetaka * 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. * * 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 #include "apmd.h" #include "y.tab.h" int lineno; int first_time; %} /* We don't need it, avoid the warning. */ +%option noyywrap %option nounput %option noinput %s TOP %% %{ if (first_time) { BEGIN TOP; lineno = 1; first_time = 0; } %} [ \t]+ ; \n lineno++; , { return COMMA; } ; { return SEMICOLON; } #.*$ ; apm_event { return APMEVENT; } NOEVENT { yylval.ev = EVENT_NOEVENT; return EVENT; } STANDBYREQ { yylval.ev = EVENT_STANDBYREQ; return EVENT; } SUSPENDREQ { yylval.ev = EVENT_SUSPENDREQ; return EVENT; } NORMRESUME { yylval.ev = EVENT_NORMRESUME; return EVENT; } CRITRESUME { yylval.ev = EVENT_CRITRESUME; return EVENT; } BATTERYLOW { yylval.ev = EVENT_BATTERYLOW; return EVENT; } POWERSTATECHANGE { yylval.ev = EVENT_POWERSTATECHANGE; return EVENT; } UPDATETIME { yylval.ev = EVENT_UPDATETIME; return EVENT; } CRITSUSPEND { yylval.ev = EVENT_CRITSUSPEND; return EVENT; } USERSTANDBYREQ { yylval.ev = EVENT_USERSTANDBYREQ; return EVENT; } USERSUSPENDREQ { yylval.ev = EVENT_USERSUSPENDREQ; return EVENT; } STANDBYRESUME { yylval.ev = EVENT_STANDBYRESUME; return EVENT; } CAPABILITIESCHANGE { yylval.ev = EVENT_CAPABILITIESCHANGE; return EVENT; } apm_battery { return APMBATT; } charging { return BATTCHARGE; } discharging { return BATTDISCHARGE; } [0-9]+% { yylval.i = atoi(yytext); return BATTPERCENT; } [0-9]+[Mm] { yylval.i = -atoi(yytext); return BATTTIME; } exec { return EXECCMD; } reject { return REJECTCMD; } \{ { return BEGINBLOCK; } \} { return ENDBLOCK; } \"[^"]+\" { int len = strlen(yytext) - 2; if ((yylval.str = (char *) malloc(len + 1)) == NULL) goto out; memcpy(yylval.str, yytext + 1, len); yylval.str[len] = '\0'; out: return STRING; } [^"{},;#\n\t ]+ { yylval.str = strdup(yytext); return UNKNOWN; } %% void yyerror(const char *s) { syslog(LOG_ERR, "line %d: %s%s %s.\n", lineno, yytext, yytext?":":"", s); } Index: stable/11/usr.sbin/config/Makefile =================================================================== --- stable/11/usr.sbin/config/Makefile (revision 352279) +++ stable/11/usr.sbin/config/Makefile (revision 352280) @@ -1,27 +1,27 @@ # @(#)Makefile 8.1 (Berkeley) 6/6/93 # $FreeBSD$ SRCDIR:=${.PARSEDIR:tA} PROG= config MAN= config.5 config.8 SRCS= config.y main.c lang.l mkmakefile.c mkheaders.c \ mkoptions.c y.tab.h kernconf.c FILE2C?=file2c kernconf.c: kernconf.tmpl ${FILE2C} 'char kernconfstr[] = {' ',0};' < \ ${SRCDIR}/kernconf.tmpl > kernconf.c CFLAGS+= -I. -I${SRCDIR} NO_WMISSING_VARIABLE_DECLARATIONS= -LIBADD= l nv sbuf +LIBADD= nv sbuf CLEANFILES+= kernconf.c mkmakefile.o: configvers.h .include Index: stable/11/usr.sbin/ctld/Makefile =================================================================== --- stable/11/usr.sbin/ctld/Makefile (revision 352279) +++ stable/11/usr.sbin/ctld/Makefile (revision 352280) @@ -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 +LIBADD= bsdxml md sbuf util ucl m 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: stable/11/usr.sbin/ctld/token.l =================================================================== --- stable/11/usr.sbin/ctld/token.l (revision 352279) +++ stable/11/usr.sbin/ctld/token.l (revision 352280) @@ -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: stable/11/usr.sbin/jail/Makefile =================================================================== --- stable/11/usr.sbin/jail/Makefile (revision 352279) +++ stable/11/usr.sbin/jail/Makefile (revision 352280) @@ -1,27 +1,27 @@ # $FreeBSD$ .include PROG= jail MAN= jail.8 jail.conf.5 SRCS= jail.c command.c config.c state.c jailp.h jaillex.l jailparse.y y.tab.h -LIBADD= jail kvm util l +LIBADD= jail kvm util PACKAGE=jail NO_WMISSING_VARIABLE_DECLARATIONS= YFLAGS+=-v CFLAGS+=-I. -I${.CURDIR} .if ${MK_INET6_SUPPORT} != "no" CFLAGS+= -DINET6 .endif .if ${MK_INET_SUPPORT} != "no" CFLAGS+= -DINET .endif CLEANFILES= y.output .include Index: stable/11/usr.sbin/jail/jaillex.l =================================================================== --- stable/11/usr.sbin/jail/jaillex.l (revision 352279) +++ stable/11/usr.sbin/jail/jaillex.l (revision 352280) @@ -1,237 +1,238 @@ %{ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 2011 James Gritton * 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. * * 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. */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include "jailp.h" #include "y.tab.h" extern int yynerrs; static ssize_t text2lval(size_t triml, size_t trimr, int tovar); static int instr; static int lineno = 1; #define YY_DECL int yylex(void) %} +%option noyywrap %option noinput %option nounput %start _ DQ %% /* Whitespace or equivalent */ <_>[ \t]+ instr = 0; <_>#.* ; <_>\/\/.* ; <_>\/\*([^*]|(\*+([^*\/])))*\*+\/ { const char *s; for (s = yytext; s < yytext + yyleng; s++) if (*s == '\n') lineno++; instr = 0; } <_>\n { lineno++; instr = 0; } /* Reserved tokens */ <_>\+= { instr = 0; return PLEQ; } <_>[,;={}] { instr = 0; return yytext[0]; } /* Atomic (unquoted) strings */ <_,DQ>[A-Za-z0-9_!%&()\-.:<>?@\[\]^`|~]+ | <_,DQ>\\(.|\n|[0-7]{1,3}|x[0-9A-Fa-f]{1,2}) | <_,DQ>[$*+/\\] { (void)text2lval(0, 0, 0); return instr ? STR1 : (instr = 1, STR); } /* Single and double quoted strings */ <_>'([^\'\\]|\\(.|\n))*' { (void)text2lval(1, 1, 0); return instr ? STR1 : (instr = 1, STR); } <_>\"([^"\\]|\\(.|\n))*\" | [^\"$\\]([^"\\]|\\(.|\n))*\" { size_t skip; ssize_t atvar; skip = yytext[0] == '"' ? 1 : 0; atvar = text2lval(skip, 1, 1); if (atvar < 0) BEGIN _; else { /* * The string has a variable inside it. * Go into DQ mode to get the variable * and then the rest of the string. */ BEGIN DQ; yyless(atvar); } return instr ? STR1 : (instr = 1, STR); } \" BEGIN _; /* Variables, single-word or bracketed */ <_,DQ>$[A-Za-z_][A-Za-z_0-9]* { (void)text2lval(1, 0, 0); return instr ? VAR1 : (instr = 1, VAR); } <_>$\{([^\n{}]|\\(.|\n))*\} | $\{([^\n\"{}]|\\(.|\n))*\} { (void)text2lval(2, 1, 0); return instr ? VAR1 : (instr = 1, VAR); } /* Partially formed bits worth complaining about */ <_>\/\*([^*]|(\*+([^*\/])))*\** { warnx("%s line %d: unterminated comment", cfname, lineno); yynerrs++; } <_>'([^\n'\\]|\\.)* | <_>\"([^\n\"\\]|\\.)* { warnx("%s line %d: unterminated string", cfname, lineno); yynerrs++; } <_>$\{([^\n{}]|\\.)* | $\{([^\n\"{}]|\\.)* { warnx("%s line %d: unterminated variable", cfname, lineno); yynerrs++; } /* A hack because "<0>" rules aren't allowed */ <_>. return yytext[0]; .|\n { BEGIN _; yyless(0); } %% void yyerror(const char *s) { if (!yytext) warnx("%s line %d: %s", cfname, lineno, s); else if (!yytext[0]) warnx("%s: unexpected EOF", cfname); else warnx("%s line %d: %s: %s", cfname, lineno, yytext, s); } /* * Copy string from yytext to yylval, handling backslash escapes, * and optionally stopping at the beginning of a variable. */ static ssize_t text2lval(size_t triml, size_t trimr, int tovar) { char *d; const char *s, *se; yylval.cs = d = emalloc(yyleng - trimr - triml + 1); se = yytext + (yyleng - trimr); for (s = yytext + triml; s < se; s++, d++) { if (*s != '\\') { if (tovar && *s == '$') { *d = '\0'; return s - yytext; } if (*s == '\n') lineno++; *d = *s; continue; } s++; if (*s >= '0' && *s <= '7') { *d = *s - '0'; if (s + 1 < se && s[1] >= '0' && s[1] <= '7') { *d = 010 * *d + (*++s - '0'); if (s + 1 < se && s[1] >= '0' && s[1] <= '7') *d = 010 * *d + (*++s - '0'); } continue; } switch (*s) { case 'a': *d = '\a'; break; case 'b': *d = '\b'; break; case 'f': *d = '\f'; break; case 'n': *d = '\n'; break; case 'r': *d = '\r'; break; case 't': *d = '\t'; break; case 'v': *d = '\v'; break; case '\n': d--; lineno++; break; default: *d = *s; break; case 'x': *d = 0; if (s + 1 >= se) break; if (s[1] >= '0' && s[1] <= '9') *d = *++s - '0'; else if (s[1] >= 'A' && s[1] <= 'F') *d = *++s + (0xA - 'A'); else if (s[1] >= 'a' && s[1] <= 'f') *d = *++s + (0xa - 'a'); else break; if (s + 1 >= se) break; if (s[1] >= '0' && s[1] <= '9') *d = *d * 0x10 + (*++s - '0'); else if (s[1] >= 'A' && s[1] <= 'F') *d = *d * 0x10 + (*++s + (0xA - 'A')); else if (s[1] >= 'a' && s[1] <= 'f') *d = *d * 0x10 + (*++s + (0xa - 'a')); } } *d = '\0'; return -1; } Index: stable/11/usr.sbin/kbdcontrol/Makefile =================================================================== --- stable/11/usr.sbin/kbdcontrol/Makefile (revision 352279) +++ stable/11/usr.sbin/kbdcontrol/Makefile (revision 352280) @@ -1,13 +1,11 @@ # $FreeBSD$ PROG= kbdcontrol MAN= kbdcontrol.1 kbdmap.5 MLINKS= kbdmap.5 keymap.5 SRCS= kbdcontrol.c lex.l WARNS?= 4 CFLAGS+= -I${.CURDIR} -LIBADD= l - .include Index: stable/11/usr.sbin/kbdcontrol/lex.l =================================================================== --- stable/11/usr.sbin/kbdcontrol/lex.l (revision 352279) +++ stable/11/usr.sbin/kbdcontrol/lex.l (revision 352280) @@ -1,153 +1,154 @@ /*- * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * * Copyright (c) 1994-1995 Søren Schmidt * 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, * in this position and unchanged. * 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. The name of the author may not be used to endorse or promote products * derived from this software without specific prior written permission * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 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 "lex.h" %} +%option noyywrap %option nounput %option noinput D [0-9] X [0-9a-fA-F] A . L [OCNB] %% nop { return TNOP; } lshift { return TLSH; } rshift { return TRSH; } clock { return TCLK; } nlock { return TNLK; } slock { return TSLK; } lalt|alt { return TLALT; } btab { return TBTAB; } lctrl|ctrl { return TLCTR; } nscr { return TNEXT; } pscr { return TPREV; } rctrl { return TRCTR; } ralt { return TRALT; } alock { return TALK; } ashift { return TASH; } meta { return TMETA; } boot { return TRBT; } debug { return TDBG; } susp { return TSUSP; } saver { return TSPSC; } panic { return TPANIC; } lshifta|shifta { return TLSHA; } rshifta { return TRSHA; } lctrla|ctrla { return TLCTRA; } rctrla { return TRCTRA; } lalta|alta { return TLALTA; } ralta { return TRALTA; } halt { return THALT; } pdwn { return TPDWN; } paste { return TPASTE; } NUL|nul { number = 0; return TNUM; } SOH|soh { number = 1; return TNUM; } STX|stx { number = 2; return TNUM; } ETX|etx { number = 3; return TNUM; } EOT|eot { number = 4; return TNUM; } ENQ|enq { number = 5; return TNUM; } ACK|ack { number = 6; return TNUM; } BEL|bel { number = 7; return TNUM; } BS|bs { number = 8; return TNUM; } HT|ht { number = 9; return TNUM; } LF|lf|NL|nl { number = 10; return TNUM; } VT|vt { number = 11; return TNUM; } FF|ff|NP|np { number = 12; return TNUM; } CR|cr { number = 13; return TNUM; } SO|so { number = 14; return TNUM; } SI|si { number = 15; return TNUM; } DLE|dle { number = 16; return TNUM; } DC1|dc1 { number = 17; return TNUM; } DC2|dc2 { number = 18; return TNUM; } DC3|dc3 { number = 19; return TNUM; } DC4|dc4 { number = 20; return TNUM; } NAK|nak { number = 21; return TNUM; } SYN|syn { number = 22; return TNUM; } ETB|etb { number = 23; return TNUM; } CAN|can { number = 24; return TNUM; } EM|em { number = 25; return TNUM; } SUB|sub { number = 26; return TNUM; } ESC|esc { number = 27; return TNUM; } FS|fs { number = 28; return TNUM; } GS|gs { number = 29; return TNUM; } RS|rs { number = 30; return TNUM; } NS|ns { number = 31; return TNUM; } US|us { number = 31; return TNUM; } SP|sp { number = 32; return TNUM; } DEL|del { number = 127; return TNUM; } dgra|DGRA { number = 0; return TACC; } dacu|DACU { number = 1; return TACC; } dcir|DCIR { number = 2; return TACC; } dtil|DTIL { number = 3; return TACC; } dmac|DMAC { number = 4; return TACC; } dbre|DBRE { number = 5; return TACC; } ddot|DDOT { number = 6; return TACC; } duml|DUML { number = 7; return TACC; } ddia|DDIA { number = 7; return TACC; } dsla|DSLA { number = 8; return TACC; } drin|DRIN { number = 9; return TACC; } dced|DCED { number = 10; return TACC; } dapo|DAPO { number = 11; return TACC; } ddac|DDAC { number = 12; return TACC; } dogo|DOGO { number = 13; return TACC; } dcar|DCAR { number = 14; return TACC; } fkey{D}({D}*) { sscanf(yytext+4, "%d", &number); return TFUNC; } scr{D}({D}*) { sscanf(yytext+3, "%d", &number); return TSCRN; } '{A}' { letter = *(yytext+1); return TLET; } #({A}*) { /* ignore */ } 0x{X}({X}*) { sscanf(yytext, "%x", &number); return TNUM; } {D}({D}*) { sscanf(yytext, "%d", &number); return TNUM; } {L} { if (*yytext == 'O') number = 0; if (*yytext == 'C') number = 1; if (*yytext == 'N') number = 2; if (*yytext == 'B') number = 3; return TFLAG; } [ \t\n] { /* ignore */ } . { return *yytext; } Index: stable/11/usr.sbin/ndiscvt/Makefile =================================================================== --- stable/11/usr.sbin/ndiscvt/Makefile (revision 352279) +++ stable/11/usr.sbin/ndiscvt/Makefile (revision 352280) @@ -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: stable/11/usr.sbin/ndiscvt/inf-token.l =================================================================== --- stable/11/usr.sbin/ndiscvt/inf-token.l (revision 352279) +++ stable/11/usr.sbin/ndiscvt/inf-token.l (revision 352280) @@ -1,131 +1,132 @@ %{ /* * 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); } Index: stable/11/usr.sbin/rrenumd/Makefile =================================================================== --- stable/11/usr.sbin/rrenumd/Makefile (revision 352279) +++ stable/11/usr.sbin/rrenumd/Makefile (revision 352280) @@ -1,37 +1,37 @@ # Copyright (c) 1996 WIDE Project. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modifications, are permitted provided that the above copyright notice # and this paragraph are duplicated in all such forms and that any # documentation, advertising materials, and other materials related to # such distribution and use acknowledge that the software was developed # by the WIDE Project, Japan. The name of the Project may not be used to # endorse or promote products derived from this software without # specific prior written permission. THIS SOFTWARE IS PROVIDED ``AS IS'' # AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT # LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # A PARTICULAR PURPOSE. # # $FreeBSD$ PROG= rrenumd MAN= rrenumd.conf.5 rrenumd.8 SRCS= rrenumd.c parser.y lexer.l CFLAGS+= -DIPSEC -I. -I${.CURDIR} YFLAGS= -d WARNS?= 2 -LIBADD= ipsec l y +LIBADD= ipsec CLEANFILES= y.tab.h SRCS+= y.tab.h y.tab.h: parser.y .if defined(YACCDEBUG) CFLAGS+= -DYYDEBUG YFLAGS+= -t -v .endif .include Index: stable/11/usr.sbin/rrenumd/lexer.l =================================================================== --- stable/11/usr.sbin/rrenumd/lexer.l (revision 352279) +++ stable/11/usr.sbin/rrenumd/lexer.l (revision 352280) @@ -1,269 +1,270 @@ /* $KAME: lexer.l,v 1.7 2000/11/08 02:40:53 itojun Exp $ */ /* * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. * 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. Neither the name of the project nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE PROJECT 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 PROJECT 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 #include #include #include #include #include #include #include "y.tab.h" int lineno = 1; #define LINEBUF_SIZE 1000 char linebuf[LINEBUF_SIZE]; int parse(FILE **); void yyerror(const char *); int yylex(void); %} +%option noyywrap %option nounput /* common section */ nl \n ws [ \t]+ digit [0-9] letter [0-9A-Za-z] hexdigit [0-9A-Fa-f] special [()+\|\?\*,] dot \. hyphen \- colon \: slash \/ bcl \{ ecl \} semi \; usec {dot}{digit}{1,6} comment \#.* qstring \"[^"]*\" decstring {digit}+ hexpair {hexdigit}{hexdigit} hexstring 0[xX]{hexdigit}+ octetstring {octet}({dot}{octet})+ ipv4addr {digit}{1,3}({dot}{digit}{1,3}){0,3} ipv6addr {hexdigit}{0,4}({colon}{hexdigit}{0,4}){2,7} ipaddrmask {slash}{digit}{1,3} keyword {letter}{letter}+ name {letter}(({letter}|{digit}|{hyphen})*({letter}|{digit}))* hostname {name}(({dot}{name})+{dot}?)? timeval {digit}{0,2} days d{timeval} hours h{timeval} minutes m{timeval} seconds s{timeval} mprefix match_prefix|match-prefix uprefix use_prefix|use-prefix %% /* rrenumd keywords */ debug { return(DEBUG_CMD); } dest { return(DEST_CMD); } retry { return(RETRY_CMD); } seqnum { return(SEQNUM_CMD); } add { yylval.num = RPM_PCO_ADD; return(ADD); } change { yylval.num = RPM_PCO_CHANGE; return(CHANGE); } setglobal { yylval.num = RPM_PCO_SETGLOBAL; return(SETGLOBAL); } {mprefix} { return(MATCH_PREFIX_CMD); } maxlen { return(MAXLEN_CMD); } minlen { return(MINLEN_CMD); } {uprefix} { return(USE_PREFIX_CMD); } keeplen { return(KEEPLEN_CMD); } vltime { return(VLTIME_CMD); } pltime { return(PLTIME_CMD); } raf_onlink { return(RAF_ONLINK_CMD); } raf_auto { return(RAF_AUTO_CMD); } rrf_decrvalid { return(RAF_DECRVALID_CMD); } rrf_decrprefd { return(RAF_DECRPREFD_CMD); } {days} { yytext++; yylval.num = atoi(yytext); return(DAYS); } {hours} { yytext++; yylval.num = atoi(yytext); return(HOURS); } {minutes} { yytext++; yylval.num = atoi(yytext); return(MINUTES); } {seconds} { yytext++; yylval.num = atoi(yytext); return(SECONDS); } infinity { return(INFINITY); } on { yylval.num = 1; return(ON); } off { yylval.num = 0; return(OFF); } /* basic rules */ {ws} ; {nl} { lineno++; } {semi} { return EOS; } {bcl} { return BCL; } {ecl} { return ECL; } {qstring} { yylval.cs.cp = yytext; yylval.cs.len = yyleng; return QSTRING; } {decstring} { yylval.cs.cp = yytext; yylval.cs.len = yyleng; return DECSTRING; } {name} { yylval.cs.cp = yytext; yylval.cs.len = yyleng; return NAME; } {ipv4addr} { memset(&yylval.addr4, 0, sizeof(struct in_addr)); if (inet_pton(AF_INET, yytext, &yylval.addr4) == 1) { return IPV4ADDR; } else { return ERROR; } } {ipv6addr} { memset(&yylval.addr6, 0, sizeof(struct in6_addr)); if (inet_pton(AF_INET6, yytext, &yylval.addr6) == 1) { return IPV6ADDR; } else { return ERROR; } } {ipaddrmask} { yytext++; yylval.num = atoi(yytext); return(PREFIXLEN); } {hostname} { yylval.cs.cp = yytext; yylval.cs.len = yyleng; return HOSTNAME; } %% int parse(FILE **fp) { extern int yyparse(void); yyin = *fp; if (yyparse()) return(-1); return(0); } void yyerror(const char *s) { printf("%s: at %s in line %d\n", s, yytext, lineno); } Index: stable/11 =================================================================== --- stable/11 (revision 352279) +++ stable/11 (revision 352280) Property changes on: stable/11 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r352119-352124,352130