From 9e573dcc6440324d76c37be570afdef86f045685 Mon Sep 17 00:00:00 2001 From: Toomas Soome Date: Thu, 30 Oct 2014 15:24:08 +0200 Subject: 5104 reboot should check for (and remove) extra -B zfs-bootfs options. Reviewed by: Garrett D'Amore Reviewed by: Josef 'Jeff' Sipek Reviewed by: Igor Kozhukhov Reviewed by: Hans Rosenfeld Approved by: Gordon Ross --- usr/src/cmd/halt/halt.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'usr/src') diff --git a/usr/src/cmd/halt/halt.c b/usr/src/cmd/halt/halt.c index ba969a369c..36867c88dc 100644 --- a/usr/src/cmd/halt/halt.c +++ b/usr/src/cmd/halt/halt.c @@ -1210,8 +1210,13 @@ parse_fastboot_args(char *bootargs_buf, size_t buf_size, } if (is_zfs && (buflen != 0 || bename != NULL)) { - /* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */ - off += sprintf(bootargs_buf + off, "%s ", bootfs_arg); + /* do not copy existing zfs boot args */ + if (strstr(&bootargs_saved[rootlen], "-B") == NULL || + strstr(&bootargs_saved[rootlen], "zfs-bootfs=") == NULL || + (strstr(&bootargs_saved[rootlen], "bootpath=") == NULL && + strstr(&bootargs_saved[rootlen], "diskdevid=") == NULL)) + /* LINTED E_SEC_SPRINTF_UNBOUNDED_COPY */ + off += sprintf(bootargs_buf + off, "%s ", bootfs_arg); } /* -- cgit v1.2.3