summaryrefslogtreecommitdiff
path: root/usr/src/cmd/zonecfg
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2019-12-18 12:53:38 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2019-12-18 12:53:38 +0000
commitdfbd50d8db03bb9bc7350af3a750cd017d66d0c0 (patch)
tree21b9f755196e5d6855df14fccc57df4bb7b16abc /usr/src/cmd/zonecfg
parent7124086f69f79873694e092aaeeca4dc4505248d (diff)
parentcf01ae8a5d067a3ba8327d8bc6be298d84204a4d (diff)
downloadillumos-joyent-dfbd50d8db03bb9bc7350af3a750cd017d66d0c0.tar.gz
[illumos-gate merge]release-20191219
commit cf01ae8a5d067a3ba8327d8bc6be298d84204a4d 12056 mdb: add mdb_dumpptr_cb as default callback for mdb_dumpptr() commit 15ab2c88fabf7859fc2e59b9c88614461f58d4c9 12089 loader.efi: ExitBootServices() can fail even if we got memory map commit 427723622c44f91d933c66b35e3de35f4ccd4669 12060 Convert Intro(9S) to mandoc 12061 Convert cb_ops(9S) to mandoc 12062 Convert buf(9S) to mandoc 12063 Convert free_rtn(9S) to mandoc 12064 Convert iovec(9S) to mandoc 12065 Convert aio_req(9S) to mandoc 12066 Convert copyreq(9S) to mandoc commit c8236ea6ad6caec3ccd52d13b0345b7881f0c12c 11894 zonecfg export should quote strings
Diffstat (limited to 'usr/src/cmd/zonecfg')
-rw-r--r--usr/src/cmd/zonecfg/zonecfg.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr/src/cmd/zonecfg/zonecfg.c b/usr/src/cmd/zonecfg/zonecfg.c
index 00fa901539..20f30e6e0c 100644
--- a/usr/src/cmd/zonecfg/zonecfg.c
+++ b/usr/src/cmd/zonecfg/zonecfg.c
@@ -1891,14 +1891,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