Bug 184067 - losetup has permission problems
losetup has permission problems
Product: Fedora
Classification: Fedora
Component: util-linux (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
: 185083 (view as bug list)
Depends On:
  Show dependency treegraph
Reported: 2006-03-05 15:57 EST by Mike Coffin
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2006-03-12 11:42:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Mike Coffin 2006-03-05 15:57:13 EST
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>
Actual results:

Expected results:

Additional info:
Comment 1 Karel Zak 2006-03-09 12:33:15 EST
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.
Comment 2 Karel Zak 2006-03-09 12:39:30 EST
Sorry: s/Danie/Dan/ :-)
Comment 3 Daniel Walsh 2006-03-09 13:36:06 EST
This should be fixes with updated policy in latest rawhide.  We no longer
transition unconfined_t to mount or fsadm.
Comment 4 Karel Zak 2006-03-12 11:43:53 EST
*** Bug 185083 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.