svn commit: r261714 - head/usr.bin/iscsictl

Edward Tomasz Napierala trasz at FreeBSD.org
Mon Feb 10 15:05:00 UTC 2014


Author: trasz
Date: Mon Feb 10 15:04:59 2014
New Revision: 261714
URL: http://svnweb.freebsd.org/changeset/base/261714

Log:
  Make iscsictl(8) properly handle (optional) semicolons in iscsi.conf,
  instead of ignoring them and echoing them to stdout.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/usr.bin/iscsictl/parse.y
  head/usr.bin/iscsictl/token.l

Modified: head/usr.bin/iscsictl/parse.y
==============================================================================
--- head/usr.bin/iscsictl/parse.y	Mon Feb 10 15:03:08 2014	(r261713)
+++ head/usr.bin/iscsictl/parse.y	Mon Feb 10 15:04:59 2014	(r261714)
@@ -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_entr
 target_entries:
 	|
 	target_entries target_entry
+	|
+	target_entries target_entry SEMICOLON
 	;
 
 target_entry:

Modified: head/usr.bin/iscsictl/token.l
==============================================================================
--- head/usr.bin/iscsictl/token.l	Mon Feb 10 15:03:08 2014	(r261713)
+++ head/usr.bin/iscsictl/token.l	Mon Feb 10 15:04:59 2014	(r261714)
@@ -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; }
 %%


More information about the svn-src-all mailing list