diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2014-03-17 15:20:44 +0100 |
---|---|---|
committer | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-03-20 17:32:20 +0000 |
commit | 58a84f8c252d816add483bd95375d39c48549656 (patch) | |
tree | 91e6c2076135c1a8f438a0d8c5d856e379e925db | |
parent | 63adcd52a728d0798fa4a66d4ce9062282e8f5bf (diff) | |
download | libosinfo-58a84f8c252d816add483bd95375d39c48549656.tar.gz |
osinfo-install-script: read config values as strings
Prefer xmlNewDocRawNode to xmlNewDocNode when the content is a raw
string.
Solves this problem:
$ osinfo-install-script rhel6.5 -c "admin-password=a&b"
error : unterminated entity reference b
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | osinfo/osinfo_install_script.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c index 1a0b579..b6fe1ab 100644 --- a/osinfo/osinfo_install_script.c +++ b/osinfo/osinfo_install_script.c @@ -670,8 +670,8 @@ static xmlNodePtr osinfo_install_script_generate_entity_xml(OsinfoInstallScript goto error; } - if (!(data = xmlNewDocNode(NULL, NULL, (const xmlChar*)"id", - (const xmlChar*)osinfo_entity_get_id(entity)))) { + if (!(data = xmlNewDocRawNode(NULL, NULL, (const xmlChar*)"id", + (const xmlChar*)osinfo_entity_get_id(entity)))) { xmlErrorPtr err = xmlGetLastError(); g_set_error(error, 0, 0, _("Unable to create XML node 'id': '%s'"), err ? err->message : ""); @@ -698,8 +698,8 @@ static xmlNodePtr osinfo_install_script_generate_entity_xml(OsinfoInstallScript tmp2 = values; while (tmp2) { - if (!(data = xmlNewDocNode(NULL, NULL, (const xmlChar*)tmp1->data, - (const xmlChar*)tmp2->data))) { + if (!(data = xmlNewDocRawNode(NULL, NULL, (const xmlChar*)tmp1->data, + (const xmlChar*)tmp2->data))) { xmlErrorPtr err = xmlGetLastError(); g_set_error(error, 0, 0, _("Unable to create XML node '%s': '%s'"), (const gchar *)tmp1->data, err ? err->message : ""); |