This repository was archived by the owner on Oct 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 735
This repository was archived by the owner on Oct 24, 2019. It is now read-only.
nlb/src/comm/nlbfile.c:check_and_mkdir权限错误 #42
Open
@AlexStocks
Description
在测试nlb/agent的时候,发现用户vag启动进程agent,agent进程创建的/var/nlb,vag用户却进不去,最后发现是nlb/src/comm/nlbfile.c:check_and_mkdir代码写的有瑕疵,现改动如下:
mode_t getumask()
{
mode_t mask = umask(0);
return mask;
}
/**
* @brief 检查并创建目录
*/
bool check_and_mkdir(const char *path)
{
if (!path) {
return false;
}
if (!check_dir_exist(path)) {
mode_t mask = getumask();
if (mkdir(path, ~mask & 0777) < 0) {
return false;
}
}
return true;
}
Metadata
Metadata
Assignees
Labels
No labels