Description of problem: Running firewall.cmd to change the permanent config fails like this with setenforce 1: # firewall-cmd --add-port 1234/tcp --permanent Error: Backup of '/etc/firewalld/zones/public.xml' failed: [Errno 13] Permission denied: '/etc/firewalld/zones/public.xml.old' It succeeds with setenforce 0. Version-Release number of selected component (if applicable): firewalld-0.3.14.2-4.fc23.noarch
Ahh, selinux version: selinux-policy-targeted-3.13.1-138.fc23.noarch
Just updated to F23, same issue: [root@torrent ~]# firewall-cmd --runtime-to-permanent Error: RT_TO_PERM_FAILED: zone 'public' : org.fedoraproject.FirewallD1.Exception: Backup of '/etc/firewalld/zones/public.xml' failed: [Errno 13] Permission denied: '/etc/firewalld/zones/public.xml.old' [root@torrent ~]# rpm -q firewalld firewalld-0.3.14.2-4.fc23.noarch [root@torrent ~]# rpm -q selinux-policy-targeted selinux-policy-targeted-3.13.1-152.fc23.noarch [root@torrent ~]# setenforce 0 [root@torrent ~]# firewall-cmd --runtime-to-permanent success
[root@torrent audit]# grep firewalld audit.log|grep AVC | audit2why type=AVC msg=audit(1447421196.268:487): avc: denied { relabelfrom } for pid=812 comm="firewalld" name="public.xml.old" dev="dm-1" ino=395314 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 Was caused by: #Constraint rule: # constrain file { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED # Possible cause is the source user (system_u) and target user (unconfined_u) are different.
Good news - Firewall-cmd --permanent has started working for me even with setenforce 1 in recent FC23 updates... I'm not setting this to CLOSED RESOLVED because I'm not the original bug filer and can't verify the issue on the machine it was originally reported on.
Same error here on up to date F23: [root@T14 ~] # firewall-cmd --runtime-to-permanent Error: RT_TO_PERM_FAILED: zone 'public' : org.fedoraproject.FirewallD1.Exception: Backup of '/etc/firewalld/zones/public.xml' failed: [Errno 13] Permission denied: '/etc/firewalld/zones/public.xml.old' [root@T14 ~] # lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: Fedora Description: Fedora release 23 (Twenty Three) Release: 23 Codename: TwentyThree [root@T14 ~] # [root@T14 ~] # grep firewalld /var/log/audit/audit.log | grep AVC type=AVC msg=audit(1450649588.201:1178): avc: denied { relabelfrom } for pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 type=AVC msg=audit(1450649602.675:1179): avc: denied { relabelfrom } for pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 type=AVC msg=audit(1450649690.120:1183): avc: denied { relabelfrom } for pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 type=AVC msg=audit(1450649722.071:1184): avc: denied { relabelfrom } for pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 type=AVC msg=audit(1450649843.488:1192): avc: denied { relabelfrom } for pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 [root@T14 ~] #
(In reply to strasharo2000 from comment #5) > Same error here on up to date F23: > > [root@T14 ~] # firewall-cmd --runtime-to-permanent > Error: RT_TO_PERM_FAILED: zone 'public' : > org.fedoraproject.FirewallD1.Exception: Backup of > '/etc/firewalld/zones/public.xml' failed: [Errno 13] Permission denied: > '/etc/firewalld/zones/public.xml.old' > [root@T14 ~] # lsb_release -a > LSB Version: > :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1- > amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4. > 1-amd64:printing-4.1-noarch > Distributor ID: Fedora > Description: Fedora release 23 (Twenty Three) > Release: 23 > Codename: TwentyThree > [root@T14 ~] # > > > [root@T14 ~] # grep firewalld /var/log/audit/audit.log | grep AVC > type=AVC msg=audit(1450649588.201:1178): avc: denied { relabelfrom } for > pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 > scontext=system_u:system_r:firewalld_t:s0 > tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 > type=AVC msg=audit(1450649602.675:1179): avc: denied { relabelfrom } for > pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 > scontext=system_u:system_r:firewalld_t:s0 > tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 > type=AVC msg=audit(1450649690.120:1183): avc: denied { relabelfrom } for > pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 > scontext=system_u:system_r:firewalld_t:s0 > tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 > type=AVC msg=audit(1450649722.071:1184): avc: denied { relabelfrom } for > pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 > scontext=system_u:system_r:firewalld_t:s0 > tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 > type=AVC msg=audit(1450649843.488:1192): avc: denied { relabelfrom } for > pid=2492 comm="firewalld" name="public.xml.old" dev="dm-1" ino=2365085 > scontext=system_u:system_r:firewalld_t:s0 > tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 > [root@T14 ~] # Please add the output of "restorecon -rv /etc/firewalld"
[root@T14 ~] # restorecon -rv /etc/firewalld [root@T14 ~] #
I also managed to run into this now. The backup files are not correctly labeled. Assingning to selinux-policy-targetd-
This happens if the root user was running firewalld directly or if the user root copied a file into the firewalld configuration directory. firewalld will create a backup of the old file by renaming it to <filename>.old Here are steps to reproduce: 1) cp /usr/lib/firewalld/zones/public.xml /etc/firewalld/zones/foobar.xml 2) After 5 seconds when firewalld picked it up, do a change with firewalld: firewall-cmd --permanent --zone=foobar --add-service=samba Error: Backup of '/etc/firewalld/zones/foobar.xml' failed: [Errno 13] Permission denied: '/etc/firewalld/zones/foobar.xml.old' # ls -Z /etc/firewalld/zones/foobar.xml* unconfined_u:object_r:firewalld_etc_rw_t:s0 /etc/firewalld/zones/foobar.xml system_u:object_r:firewalld_etc_rw_t:s0 /etc/firewalld/zones/foobar.xml.old
[root@T14 zones] # ls -lZ total 24 -rw-r--r--. 1 root root system_u:object_r:firewalld_etc_rw_t:s0 315 Dec 21 00:17 FedoraServer.xml -rw-r--r--. 1 root root system_u:object_r:firewalld_etc_rw_t:s0 525 Dec 21 00:17 FedoraWorkstation.xml -rw-r--r--. 1 root root system_u:object_r:firewalld_etc_rw_t:s0 369 Dec 21 00:17 home.xml -rw-r--r--. 1 root root system_u:object_r:firewalld_etc_rw_t:s0 384 Dec 21 00:17 internal.xml -rw-rw-r--. 1 root root system_u:object_r:firewalld_etc_rw_t:s0 340 Feb 15 2015 public.xml -rw-rw-r--. 1 root root unconfined_u:object_r:firewalld_etc_rw_t:s0 340 Feb 15 2015 public.xml.old [root@T14 zones] #
Same error here on up to date F23, with firewall-config
I ran into this today. As per above the context is wrong on the public.xml file so I copied the context from one of the other correct xml files: # chcon --reference=/etc/firewalld/zones/internal.xml /etc/firewalld/zones/public.xml # firewall-cmd --runtime-to-permanent All works and I did not have to drop SELinux Enforcing. There is something wrong in the policy since the following does not correct the issue: # restorecon -Rv /etc/firewalld/zones
This message is a reminder that Fedora 23 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 23. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '23'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 23 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.
Bug still exists with F26: [root@index01 ~]# firewall-cmd --set-log-denied off Error: Backup of '/etc/firewalld/firewalld.conf' failed: [Errno 13] Permission denied: '/etc/firewalld/firewalld.conf.old' [root@index01 ~]# [root@index01 ~]# ausearch -m avc -ts recent ---- time->Tue Sep 5 21:41:00 2017 type=AVC msg=audit(1504640460.494:11400): avc: denied { relabelto } for pid=26293 comm="firewalld" name="firewalld.conf.old" dev="xvda3" ino=201898453 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 [root@index01 ~]# [root@index01 ~]# ausearch -m avc -ts recent | audit2why type=AVC msg=audit(1504640460.494:11400): avc: denied { relabelto } for pid=26293 comm="firewalld" name="firewalld.conf.old" dev="xvda3" ino=201898453 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 Was caused by: #Constraint rule: # constrain file { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED # Possible cause is the source user (system_u) and target user (unconfined_u) are different. type=AVC msg=audit(1504640517.161:11401): avc: denied { relabelto } for pid=26293 comm="firewalld" name="firewalld.conf.old" dev="xvda3" ino=201898453 scontext=system_u:system_r:firewalld_t:s0 tcontext=unconfined_u:object_r:firewalld_etc_rw_t:s0 tclass=file permissive=0 Was caused by: #Constraint rule: # constrain file { create relabelfrom relabelto } ((u1 == u2 -Fail-) or (t1 == can_change_object_identity -Fail-) ); Constraint DENIED # Possible cause is the source user (system_u) and target user (unconfined_u) are different. [root@index01 ~]#
This bug is currently reported against a Fedora version which is already unsuported. I am changing the version to '27', the latest supported release. Please check whether this bug is still an issue on the '27' release. If you find this bug not being applicable on this release, please close it.
This message is a reminder that Fedora 27 is nearing its end of life. On 2018-Nov-30 Fedora will stop maintaining and issuing updates for Fedora 27. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '27'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 27 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete.
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed.