未验证 提交 c0d67855 编写于 作者: O openharmony_ci 提交者: Gitee

!649 add socket node restorecon

Merge pull request !649 from dapaodexiaoyu2/master
......@@ -25,6 +25,9 @@
#include "init_log.h"
#include "init_service.h"
#include "loop_event.h"
#ifdef WITH_SELINUX
#include "policycoreutils.h"
#endif
#include "securec.h"
#define SOCKET_BUFF_SIZE (256 * 1024)
......@@ -139,6 +142,12 @@ static int CreateSocket(ServiceSocket *sockopt)
return -1;
}
INIT_LOGI("CreateSocket %s success", sockopt->name);
#ifdef WITH_SELINUX
if (RestoreconRecurse(HOS_SOCKET_DIR)) {
INIT_LOGE("DoRestorecon failed for '%s', err %d.", sockopt->name, errno);
}
#endif
return sockopt->sockFd;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册