Bug 219645 - Can't mount with additional contexts
Can't mount with additional contexts
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils (Show other bugs)
5.0
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-12-14 11:53 EST by Karel Zak
Modified: 2007-11-30 17:07 EST (History)
6 users (show)

See Also:
Fixed In Version: 5.0.0
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-01-15 09:30:16 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Karel Zak 2006-12-14 11:53:09 EST
+++ This bug was initially created as a clone of Bug #211827 +++

# mount -o loop,context=root:object_r:root_t:s0:c1,c4 foo /mnt
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

See discussion here for more details:
https://www.redhat.com/archives/redhat-lspp/2006-October/msg00208.html

-- Additional comment from bnocera@redhat.com on 2006-10-23 09:12 EST --
Let me know if a kernel bug is needed as well, I'll get the TAM to open a new IT
for it.

-- Additional comment from kzak@redhat.com on 2006-10-23 10:07 EST --
The patches are waiting in my INBOX, but it's a surprise for me that we expect
this change in RHEL5 GA. My plan was add this feature to rawhide (fc7). 

The patch to nfsmount.c is useless -- in RHEL5 we use separate mount.nfs (from
the nfs-utils package) instead the old NFS from from util-linux. It means you
have to open a new IT/BZ request for nfs-utils too. (Please, assign to me --
I'll fix it in both packages.)


-- Additional comment from tao@redhat.com on 2006-10-24 14:44 EST --

A separate BZ was opened for the kernel change. I had put in a note in the
IT. But the BZ is 211857 if you want to grab it.
Comment 1 RHEL Product and Program Management 2006-12-15 01:40:41 EST
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux major release.  Product Management has requested further
review of this request by Red Hat Engineering, for potential inclusion in a Red
Hat Enterprise Linux Major release.  This request is not yet committed for
inclusion.
Comment 2 Jay Turner 2006-12-18 12:53:25 EST
Seems a little late to take in something like this.  What's the business impact
of not taking the change?
Comment 3 Eric Paris 2006-12-18 13:07:58 EST
NFS being basically useless in many/most SELinux environments?  The change has
already gone into kernel, it has already gone into mount utilities for local
filesystems, the patch is just missing from the NFS mount utility.

many users use -o context="your context here" to mount NFS shares so that
daemons like apache can then use that data.  Without this change there will be
no way for users to mount NFS with a given context.
Comment 4 Karel Zak 2006-12-18 13:31:59 EST
We need to support this in nfs-utils, because we already support it in standard
mount. The patch for /sbin/mount.nfs is almost same like for standard
/bin/mount. I'm going to apply the patch ASAP.
Comment 5 Karel Zak 2006-12-18 18:25:38 EST
Fixed. Update to nfs-utils-1.0.9-16.el5.
Comment 6 Jay Turner 2007-01-03 10:14:14 EST
[root@haring tmp]# rpm -q nfs-utils
nfs-utils-1.0.9-16.el5.i386
[root@haring tmp]# uname -r
2.6.18-1.2943.el5

[root@haring tmp]# mount -o loop,context=root:object_r:root_t:s0:c1,c4 boot.iso
/mnt/qa
mount: wrong fs type, bad option, bad superblock on /dev/loop0,
       missing codepage or other error
       In some cases useful info is found in syslog - try
       dmesg | tail  or so

Dropping the ",c4" from the command works.
Comment 8 Karel Zak 2007-01-05 08:16:45 EST
It works -- see bug #211827. You have to use quotes! 

 mount -o loop,context=\"root:object_r:root_t:s0:c1,c4\" boot.iso /mnt/qa

Comment 10 Jay Turner 2007-01-05 08:40:03 EST
Ah yes, all better now on all accounts.
Comment 11 Jay Turner 2007-01-15 09:30:16 EST
nfs-utils-1.0.9-16.el5 included in 20070111.1 and 20070112.3.

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