summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/halt/halt.c9
1 files changed, 7 insertions, 2 deletions
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);
}
/*