mirror of
https://github.com/golang/go
synced 2024-11-25 10:17:57 -07:00
os: add ModeSticky
R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5539063
This commit is contained in:
parent
d888ab80a3
commit
5a1322a79f
@ -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 {
|
|||||||
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 {
|
|||||||
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 {
|
|||||||
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 {
|
|||||||
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 (
|
|||||||
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 (
|
|||||||
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 (
|
|||||||
)
|
)
|
||||||
|
|
||||||
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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user