From 75ebb28a625bc16d145f5acd9e0cc1d305716afe Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 10 Nov 2016 00:27:08 +0100 Subject: ctlsock: add initial limited implementation At the moment, in forward mode you can only encrypt paths and in reverse mode you can only decrypt paths. --- internal/fusefrontend/ctlsock_interface.go | 19 +++++++++++++++++++ internal/fusefrontend/write_lock.go | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 internal/fusefrontend/ctlsock_interface.go (limited to 'internal/fusefrontend') diff --git a/internal/fusefrontend/ctlsock_interface.go b/internal/fusefrontend/ctlsock_interface.go new file mode 100644 index 0000000..c22dce6 --- /dev/null +++ b/internal/fusefrontend/ctlsock_interface.go @@ -0,0 +1,19 @@ +package fusefrontend + +import ( + "errors" + + "github.com/rfjakob/gocryptfs/internal/ctlsock" +) + +var _ ctlsock.Interface = &FS{} // Verify that interface is implemented. + +// EncryptPath implements ctlsock.Backend +func (fs *FS) EncryptPath(plainPath string) (string, error) { + return fs.encryptPath(plainPath) +} + +// DecryptPath implements ctlsock.Backend +func (fs *FS) DecryptPath(plainPath string) (string, error) { + return "", errors.New("Not implemented") +} diff --git a/internal/fusefrontend/write_lock.go b/internal/fusefrontend/write_lock.go index 7394994..3addfd6 100644 --- a/internal/fusefrontend/write_lock.go +++ b/internal/fusefrontend/write_lock.go @@ -21,7 +21,7 @@ var wlock wlockMap // 2) lock ... unlock ... // 3) unregister type wlockMap struct { - // Counts lock() calls. As every operation that modifies a file should + // opCount counts lock() calls. As every operation that modifies a file should // call it, this effectively serves as a write-operation counter. // The variable is accessed without holding any locks so atomic operations // must be used. It must be the first element of the struct to guarantee -- cgit v1.2.3