diff options
author | jpaetzel <jpaetzel@FreeBSD.org> | 2014-06-27 17:10:28 +0000 |
---|---|---|
committer | jpaetzel <jpaetzel@FreeBSD.org> | 2014-06-27 17:10:28 +0000 |
commit | 79ef481e2b33a1c7f8d214041fe5b51b47d6e9f9 (patch) | |
tree | 0dac65b593aa46ec26d878692190b00fb01c9730 /usr.sbin/ctld/parse.y | |
parent | c17570f4b122b08e9ad6dc2c7a694d42444fe19f (diff) | |
download | FreeBSD-src-79ef481e2b33a1c7f8d214041fe5b51b47d6e9f9.zip FreeBSD-src-79ef481e2b33a1c7f8d214041fe5b51b47d6e9f9.tar.gz |
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
Diffstat (limited to 'usr.sbin/ctld/parse.y')
-rw-r--r-- | usr.sbin/ctld/parse.y | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/usr.sbin/ctld/parse.y b/usr.sbin/ctld/parse.y index e4b160e..645201b 100644 --- a/usr.sbin/ctld/parse.y +++ b/usr.sbin/ctld/parse.y @@ -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); } ; |