]> Cypherpunks repositories - gostls13.git/commitdiff
os: add ModeSticky
authorEvan Shaw <chickencha@gmail.com>
Thu, 19 Jan 2012 19:29:24 +0000 (11:29 -0800)
committerBrad Fitzpatrick <bradfitz@golang.org>
Thu, 19 Jan 2012 19:29:24 +0000 (11:29 -0800)
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5539063

src/pkg/os/stat_darwin.go
src/pkg/os/stat_freebsd.go
src/pkg/os/stat_linux.go
src/pkg/os/stat_netbsd.go
src/pkg/os/stat_openbsd.go
src/pkg/os/types.go

index efe77cb30b5b54327be62e37fadafa1518a752a3..e1f93fac3889761fd0be3bf84ef87420103b7514 100644 (file)
@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
        if st.Mode&syscall.S_ISUID != 0 {
                fs.mode |= ModeSetuid
        }
+       if st.Mode&syscall.S_ISVTX != 0 {
+               fs.mode |= ModeSticky
+       }
        return fs
 }
 
index b59c53635ab0f0cd540e4641b57c13295cd821a4..4c1c19729dbf6e2481cb5125bfeb59f20d8af0cc 100644 (file)
@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
        if st.Mode&syscall.S_ISUID != 0 {
                fs.mode |= ModeSetuid
        }
+       if st.Mode&syscall.S_ISVTX != 0 {
+               fs.mode |= ModeSticky
+       }
        return fs
 }
 
index b0a569e24cd1c85a9e5c48f67982f2b77af2e876..8d1323af9c6f14a13f0ec2a7dbe7cced23a9dab9 100644 (file)
@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
        if st.Mode&syscall.S_ISUID != 0 {
                fs.mode |= ModeSetuid
        }
+       if st.Mode&syscall.S_ISVTX != 0 {
+               fs.mode |= ModeSticky
+       }
        return fs
 }
 
index b0a569e24cd1c85a9e5c48f67982f2b77af2e876..8d1323af9c6f14a13f0ec2a7dbe7cced23a9dab9 100644 (file)
@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
        if st.Mode&syscall.S_ISUID != 0 {
                fs.mode |= ModeSetuid
        }
+       if st.Mode&syscall.S_ISVTX != 0 {
+               fs.mode |= ModeSticky
+       }
        return fs
 }
 
index b0a569e24cd1c85a9e5c48f67982f2b77af2e876..8d1323af9c6f14a13f0ec2a7dbe7cced23a9dab9 100644 (file)
@@ -45,6 +45,9 @@ func fileInfoFromStat(st *syscall.Stat_t, name string) FileInfo {
        if st.Mode&syscall.S_ISUID != 0 {
                fs.mode |= ModeSetuid
        }
+       if st.Mode&syscall.S_ISVTX != 0 {
+               fs.mode |= ModeSticky
+       }
        return fs
 }
 
index bf009805fd730dec8af0a26d7a87974434666d14..a3f187c25cb44f32d185efacdae34bbd29cc06d7 100644 (file)
@@ -39,7 +39,7 @@ const (
        ModeDir        FileMode = 1 << (32 - 1 - iota) // d: is a directory
        ModeAppend                                     // a: append-only
        ModeExclusive                                  // l: exclusive use
-       ModeTemporary                                  // t: temporary file (not backed up)
+       ModeTemporary                                  // T: temporary file (not backed up)
        ModeSymlink                                    // L: symbolic link
        ModeDevice                                     // D: device file
        ModeNamedPipe                                  // p: named pipe (FIFO)
@@ -47,6 +47,7 @@ const (
        ModeSetuid                                     // u: setuid
        ModeSetgid                                     // g: setgid
        ModeCharDevice                                 // c: Unix character device, when ModeDevice is set
+       ModeSticky                                     // t: sticky
 
        // Mask for the type bits. For regular files, none will be set.
        ModeType = ModeDir | ModeSymlink | ModeNamedPipe | ModeSocket | ModeDevice
@@ -55,7 +56,7 @@ const (
 )
 
 func (m FileMode) String() string {
-       const str = "daltLDpSugc"
+       const str = "dalTLDpSugct"
        var buf [20]byte
        w := 0
        for i, c := range str {