Description of problem: /sbin/losetup /sbin/losetup /dev/loop0 /usr/local/zoo/.jdk1.4.2.tmp fails with "/usr/local/zoo/.jdk1.4.2.tmp: Permission denied". This occurs even though the file has permissions wr permissions for all, and the losetup command is run as root. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. sudo /sbin/losetup /dev/loop0 <some file> 2. 3. Actual results: Expected results: Additional info:
This a problem with selinux file labels. The losetup command is able to use files with fsadm_tmp_t or swapfile_t labels only. It means you have to change it. # dd if=/dev/zero of=/root/testfile bs=1024 count=65536 # ls -Z /root/testfile -rw-r--r-- root root root:object_r:user_home_t /root/testfile # chcon -t fsadm_tmp_t /root/testfile # ls -Z /root/testfile -rw-r--r-- root root root:object_r:fsadm_tmp_t /root/testfile # losetup /dev/loop0 /root/testfile # losetup -a /dev/loop0: [fd00]:17350081 (/root/testfile) Danie, can you check if "fsadm_tmp_t" is a good way or there should be any extra type or permission for any other type (like user_home_t)? Thanks.
Sorry: s/Danie/Dan/ :-)
This should be fixes with updated policy in latest rawhide. We no longer transition unconfined_t to mount or fsadm.
*** Bug 185083 has been marked as a duplicate of this bug. ***