diff options
author | Jakob Unterwurzacher | 2021-06-20 19:09:46 +0200 |
---|---|---|
committer | Jakob Unterwurzacher | 2021-06-20 19:09:46 +0200 |
commit | c5d8fa83ae702017fc90769dff178fda6a7942a3 (patch) | |
tree | 8f6593a3174a2d5240b4536a6248f25a871c5a7d /mount.go | |
parent | 203e65066fc1197427353eed3ae0a5108a1121ee (diff) |
nametransform: pass badname patterns via New
This means we can unexport the field.
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 13 |
1 files changed, 1 insertions, 12 deletions
@@ -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 { |