mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
parent
931a78c9bb
commit
735d171b9f
|
@ -2,6 +2,7 @@ package platform
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
|
"fmt"
|
||||||
"oh-my-posh/regex"
|
"oh-my-posh/regex"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -302,7 +303,9 @@ func (env *Shell) isWriteable(folder string) bool {
|
||||||
|
|
||||||
aceSid := (*windows.SID)(unsafe.Pointer(&ace.SidStart))
|
aceSid := (*windows.SID)(unsafe.Pointer(&ace.SidStart))
|
||||||
|
|
||||||
if !aceSid.Equals(cu) {
|
env.debugF("isWriteable", func() string { return fmt.Sprintf("ace SID: %s", aceSid.String()) })
|
||||||
|
if !aceSid.Equals(cu) && !aceSid.IsWellKnown(windows.WinWorldSid) {
|
||||||
|
env.Debug("isWriteable", "not current user or world")
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -312,12 +315,11 @@ func (env *Shell) isWriteable(folder string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
env.debugF("isWriteable", func() string {
|
env.debugF("isWriteable", func() string { return ace.AccessMask.permissions() })
|
||||||
return ace.AccessMask.permissions()
|
|
||||||
})
|
|
||||||
if ace.AccessMask.canWrite() {
|
if ace.AccessMask.canWrite() {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
env.Debug("isWriteable", "no access control on the folder")
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue