A user reported to Joyent an error they were having while trying to migrate a zone across compute nodes. They would do a zonecfg export, zfs send/recv, then zonecfg import on the destination.
Unfortunately this cased a problem with many zones because SmartOS base64 encodes the zone alias, a value provided by zone tenants. In one case, the zone had the following attribute:
add attr
set name=alias
set type=string
set value=c291cC1iaHl2ZQ==
end
and zonecfg would return an error attempting to parse the value.
# zonecfg -z 1f73c20e-926c-604c-bb5a-e0d8d5f2083b -f 1f73c20e-926c-604c-bb5a-e0d8d5f2083b.zcfg
syntax error on line 99 at ‘='
Editing the zone file before import and either quoting the entire string or removing the b64 padding characters (the "=" chars at the end of the string) let them import the zone.
Considering that zonecfg doesn't consider the padding characters valid syntax, quoting attributes during export seems like the easiest solution. Research from John Levon, Jerry Jelinek and myself shows that indiscriminately quoting, whether it's strictly necessary or not, is safe.