Description of problem: I've noticed a strange interaction with custom ports and booleans. After setting a boolean, the list of ports for a particular type (which has been customized) shows duplicate entries. Example: $ semanage port -a -t http_port_t -p tcp 12345 $ semanage port -l | grep http_port_t http_port_t tcp 12345, 80, 81, ... $ setsebool -P zebra_write_config false $ semanage port -l | grep http_port_t http_port_t tcp 12345, 12345, 80, 81, ... $ setsebool -P zebra_write_config false $ semanage port -l | grep http_port_t http_port_t tcp 12345, 12345, 12345, 80, 81, ... As can be seen, each time a boolean is set persistently (it doesn't matter which boolean or which state), the custom port 12345 is duplicated. Running "semodule -B" clears the duplicates. However, if only the local customizations are listed, the port is always listed only once: $ semanage port -l -C SELinux Port Type Proto Port Number http_port_t tcp 12345 Version-Release number of selected component (if applicable): libselinux-2.5-13.fc25.x86_64 (Originally found this on CentOS 7.3's "libselinux-2.5-6.el7.x86_64"). How reproducible: Always I've submitted this upstream here: https://github.com/SELinuxProject/selinux/issues/50
Thanks for the report! A fix is available at upstream mailing list now - https://marc.info/?l=selinux&m=149183707331194&w=2
You'll also want 8702a865e08b5660561e194a83e4a363061edc03 if you want to avoid a regression in setsebool -P runtime and memory overhead.
Added b61922f727d5643265e27654a2d626bcae5d894c and 8702a865e08b5660561e194a83e4a363061edc03 Thanks!
libsemanage-2.6-3.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-165322f06a
libsemanage-2.5-9.fc25 has been submitted as an update to Fedora 25. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ea82d19050
libsemanage-2.5-9.fc25 has been pushed to the Fedora 25 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-ea82d19050
libsemanage-2.6-3.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report. See https://fedoraproject.org/wiki/QA:Updates_Testing for instructions on how to install test updates. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-165322f06a
libsemanage-2.5-9.fc25 has been pushed to the Fedora 25 stable repository. If problems still persist, please make note of it in this bug report.
libsemanage-2.6-3.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.