Bug 184067 - losetup has permission problems
Summary: losetup has permission problems
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 5
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
URL:
Whiteboard:
: 185083 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-05 20:57 UTC by Mike Coffin
Modified: 2007-11-30 22:11 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2006-03-12 16:42:52 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Mike Coffin 2006-03-05 20:57:13 UTC
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:

Comment 1 Karel Zak 2006-03-09 17:33:15 UTC
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 17:39:30 UTC
Sorry: s/Danie/Dan/ :-)

Comment 3 Daniel Walsh 2006-03-09 18:36:06 UTC
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 16:43:53 UTC
*** 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.