cffuse

package
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 21, 2021 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ConfFile save configurations
	ConfFile = ".cfcryptfs.cfg"
	// KeyFile save encrypted key
	KeyFile = ".cfcryptfs.key"
	// KeyFileTmp is used when changing pwd
	KeyFileTmp = ".cfcryptfs.key.tmp"
)

Variables

View Source
var ReservedNameMap map[string]bool

ReservedNameMap name -> bool

View Source
var ReservedNames []string

ReservedNames stores names reserved for filesystem

Functions

func IsNameReserved

func IsNameReserved(name string) bool

IsNameReserved check name reserved

func WriteOpCount

func WriteOpCount() uint64

WriteOpCount returns the write lock counter value. This value is encremented each time writeLock.Lock() on a file table entry is called.

Types

type CfcryptFS

type CfcryptFS struct {
	pathfs.FileSystem // CfcryptFS, see go-fuse/fuse/pathfs/loopback.go
	// contains filtered or unexported fields
}

CfcryptFS implements the go-fuse virtual filesystem interface.

func NewFS

func NewFS(confs FsConfig, core corecrypter.CoreCrypter) *CfcryptFS

NewFS returns a new encrypted FUSE overlay filesystem.

func (*CfcryptFS) Access

func (fs *CfcryptFS) Access(name string, mode uint32, context *fuse.Context) (code fuse.Status)

Access fuse implemention

func (*CfcryptFS) Chmod

func (fs *CfcryptFS) Chmod(path string, mode uint32, context *fuse.Context) (code fuse.Status)

Chmod implements pathfs.Filesystem.

func (*CfcryptFS) Chown

func (fs *CfcryptFS) Chown(path string, uid uint32, gid uint32, context *fuse.Context) (code fuse.Status)

Chown implements pathfs.Filesystem.

func (*CfcryptFS) Create

func (fs *CfcryptFS) Create(path string, flags uint32, mode uint32, context *fuse.Context) (fuseFile nodefs.File, code fuse.Status)

Create implements pathfs.Filesystem.

func (*CfcryptFS) GetAttr

func (fs *CfcryptFS) GetAttr(path string, context *fuse.Context) (*fuse.Attr, fuse.Status)

GetAttr implements pathfs.Filesystem.

func (*CfcryptFS) GetXAttr

func (fs *CfcryptFS) GetXAttr(name string, attr string, context *fuse.Context) ([]byte, fuse.Status)

GetXAttr fuse implemention

func (fs *CfcryptFS) Link(orig string, newName string, context *fuse.Context) (code fuse.Status)

Link fuse implemention

func (*CfcryptFS) ListXAttr

func (fs *CfcryptFS) ListXAttr(name string, context *fuse.Context) ([]string, fuse.Status)

ListXAttr fuse implemention

func (*CfcryptFS) Mkdir

func (fs *CfcryptFS) Mkdir(path string, mode uint32, context *fuse.Context) (code fuse.Status)

Mkdir fuse implemention

func (*CfcryptFS) Mknod

func (fs *CfcryptFS) Mknod(name string, mode uint32, dev uint32, context *fuse.Context) (code fuse.Status)

Mknod fuse implemention

func (*CfcryptFS) Open

func (fs *CfcryptFS) Open(path string, flags uint32, context *fuse.Context) (fuseFile nodefs.File, status fuse.Status)

Open implements pathfs.Filesystem.

func (*CfcryptFS) OpenDir

func (fs *CfcryptFS) OpenDir(path string, context *fuse.Context) (stream []fuse.DirEntry, status fuse.Status)

OpenDir fuse implemention

func (fs *CfcryptFS) Readlink(name string, context *fuse.Context) (out string, code fuse.Status)

Readlink fuse implemention

func (*CfcryptFS) RemoveXAttr

func (fs *CfcryptFS) RemoveXAttr(name string, attr string, context *fuse.Context) fuse.Status

RemoveXAttr fuse implemention

func (*CfcryptFS) Rename

func (fs *CfcryptFS) Rename(oldPath string, newPath string, context *fuse.Context) (codee fuse.Status)

Rename fuse implemention

func (*CfcryptFS) Rmdir

func (fs *CfcryptFS) Rmdir(name string, context *fuse.Context) (code fuse.Status)

Rmdir fuse implemention

func (*CfcryptFS) SetXAttr

func (fs *CfcryptFS) SetXAttr(name string, attr string, data []byte, flags int, context *fuse.Context) fuse.Status

SetXAttr fuse implemention

func (*CfcryptFS) StatFs

func (fs *CfcryptFS) StatFs(name string) *fuse.StatfsOut

StatFs fuse implemention

func (*CfcryptFS) String

func (fs *CfcryptFS) String() string
func (fs *CfcryptFS) Symlink(pointedTo string, linkName string, context *fuse.Context) (code fuse.Status)

Symlink fuse implemention

func (*CfcryptFS) Truncate

func (fs *CfcryptFS) Truncate(path string, offset uint64, context *fuse.Context) (code fuse.Status)

Truncate fuse implemention

func (fs *CfcryptFS) Unlink(name string, context *fuse.Context) (code fuse.Status)

Unlink fuse implemention Don't use os.Remove, it removes twice (unlink followed by rmdir).

func (*CfcryptFS) Utimens

func (fs *CfcryptFS) Utimens(path string, a *time.Time, m *time.Time, context *fuse.Context) (code fuse.Status)

Utimens - path based version of loopbackFile.Utimens()

type FsConfig

type FsConfig struct {
	// CipherDir - encrypted directory path
	CipherDir string
	// CipherType - corecrypter type, do not set when using your own corecrypter
	CryptType int
	// CryptKey - master key for content and name encryption
	CryptKey []byte
	// PlainBS - plaintext block size
	// 	Should be adjusted according to average size of files.
	// 	Also must be suitable for corecrypter
	PlainBS int
	// BakingFileMode - mode of the underling file in the cipher directory. (default: 0600)
	BackingFileMode uint32
	// AllowOther - allow other user to access the filesystem, must run as root user
	AllowOther bool
	// PlainPath - filepath stay plaintext (not encrypted)
	PlainPath bool
}

FsConfig contains configs for fuse filesystem

type QIno

type QIno struct {
	// Stat_t.{Dev,Ino} is uint64 on 32- and 64-bit Linux
	Dev uint64
	Ino uint64
}

QIno = Qualified Inode number. Uniquely identifies a backing file through the device number, inode number pair.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL