Skip to content

Commit 677ef4b

Browse files
got3nksmrjimenez
authored andcommitted
PrefsUnifiedDlg: flag user-home parents as sensitive
#594's BuildSensitivePathList included wxGetUserHome() (the current user's home, e.g. /home/alice) but not its parent -- so right-clicking /home itself, or another user's home like /home/bob, didn't trigger the "sensitive folder" confirmation, while /home/alice and /home/alice/Documents did. Same gap on macOS (/Users missing) and Windows (C:\Users missing). Add the multi-user roots on each platform plus /root on Linux. wxGetUserHome() stays in the list -- it still uniquely flags the current user's home as an exact match irrespective of platform layout. slrslr's report on #594.
1 parent afb9da0 commit 677ef4b

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/PrefsUnifiedDlg.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,15 +1404,19 @@ wxArrayString BuildSensitivePathList()
14041404
pushIfNotEmpty("C:\\Program Files");
14051405
pushIfNotEmpty("C:\\Program Files (x86)");
14061406
pushIfNotEmpty("C:\\ProgramData");
1407+
pushIfNotEmpty("C:\\Users"); // parent of every user's home
14071408
#else
14081409
pushIfNotEmpty("/");
14091410
pushIfNotEmpty("/etc");
14101411
pushIfNotEmpty("/var");
14111412
pushIfNotEmpty("/tmp");
14121413
pushIfNotEmpty("/boot");
14131414
pushIfNotEmpty("/usr");
1415+
pushIfNotEmpty("/home"); // parent of every user's home on Linux
1416+
pushIfNotEmpty("/root"); // root user's home on Linux
14141417
pushIfNotEmpty("/Applications"); // macOS
14151418
pushIfNotEmpty("/System"); // macOS
1419+
pushIfNotEmpty("/Users"); // parent of every user's home on macOS
14161420
#endif
14171421

14181422
return out;

0 commit comments

Comments
 (0)