summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/cmd/zonecfg/zonecfg.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr/src/cmd/zonecfg/zonecfg.c b/usr/src/cmd/zonecfg/zonecfg.c
index 354591185b..d1aaec81db 100644
--- a/usr/src/cmd/zonecfg/zonecfg.c
+++ b/usr/src/cmd/zonecfg/zonecfg.c
@@ -23,6 +23,7 @@
* Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2014 Nexenta Systems, Inc. All rights reserved.
* Copyright 2014 Gary Mills
+ * Copyright 2019 Joyent, Inc.
*/
/*
@@ -1822,14 +1823,16 @@ quoteit(char *instr)
static void
export_prop(FILE *of, int prop_num, char *prop_id)
{
- char *quote_str;
-
if (strlen(prop_id) == 0)
return;
- quote_str = quoteit(prop_id);
- (void) fprintf(of, "%s %s=%s\n", cmd_to_str(CMD_SET),
- pt_to_str(prop_num), quote_str);
- free(quote_str);
+ /*
+ * We're going to explicitly quote all strings on export.
+ * This should be fine since it seems that no amount of escaping
+ * will coerce zonecfg to properly parse a double quote as
+ * part of the string value.
+ */
+ (void) fprintf(of, "%s %s=\"%s\"\n", cmd_to_str(CMD_SET),
+ pt_to_str(prop_num), prop_id);
}
void