Commit 5a1322a7 authored by Evan Shaw's avatar Evan Shaw Committed by Brad Fitzpatrick

os: add ModeSticky

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5539063
parent d888ab80
...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { ...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
if st.Mode&syscall.S_ISUID != 0 { if st.Mode&syscall.S_ISUID != 0 {
fs.mode |= ModeSetuid fs.mode |= ModeSetuid
} }
if st.Mode&syscall.S_ISVTX != 0 {
fs.mode |= ModeSticky
}
return fs return fs
} }
......
...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { ...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
if st.Mode&syscall.S_ISUID != 0 { if st.Mode&syscall.S_ISUID != 0 {
fs.mode |= ModeSetuid fs.mode |= ModeSetuid
} }
if st.Mode&syscall.S_ISVTX != 0 {
fs.mode |= ModeSticky
}
return fs return fs
} }
......
...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { ...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
if st.Mode&syscall.S_ISUID != 0 { if st.Mode&syscall.S_ISUID != 0 {
fs.mode |= ModeSetuid fs.mode |= ModeSetuid
} }
if st.Mode&syscall.S_ISVTX != 0 {
fs.mode |= ModeSticky
}
return fs return fs
} }
......
...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { ...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
if st.Mode&syscall.S_ISUID != 0 { if st.Mode&syscall.S_ISUID != 0 {
fs.mode |= ModeSetuid fs.mode |= ModeSetuid
} }
if st.Mode&syscall.S_ISVTX != 0 {
fs.mode |= ModeSticky
}
return fs return fs
} }
......
...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo { ...@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
if st.Mode&syscall.S_ISUID != 0 { if st.Mode&syscall.S_ISUID != 0 {
fs.mode |= ModeSetuid fs.mode |= ModeSetuid
} }
if st.Mode&syscall.S_ISVTX != 0 {
fs.mode |= ModeSticky
}
return fs return fs
} }
......
...@@ -39,7 +39,7 @@ const ( ...@@ -39,7 +39,7 @@ const (
ModeDir FileMode = 1 << (32 - 1 - iota) // d: is a directory ModeDir FileMode = 1 << (32 - 1 - iota) // d: is a directory
ModeAppend // a: append-only ModeAppend // a: append-only
ModeExclusive // l: exclusive use ModeExclusive // l: exclusive use
ModeTemporary // t: temporary file (not backed up) ModeTemporary // T: temporary file (not backed up)
ModeSymlink // L: symbolic link ModeSymlink // L: symbolic link
ModeDevice // D: device file ModeDevice // D: device file
ModeNamedPipe // p: named pipe (FIFO) ModeNamedPipe // p: named pipe (FIFO)
...@@ -47,6 +47,7 @@ const ( ...@@ -47,6 +47,7 @@ const (
ModeSetuid // u: setuid ModeSetuid // u: setuid
ModeSetgid // g: setgid ModeSetgid // g: setgid
ModeCharDevice // c: Unix character device, when ModeDevice is set ModeCharDevice // c: Unix character device, when ModeDevice is set
ModeSticky // t: sticky
// Mask for the type bits. For regular files, none will be set. // Mask for the type bits. For regular files, none will be set.
ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice
...@@ -55,7 +56,7 @@ const ( ...@@ -55,7 +56,7 @@ const (
) )
func (m FileMode) String() string { func (m FileMode) String() string {
const str = "daltLDpSugc" const str = "dalTLDpSugct"
var buf [20]byte var buf [20]byte
w := 0 w := 0
for i, c := range str { for i, c := range str {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment