summaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-06-20 19:09:46 +0200
committerJakob Unterwurzacher2021-06-20 19:09:46 +0200
commitc5d8fa83ae702017fc90769dff178fda6a7942a3 (patch)
tree8f6593a3174a2d5240b4536a6248f25a871c5a7d /mount.go
parent203e65066fc1197427353eed3ae0a5108a1121ee (diff)
nametransform: pass badname patterns via New
This means we can unexport the field.
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go13
1 files changed, 1 insertions, 12 deletions
diff --git a/mount.go b/mount.go
index e35e6c2..7f818d1 100644
--- a/mount.go
+++ b/mount.go
@@ -313,18 +313,7 @@ func initFuseFrontend(args *argContainer) (rootNode fs.InodeEmbedder, wipeKeys f
// Init crypto backend
cCore := cryptocore.New(masterkey, cryptoBackend, contentenc.DefaultIVBits, args.hkdf, args.forcedecode)
cEnc := contentenc.New(cCore, contentenc.DefaultBS, args.forcedecode)
- nameTransform := nametransform.New(cCore.EMECipher, frontendArgs.LongNames, args.raw64)
- // Init badname patterns
- nameTransform.BadnamePatterns = make([]string, 0)
- for _, pattern := range args.badname {
- _, err := filepath.Match(pattern, "") // Make sure pattern is valid
- if err != nil {
- tlog.Fatal.Printf("-badname: invalid pattern %q supplied", pattern)
- os.Exit(exitcodes.Usage)
- } else {
- nameTransform.BadnamePatterns = append(nameTransform.BadnamePatterns, pattern)
- }
- }
+ nameTransform := nametransform.New(cCore.EMECipher, frontendArgs.LongNames, args.raw64, []string(args.badname))
// After the crypto backend is initialized,
// we can purge the master key from memory.
for i := range masterkey {