On 11/13/2013 07:01 PM, Jaejyn Shin wrote:
> Dear All.
> 
> I created and mount a directory through init.rc file
> And also modified file_contexts file to label this directory
> 
>  /dir_1(/.*)?           u:object_r:system_data_file:s0
> 
>  But the directory was not labeled, even if apply it.
> 
> $ lg -Z
> drwxrwx--x system   radio             u:object_r:unlabeled:s0 dir_1
> 
> To solve it, I found two solutions.
> 
> Solution 1)
> Inserting restorecon("/dir_1") at the main function of init.c file.
> 
> Solution 2)
> insering restorecon dir_1 at the "on boot" of init.rc
> 
> Question)
> Why dir_1 can not be labeled without inserting additional restorecon ?

You said you created and mounted it.  So when it is created by init, the
mount point directory would be labeled as per your specification above.
 But when you mount some filesystem on that directory, it has whatever
label was assigned to that filesystem's root directory already.  The
fact that it is unlabeled suggests that it is a filesystem type that is
not configured in fs_use or genfs_contexts or that it was an ext4
filesystem that had never been labeled.



--
This message was distributed to subscribers of the seandroid-list mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe seandroid-list" without quotes as the message.

Reply via email to