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 ?

Thank you
Best regards

Reply via email to