mirror of
https://gitee.com/openharmony/startup_init
synced 2025-02-25 07:00:55 +00:00
!2444 restore SELinux security contexts only if the folder is newly created
Merge pull request !2444 from Changbin Du/mkdir_selinux_opt
This commit is contained in:
commit
41e4711ca5
@ -350,7 +350,13 @@ static void DoMkDir(const struct CmdArgs *ctx)
|
||||
return;
|
||||
}
|
||||
|
||||
PluginExecCmdByName("restoreContentRecurse", ctx->argv[0]);
|
||||
/*
|
||||
* Skip restoring default SELinux security contexts if the the folder already
|
||||
* existed and its under /dev. These files will be proceed by loadSelinuxPolicy.
|
||||
*/
|
||||
if (errno != EEXIST || strncmp(ctx->argv[0], "/dev", strlen("/dev")) != 0) {
|
||||
PluginExecCmdByName("restoreContentRecurse", ctx->argv[0]);
|
||||
}
|
||||
|
||||
if (ctx->argc <= 1) {
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user