Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
5a1322a7
Commit
5a1322a7
authored
Jan 19, 2012
by
Evan Shaw
Committed by
Brad Fitzpatrick
Jan 19, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
os: add ModeSticky
R=golang-dev, rsc CC=golang-dev
https://golang.org/cl/5539063
parent
d888ab80
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
2 deletions
+18
-2
src/pkg/os/stat_darwin.go
src/pkg/os/stat_darwin.go
+3
-0
src/pkg/os/stat_freebsd.go
src/pkg/os/stat_freebsd.go
+3
-0
src/pkg/os/stat_linux.go
src/pkg/os/stat_linux.go
+3
-0
src/pkg/os/stat_netbsd.go
src/pkg/os/stat_netbsd.go
+3
-0
src/pkg/os/stat_openbsd.go
src/pkg/os/stat_openbsd.go
+3
-0
src/pkg/os/types.go
src/pkg/os/types.go
+3
-2
No files found.
src/pkg/os/stat_darwin.go
View file @
5a1322a7
...
@@ -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
}
}
...
...
src/pkg/os/stat_freebsd.go
View file @
5a1322a7
...
@@ -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
}
}
...
...
src/pkg/os/stat_linux.go
View file @
5a1322a7
...
@@ -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
}
}
...
...
src/pkg/os/stat_netbsd.go
View file @
5a1322a7
...
@@ -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
}
}
...
...
src/pkg/os/stat_openbsd.go
View file @
5a1322a7
...
@@ -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
}
}
...
...
src/pkg/os/types.go
View file @
5a1322a7
...
@@ -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
=
"dal
tLDpSugc
"
const
str
=
"dal
TLDpSugct
"
var
buf
[
20
]
byte
var
buf
[
20
]
byte
w
:=
0
w
:=
0
for
i
,
c
:=
range
str
{
for
i
,
c
:=
range
str
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment