fix: fix non-root users cannot create log files even if they have write

permission of the directory
This commit is contained in:
Ganlin Zhao 2023-08-16 17:32:08 +08:00
parent cfe2cf0ebd
commit 89ff78d99c
1 changed files with 5 additions and 1 deletions

View File

@ -206,7 +206,11 @@ int32_t taosMulModeMkDir(const char *dirname, int mode) {
#endif
if (taosDirExist(temp)) {
return chmod(temp, mode);
if (taosCheckAccessFile(temp, TD_FILE_ACCESS_WRITE_OK)) {
return code;
} else {
return chmod(temp, mode);
}
}
if (strncmp(temp, TD_DIRSEP, 1) == 0) {