提交 c0e607a0 编写于 作者: X xionglei6

fix:增加selinux属性校验

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 fc71aa9e
...@@ -270,7 +270,9 @@ int CheckParamPermissionWithSelinux(const ParamSecurityLabel *srcLabel, const ch ...@@ -270,7 +270,9 @@ int CheckParamPermissionWithSelinux(const ParamSecurityLabel *srcLabel, const ch
uc.uid = srcLabel->cred.uid; uc.uid = srcLabel->cred.uid;
uc.gid = srcLabel->cred.gid; uc.gid = srcLabel->cred.gid;
int ret = setParamCheck(name, &uc); int ret = setParamCheck(name, &uc);
PARAM_LOGI("Selinux check name %s pid %d uid %d %d result %d", name, uc.pid, uc.uid, uc.gid, ret); if (ret != 0) {
PARAM_LOGI("Selinux check name %s pid %d uid %d %d result %d", name, uc.pid, uc.uid, uc.gid, ret);
}
return ret; return ret;
} }
#endif #endif
......
...@@ -27,7 +27,6 @@ int ConntectServer(int fd, const char *servername) ...@@ -27,7 +27,6 @@ int ConntectServer(int fd, const char *servername)
PARAM_CHECK(fd >= 0, return -1, "Invalid fd %d", fd); PARAM_CHECK(fd >= 0, return -1, "Invalid fd %d", fd);
int opt = 1; int opt = 1;
int ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt)); int ret = setsockopt(fd, SOL_SOCKET, SO_PASSCRED, &opt, sizeof(opt));
PARAM_LOGE("Failed to setsockopt for SO_PASSCRED %d", errno);
PARAM_CHECK(servername != NULL, return -1, "Invalid servername"); PARAM_CHECK(servername != NULL, return -1, "Invalid servername");
struct sockaddr_un addr; struct sockaddr_un addr;
/* fill socket address structure with server's address */ /* fill socket address structure with server's address */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册