[OT] how to share a directory under ntfs mount point with selinux enabled?

Gianluca Cecchi gianluca.cecchi at gmail.com
Fri Jan 20 22:45:22 UTC 2012


On Fri, Jan 20, 2012 at 11:23 PM, Gianluca Cecchi
<gianluca.cecchi at gmail.com> wrote:

>
> Unfortunately putting the line
> /dev/sda1                                       /w7                  ntfs-3g
> context=system_u:object_r:samba_share_t       1 0
>
> I get this when trying to mount:
> ntfs-3g-mount: mount failed: Invalid argument
>
> And in messages:
> kernel: [14596.016616] SELinux:
> security_context_to_sid(system_u:object_r:samba_share_t) failed for
> (dev sda1, type fuseblk) errno=-22

OK. Walking through other documents I found that the "correct" syntax
is with a ":s0" at the end of the option, and also add defaults at the
end, like:

context=system_u:object_r:samba_share_t:s0,defaults

This way I can correctly mount a share against a directory under the ntfs tree

ALso, creating a test.txt file from the windows network attached
machine, the context properties are correctly managed from a linux
point of view:

$ getfattr -n security.selinux /w7/test_share/test.txt
getfattr: Removing leading '/' from absolute path names
# file: w7/test_share/test.txt
security.selinux="system_u:object_r:samba_share_t:s0"


Thanks,
Gianluca


More information about the users mailing list