diff options
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -286,6 +286,17 @@ func initFuseFrontend(args *argContainer) (pfs pathfs.FileSystem, wipeKeys func( 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) + } + } // After the crypto backend is initialized, // we can purge the master key from memory. for i := range masterkey { |