From 57cf56ce65ea7e0848566d2720e8ae40aeea12bf Mon Sep 17 00:00:00 2001 From: Edward Tomasz Napierala Date: Mon, 10 Feb 2014 15:04:59 +0000 Subject: [PATCH] Make iscsictl(8) properly handle (optional) semicolons in iscsi.conf, instead of ignoring them and echoing them to stdout. Sponsored by: The FreeBSD Foundation --- usr.bin/iscsictl/parse.y | 4 +++- usr.bin/iscsictl/token.l | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/usr.bin/iscsictl/parse.y b/usr.bin/iscsictl/parse.y index b43fb8cc5d9..e6343f81e59 100644 --- a/usr.bin/iscsictl/parse.y +++ b/usr.bin/iscsictl/parse.y @@ -57,7 +57,7 @@ extern void yyrestart(FILE *); %token AUTH_METHOD HEADER_DIGEST DATA_DIGEST TARGET_NAME TARGET_ADDRESS %token INITIATOR_NAME INITIATOR_ADDRESS INITIATOR_ALIAS USER SECRET -%token MUTUAL_USER MUTUAL_SECRET SESSION_TYPE PROTOCOL IGNORED +%token MUTUAL_USER MUTUAL_SECRET SEMICOLON SESSION_TYPE PROTOCOL IGNORED %token EQUALS OPENING_BRACKET CLOSING_BRACKET %union @@ -86,6 +86,8 @@ target: STR OPENING_BRACKET target_entries CLOSING_BRACKET target_entries: | target_entries target_entry + | + target_entries target_entry SEMICOLON ; target_entry: diff --git a/usr.bin/iscsictl/token.l b/usr.bin/iscsictl/token.l index f6c03aecc75..499ddb87f3f 100644 --- a/usr.bin/iscsictl/token.l +++ b/usr.bin/iscsictl/token.l @@ -87,7 +87,9 @@ chapDigest { return IGNORED; } \{ { return OPENING_BRACKET; } \} { return CLOSING_BRACKET; } = { return EQUALS; } +; { return SEMICOLON; } #.*$ /* ignore comments */; \n { lineno++; } [ \t]+ /* ignore whitespace */; +. { yylval.str = strdup(yytext); return STR; } %%