mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 00:10:31 +02:00
Merge pull request #22407 from hrydgard/createdir-0775
Create directories with 775 permissions instead of 755.
This commit is contained in:
1 file changed
+8
-1
@@ -703,7 +703,9 @@ bool CreateDir(const Path &path, bool quiet) {
|
||||
}
|
||||
return false;
|
||||
#else
|
||||
if (mkdir(path.ToString().c_str(), 0755) == 0) {
|
||||
if (mkdir(path.ToString().c_str(), 0775) == 0) {
|
||||
// mkdir's mode is masked by the umask, chmod's isn't.
|
||||
chmod(path.ToString().c_str(), 0775);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -712,6 +714,11 @@ bool CreateDir(const Path &path, bool quiet) {
|
||||
if (!quiet) {
|
||||
DEBUG_LOG(Log::IO, "CreateDir: mkdir failed on %s: already exists", path.c_str());
|
||||
}
|
||||
// Repair directories created with older, narrower permissions.
|
||||
struct stat info;
|
||||
if (stat(path.c_str(), &info) == 0 && S_ISDIR(info.st_mode)) {
|
||||
chmod(path.c_str(), 0775);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user