mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 15:28:05 +03:00
add basic S3-Compatible Object Storage support
we have now an interface for filesystem backeds, this make easy to add new filesystem backends
This commit is contained in:
28
vfs/s3fileinfo_unix.go
Normal file
28
vfs/s3fileinfo_unix.go
Normal file
@@ -0,0 +1,28 @@
|
||||
// +build !windows
|
||||
|
||||
package vfs
|
||||
|
||||
import "syscall"
|
||||
|
||||
import "os"
|
||||
|
||||
var (
|
||||
defaultUID, defaultGID int
|
||||
)
|
||||
|
||||
func init() {
|
||||
defaultUID = os.Getuid()
|
||||
defaultGID = os.Getuid()
|
||||
if defaultUID < 0 {
|
||||
defaultUID = 65534
|
||||
}
|
||||
if defaultGID < 0 {
|
||||
defaultGID = 65534
|
||||
}
|
||||
}
|
||||
|
||||
func (fi S3FileInfo) getFileInfoSys() interface{} {
|
||||
return &syscall.Stat_t{
|
||||
Uid: uint32(defaultUID),
|
||||
Gid: uint32(defaultGID)}
|
||||
}
|
||||
Reference in New Issue
Block a user