mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 06:50:54 +07:00
[ijent] IJPL-171863: Make posix files writeable on Windows if they are accessed under root
(cherry picked from commit dfe7efa7d4d3a5f471d1e5b8d338ea017ebcd145) IJ-CR-150391 GitOrigin-RevId: ca555716293df310ec2301c8340dde55998e7637
This commit is contained in:
committed by
intellij-monorepo-bot
parent
8b8c09642f
commit
e25c31ab11
@@ -414,6 +414,10 @@ class IjentNioPosixFileAttributesWithDosAdapter(
|
||||
val owner = owner()
|
||||
val group = group()
|
||||
return when {
|
||||
userInfo.uid == 0 && owner is EelPosixUserPrincipal && owner.uid != 0 ->
|
||||
// on unix, root can read everything except the files that they forbid for themselves
|
||||
isDirectory
|
||||
|
||||
owner is EelPosixUserPrincipal && owner.uid == userInfo.uid ->
|
||||
OWNER_WRITE !in permissions() || (isDirectory && OWNER_EXECUTE !in permissions())
|
||||
|
||||
|
||||
@@ -211,6 +211,7 @@ public final class FileAttributes {
|
||||
|
||||
boolean isHidden = false;
|
||||
boolean isWritable = false;
|
||||
// TODO KN: We should look at the OS of a Path, not at the OS of the IDE.
|
||||
if (SystemInfo.isWindows) {
|
||||
isHidden = path.getParent() != null && ((DosFileAttributes)attrs).isHidden();
|
||||
isWritable = attrs.isDirectory() || !((DosFileAttributes)attrs).isReadOnly();
|
||||
|
||||
Reference in New Issue
Block a user