svn commit: r267962 - stable/10/usr.sbin/ctld
Josh Paetzel
jpaetzel at FreeBSD.org
Fri Jun 27 17:10:29 UTC 2014
Author: jpaetzel
Date: Fri Jun 27 17:10:28 2014
New Revision: 267962
URL: http://svnweb.freebsd.org/changeset/base/267962
Log:
MFC: 267833
Fix issues in config parser relating to lun serial numbers.
Without this fix some serial numbers needed to be quoted
to avoid the config parser bailing out.
Submitted by: delphij
Sponsored by: iXsystems
Modified:
stable/10/usr.sbin/ctld/parse.y
stable/10/usr.sbin/ctld/token.l
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/usr.sbin/ctld/parse.y
==============================================================================
--- stable/10/usr.sbin/ctld/parse.y Fri Jun 27 16:33:43 2014 (r267961)
+++ stable/10/usr.sbin/ctld/parse.y Fri Jun 27 17:10:28 2014 (r267962)
@@ -659,6 +659,19 @@ lun_serial: SERIAL STR
}
lun_set_serial(lun, $2);
free($2);
+ } | SERIAL NUM
+ {
+ char *str = NULL;
+
+ if (lun->l_serial != NULL) {
+ log_warnx("serial for lun %d, target \"%s\" "
+ "specified more than once",
+ lun->l_lun, target->t_name);
+ return (1);
+ }
+ asprintf(&str, "%ju", $2);
+ lun_set_serial(lun, str);
+ free(str);
}
;
Modified: stable/10/usr.sbin/ctld/token.l
==============================================================================
--- stable/10/usr.sbin/ctld/token.l Fri Jun 27 16:33:43 2014 (r267961)
+++ stable/10/usr.sbin/ctld/token.l Fri Jun 27 17:10:28 2014 (r267962)
@@ -74,8 +74,9 @@ target { return TARGET; }
timeout { return TIMEOUT; }
[0-9]+[kKmMgGtTpPeE]? { if (expand_number(yytext, &yylval.num) == 0)
return NUM;
- else
- return STR;
+ else {
+ yylval.str = strdup(yytext); return STR;
+ }
}
\"[^"]+\" { yylval.str = strndup(yytext + 1,
strlen(yytext) - 2); return STR; }
More information about the svn-src-stable-10
mailing list