aboutsummaryrefslogtreecommitdiff
path: root/mount.go
diff options
context:
space:
mode:
Diffstat (limited to 'mount.go')
-rw-r--r--mount.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/mount.go b/mount.go
index 5107bee..6d9dd8f 100644
--- a/mount.go
+++ b/mount.go
@@ -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 {