summaryrefslogtreecommitdiff
path: root/internal/configfile/validate.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/configfile/validate.go')
-rw-r--r--internal/configfile/validate.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/internal/configfile/validate.go b/internal/configfile/validate.go
index 1611ab0..ab8917d 100644
--- a/internal/configfile/validate.go
+++ b/internal/configfile/validate.go
@@ -47,10 +47,10 @@ func (cf *ConfFile) Validate() error {
}
// Filename encryption
{
- if cf.IsFeatureFlagSet(FlagPlaintextNames) && cf.IsFeatureFlagSet(FlagEMENames) {
- return fmt.Errorf("Can't have both PlaintextNames and EMENames feature flags")
- }
if cf.IsFeatureFlagSet(FlagPlaintextNames) {
+ if cf.IsFeatureFlagSet(FlagEMENames) {
+ return fmt.Errorf("PlaintextNames conflicts with EMENames feature flag")
+ }
if cf.IsFeatureFlagSet(FlagDirIV) {
return fmt.Errorf("PlaintextNames conflicts with DirIV feature flag")
}
@@ -60,10 +60,19 @@ func (cf *ConfFile) Validate() error {
if cf.IsFeatureFlagSet(FlagRaw64) {
return fmt.Errorf("PlaintextNames conflicts with Raw64 feature flag")
}
+ if cf.IsFeatureFlagSet(FlagLongNameMax) {
+ return fmt.Errorf("PlaintextNames conflicts with LongNameMax feature flag")
+ }
}
if cf.IsFeatureFlagSet(FlagEMENames) {
// All combinations of DirIV, LongNames, Raw64 allowed
}
+ if cf.LongNameMax != 0 && !cf.IsFeatureFlagSet(FlagLongNameMax) {
+ return fmt.Errorf("LongNameMax=%d but the LongNameMax feature flag is NOT set", cf.LongNameMax)
+ }
+ if cf.LongNameMax == 0 && cf.IsFeatureFlagSet(FlagLongNameMax) {
+ return fmt.Errorf("LongNameMax=0 but the LongNameMax feature flag IS set")
+ }
}
return nil
}