Properly check for the sticky bit

This commit is contained in:
Frank Denis 2024-04-03 16:47:13 +02:00
parent a88076d06f
commit 363d44919f
1 changed files with 1 additions and 1 deletions

View File

@ -176,7 +176,7 @@ func maybeWritableByOtherUsers(p string) (bool, string, error) {
return false, p, err
}
mode := st.Mode()
if mode&2 == 2 && !(st.IsDir() && mode&01000 == 01000) {
if mode.Perm()&2 != 0 && !(st.IsDir() && mode&os.ModeSticky == os.ModeSticky) {
return true, p, nil
}
p = path.Dir(p)