#1957 Issue closed: Two slightly different 500_selinux_autorelabel.sh get sourced

Labels: cleanup, fixed / solved / done

jsmeix opened issue at 2018-11-08 08:30:

  • ReaR version ("/usr/sbin/rear -V"):
    Current ReaR master code

  • Description of the issue (ideally so that others can reproduce it):
    In current ReaR master code source directory:

# usr/sbin/rear -s recover | grep 500_selinux_autorelabel
Source restore/NETFS/default/500_selinux_autorelabel.sh
Source restore/default/500_selinux_autorelabel.sh

# ls -l $( find usr/share/rear -name '*.sh' | grep 500_selinux_autorelabel )
lrwxrwxrwx ... usr/share/rear/restore/BLOCKCLONE/default/500_selinux_autorelabel.sh -> ../../NETFS/default/500_selinux_autorelabel.sh
-rw-r--r-- 1 ... usr/share/rear/restore/default/500_selinux_autorelabel.sh
-rw-r--r-- 1 ... usr/share/rear/restore/NETFS/default/500_selinux_autorelabel.sh

FYI:
I noticed it when inspecting rear-dc1dsydb106.log
from https://github.com/chrismorgan240

gdha commented at 2018-11-13 16:56:

Seems like script usr/share/rear/restore/default/500_selinux_autorelabel.sh respect the value of BACKUP_SELINUX_DISABLE, but in script usr/share/rear/restore/NETFS/default/500_selinux_autorelabel.sh we force a relabel to happen after the restore has happened (will be effective during the next booting). The value BACKUP_SELINUX_DISABLE should be respected, but probably we wanted to play very safe.
The two scripts should be kept separated IMHO.

gdha commented at 2019-03-27 17:38:

Perhaps we better postpone SELinux stuff to 2.6 so that we can audit the selinux behaviour inside rear - the variable BACKUP_SELINUX_DISABLE is a rather meaningless name and as said some redesign might be needed in the light of enabled SELinux backup/restore?

jsmeix commented at 2019-03-28 10:45:

There are no actual issues because of it, so we can "just postpone" it.

gdha commented at 2020-05-27 07:57:

We wrote additional comments in these scripts to explain the reason of their presence. We may not remove them as such.


[Export of Github issue for rear/rear.]