Michal Luscon 85a6551
From 3142564b244b3163446d59f83390f73cea85097b Mon Sep 17 00:00:00 2001
Michal Luscon 85a6551
From: Karel Zak <kzak@redhat.com>
Michal Luscon 85a6551
Date: Tue, 10 Jan 2012 15:43:56 +0100
Michal Luscon 85a6551
Subject: [PATCH] mount: add hint that context= has to be quoted
Michal Luscon 85a6551
Michal Luscon 85a6551
Addresses: http://bugzilla.redhat.com/show_bug.cgi?id=747038
Michal Luscon 85a6551
Signed-off-by: Karel Zak <kzak@redhat.com>
Michal Luscon 85a6551
---
Michal Luscon 85a6551
 mount/mount.8 |   17 ++++++++++++++++-
Michal Luscon 85a6551
 1 files changed, 16 insertions(+), 1 deletions(-)
Michal Luscon 85a6551
Michal Luscon 85a6551
diff --git a/mount/mount.8 b/mount/mount.8
Michal Luscon 85a6551
index 2c4f636..00b512e 100644
Michal Luscon 85a6551
--- a/mount/mount.8
Michal Luscon 85a6551
+++ b/mount/mount.8
Michal Luscon 85a6551
@@ -839,7 +839,7 @@ xattrs are supported, you can save time not having to label every file by
Michal Luscon 85a6551
 assigning the entire disk one security context.
Michal Luscon 85a6551
 
Michal Luscon 85a6551
 A commonly used option for removable media is
Michal Luscon 85a6551
-.BR context=system_u:object_r:removable_t .
Michal Luscon 85a6551
+.BR context="system_u:object_r:removable_t" .
Michal Luscon 85a6551
 
Michal Luscon 85a6551
 Two other options are
Michal Luscon 85a6551
 .BR fscontext=
Michal Luscon 85a6551
@@ -875,8 +875,23 @@ useful for things like stateless linux.
Michal Luscon 85a6551
 Note that kernel rejects any remount request that includes the context
Michal Luscon 85a6551
 option even if unchanged from the current context.
Michal Luscon 85a6551
 
Michal Luscon 85a6551
+.B Warning that \fIcontext\fP value might contains comma
Michal Luscon 85a6551
+and in this case the value has to be properly quoted otherwise
Michal Luscon 85a6551
+.BR mount (8)
Michal Luscon 85a6551
+will interpret the comma as separator between mount options. Don't forget that
Michal Luscon 85a6551
+shell strips off quotes and
Michal Luscon 85a6551
+.BR "double quoting is required" ,
Michal Luscon 85a6551
+for example:
Michal Luscon 85a6551
+.RS
Michal Luscon 85a6551
+.RS
Michal Luscon 85a6551
+.sp
Michal Luscon 85a6551
+mount -t tmpfs none /mnt \-o 'context="system_u:object_r:tmp_t:s0:c127,c456",noexec'
Michal Luscon 85a6551
+.sp
Michal Luscon 85a6551
+.RE
Michal Luscon 85a6551
+
Michal Luscon 85a6551
 For more details, see
Michal Luscon 85a6551
 .BR selinux (8)
Michal Luscon 85a6551
+.RE
Michal Luscon 85a6551
 
Michal Luscon 85a6551
 .TP
Michal Luscon 85a6551
 .B defaults
Michal Luscon 85a6551
-- 
Michal Luscon 85a6551
1.7.7.5
Michal Luscon 85a6551