diff options
author | trasz <trasz@FreeBSD.org> | 2014-03-06 11:07:51 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2014-03-06 11:07:51 +0000 |
commit | 9cc265a09072aa709615a136879e67ed37efc66b (patch) | |
tree | 29999baf220da2a8a5ab03ca3bfe7c70fe1e9e8d /usr.bin/iscsictl | |
parent | b379e28a77b5c26c1bb527f9a1cb8f823d8bebfa (diff) | |
download | FreeBSD-src-9cc265a09072aa709615a136879e67ed37efc66b.zip FreeBSD-src-9cc265a09072aa709615a136879e67ed37efc66b.tar.gz |
MFC r261714:
Make iscsictl(8) properly handle (optional) semicolons in iscsi.conf,
instead of ignoring them and echoing them to stdout.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'usr.bin/iscsictl')
-rw-r--r-- | usr.bin/iscsictl/parse.y | 4 | ||||
-rw-r--r-- | usr.bin/iscsictl/token.l | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/iscsictl/parse.y b/usr.bin/iscsictl/parse.y index b43fb8c..e6343f8 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 f6c03ae..499ddb8 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; } %% |