other组权限安全问题排查

Signed-off-by: zhangxinyu <zhangxinyu74@huawei.com>
Change-Id: I34dc0fdfe0748f8df98a85497c688acbc052485f
This commit is contained in:
zhangxinyu
2023-05-22 10:46:00 +00:00
parent e51b4d2c95
commit 653609bb86
@@ -68,7 +68,7 @@ bool BundleFileUtils::MkRecursiveDir(const char *dir, bool isReadOthers)
for (size_t i = 0; i < len; ++i) {
rootDir[i] = dir[i];
if ((rootDir[i] == PATH_SEPARATOR || i == (len - 1)) && !IsExistDir(rootDir)) {
mode_t mode = S_IRWXU | S_IRWXG | S_IXOTH;
mode_t mode = S_IRWXU | S_IRWXG;
mode |= (isReadOthers ? S_IROTH : 0);
if (mkdir(rootDir, mode) < 0) {
return false;