mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1233434 - Fixing download failure on a multi-user GNU/Linux machine. r=bagder
This commit is contained in:
parent
fb8dd89d01
commit
7781b79a4e
@ -416,12 +416,12 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
|
||||
const char* userName = PR_GetEnv("USERNAME");
|
||||
if (!userName || !*userName) {
|
||||
userName = PR_GetEnv("USER");
|
||||
if (!userName || !*userName) {
|
||||
userName = PR_GetEnv("LOGNAME");
|
||||
}
|
||||
else {
|
||||
userName = "mozillaUser";
|
||||
}
|
||||
}
|
||||
if (!userName || !*userName) {
|
||||
userName = PR_GetEnv("LOGNAME");
|
||||
}
|
||||
if (!userName || !*userName) {
|
||||
userName = "mozillaUser";
|
||||
}
|
||||
|
||||
nsAutoString userDir;
|
||||
@ -447,7 +447,12 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
|
||||
rv = finalPath->GetPermissions(&permissions);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (permissions == PR_IRWXU) {
|
||||
// Ensuring the path is writable by the current user.
|
||||
bool isWritable;
|
||||
rv = finalPath->IsWritable(&isWritable);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
if (permissions == PR_IRWXU && isWritable) {
|
||||
dir = finalPath;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user