mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
pkg: Fix dir permission check on Windows
This commit is contained in:
parent
747ff75c96
commit
e06006ea28
@ -18,5 +18,10 @@ package fileutil
|
|||||||
|
|
||||||
import "os"
|
import "os"
|
||||||
|
|
||||||
|
const (
|
||||||
|
// PrivateDirMode grants owner to make/remove files inside the directory.
|
||||||
|
PrivateDirMode = 0700
|
||||||
|
)
|
||||||
|
|
||||||
// OpenDir opens a directory for syncing.
|
// OpenDir opens a directory for syncing.
|
||||||
func OpenDir(path string) (*os.File, error) { return os.Open(path) }
|
func OpenDir(path string) (*os.File, error) { return os.Open(path) }
|
||||||
|
@ -21,6 +21,11 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// PrivateDirMode grants owner to make/remove files inside the directory.
|
||||||
|
PrivateDirMode = 0777
|
||||||
|
)
|
||||||
|
|
||||||
// OpenDir opens a directory in windows with write access for syncing.
|
// OpenDir opens a directory in windows with write access for syncing.
|
||||||
func OpenDir(path string) (*os.File, error) {
|
func OpenDir(path string) (*os.File, error) {
|
||||||
fd, err := openDir(path)
|
fd, err := openDir(path)
|
||||||
|
@ -25,8 +25,6 @@ import (
|
|||||||
const (
|
const (
|
||||||
// PrivateFileMode grants owner to read/write a file.
|
// PrivateFileMode grants owner to read/write a file.
|
||||||
PrivateFileMode = 0600
|
PrivateFileMode = 0600
|
||||||
// PrivateDirMode grants owner to make/remove files inside the directory.
|
|
||||||
PrivateDirMode = 0700
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// IsDirWriteable checks if dir is writable by writing and removing a file
|
// IsDirWriteable checks if dir is writable by writing and removing a file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user