Red Hat Bugzilla – Bug 1292926
firewalld --new-service & malformed xml ??
Last modified: 2016-11-03 17:02:04 EDT
Description of problem:
I prepare an xml:
<description>A Layer 2 Tunneling Protocol VPN client/daemon for Linux and other POSIX-based OSs. Based off of L2TPd 0.61.</description>
<port protocol="udp" port="1701"/>
$ firewall-cmd --permanent --new-service=xl2tpd
I see file got copied into /etc/firewalld/services/ but
$ firewall-cmd --get-services
show no such service, so I do: systemctl restart firewalld - now --get-services list it but I end up with:
<?xml version="1.0" encoding="utf-8"?>
effectively having no results on iptables after adding the service to a zone
Version-Release number of selected component (if applicable):
Steps to Reproduce:
--new-service creates a new service, but is not using a local file for this. This would be very good to add, though.
I think about --new-service-from-file=<file> or --new-service=<name> --file=<file>
I see.. Yes, it would be very useful indeed to be able to use prepped file.
also, if I may, --service-info which could dump whole lot about service would be nice too.
and would it great not to have to reload the daemon to see this newly added service.
I've just come across something, I've tried man pages but could not find any info on '&' char.
And it seems that if it is in .xml file (I had in <description>) then firewalld omits silently.
The ampersand is a special character in XML: https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
If you are writing into an XML file, you need to take care about the syntax.
yes, but this - if one makes one mistake in one .xml then the rest, if there are other custom services xmls, get silently skipped! Services are there listed as attached to zones but ports are not opened!
test it - make a mistake in <port> eg. put 443,444 instead of 443-444 (and I imagine many of us will be makeing it, old iptables style habit) and all custom services are affected.
I'd be nice to have firewalld resilient to this.
(In reply to lejeczek from comment #9)
> yes, but this - if one makes one mistake in one .xml then the rest, if there
> are other custom services xmls, get silently skipped! Services are there
> listed as attached to zones but ports are not opened!
Please open an extra bug for this - it is a different issue.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.