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

Dave Quigley selinux at davequigley.com
Sat Jan 21 04:46:50 UTC 2012


On 1/20/2012 5:45 PM, Gianluca Cecchi wrote:
> 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


Its good to hear that those options are getting passed into the kernel 
now. Sorry about forgetting the s0 I copied and pasted the context from 
another post (and changed the type). I'm glad things worked out for you.

Dave


More information about the users mailing list