summaryrefslogtreecommitdiff
path: root/internal/fusefrontend_reverse
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend_reverse')
-rw-r--r--internal/fusefrontend_reverse/ctlsock_interface.go5
-rw-r--r--internal/fusefrontend_reverse/reverse_longnames.go4
-rw-r--r--internal/fusefrontend_reverse/rfs.go2
3 files changed, 7 insertions, 4 deletions
diff --git a/internal/fusefrontend_reverse/ctlsock_interface.go b/internal/fusefrontend_reverse/ctlsock_interface.go
index 5f61f37..c8ac379 100644
--- a/internal/fusefrontend_reverse/ctlsock_interface.go
+++ b/internal/fusefrontend_reverse/ctlsock_interface.go
@@ -3,7 +3,8 @@ package fusefrontend_reverse
import (
"path/filepath"
"strings"
- "syscall"
+
+ "golang.org/x/sys/unix"
"github.com/rfjakob/gocryptfs/internal/ctlsock"
"github.com/rfjakob/gocryptfs/internal/pathiv"
@@ -23,7 +24,7 @@ func (rfs *ReverseFS) EncryptPath(plainPath string) (string, error) {
for _, part := range parts {
dirIV := pathiv.Derive(cipherPath, pathiv.PurposeDirIV)
encryptedPart := rfs.nameTransform.EncryptName(part, dirIV)
- if rfs.args.LongNames && len(encryptedPart) > syscall.NAME_MAX {
+ if rfs.args.LongNames && len(encryptedPart) > unix.NAME_MAX {
encryptedPart = rfs.nameTransform.HashLongName(encryptedPart)
}
cipherPath = filepath.Join(cipherPath, encryptedPart)
diff --git a/internal/fusefrontend_reverse/reverse_longnames.go b/internal/fusefrontend_reverse/reverse_longnames.go
index 5ea7c0a..46f7399 100644
--- a/internal/fusefrontend_reverse/reverse_longnames.go
+++ b/internal/fusefrontend_reverse/reverse_longnames.go
@@ -7,6 +7,8 @@ import (
"syscall"
"time"
+ "golang.org/x/sys/unix"
+
"github.com/hanwen/go-fuse/fuse"
"github.com/hanwen/go-fuse/fuse/nodefs"
@@ -80,7 +82,7 @@ func (rfs *ReverseFS) findLongnameParent(dir string, dirIV []byte, longname stri
continue
}
cName := rfs.nameTransform.EncryptName(plaintextName, dirIV)
- if len(cName) <= syscall.NAME_MAX {
+ if len(cName) <= unix.NAME_MAX {
// Entry should have been skipped by the "continue" above
log.Panic("logic error or wrong shortNameMax constant?")
}
diff --git a/internal/fusefrontend_reverse/rfs.go b/internal/fusefrontend_reverse/rfs.go
index f9dde19..1523c18 100644
--- a/internal/fusefrontend_reverse/rfs.go
+++ b/internal/fusefrontend_reverse/rfs.go
@@ -288,7 +288,7 @@ func (rfs *ReverseFS) OpenDir(cipherPath string, context *fuse.Context) ([]fuse.
cName = configfile.ConfDefaultName
} else {
cName = rfs.nameTransform.EncryptName(entries[i].Name, dirIV)
- if len(cName) > syscall.NAME_MAX {
+ if len(cName) > unix.NAME_MAX {
cName = rfs.nameTransform.HashLongName(cName)
dotNameFile := fuse.DirEntry{
Mode: virtualFileMode,