add support for sticky bit on directories

notifications
Eric Gouyer 2019-08-03 06:09:18 +02:00 committed by Michael Stapelberg
parent 5e958a41f6
commit a4cd154343
1 changed files with 9 additions and 0 deletions

View File

@ -919,6 +919,12 @@ func convertAttributes(
if in.Mode&os.ModeSetuid != 0 {
out.Mode |= syscall.S_ISUID
}
if in.Mode&os.ModeSetgid != 0 {
out.Mode |= syscall.S_ISGID
}
if in.Mode&os.ModeSticky != 0 {
out.Mode |= syscall.S_ISVTX
}
}
// Convert an absolute cache expiration time to a relative time from now for
@ -975,6 +981,9 @@ func convertFileMode(unixMode uint32) os.FileMode {
if unixMode&syscall.S_ISGID != 0 {
mode |= os.ModeSetgid
}
if unixMode&syscall.S_ISVTX != 0 {
mode |= os.ModeSticky
}
return mode
}