From 03c8b133710c190364858de09b2f24c5fa891d88 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sun, 9 Oct 2016 20:06:23 +0200 Subject: [PATCH] main: ignore options rw, nosuid, nodev. When called from mount, we always get either "suid" or "nosuid". As "nosuid" is the default, just ignore the options. Same for the other options. --- cli_args.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli_args.go b/cli_args.go index 0db5ba6..4f16cd4 100644 --- a/cli_args.go +++ b/cli_args.go @@ -91,6 +91,13 @@ func parseCliOpts() (args argContainer) { "successful mount - used internally for daemonization") flagSet.IntVar(&args.scryptn, "scryptn", configfile.ScryptDefaultLogN, "scrypt cost parameter logN. "+ "Setting this to a lower value speeds up mounting but makes the password susceptible to brute-force attacks") + // Ignored otions + var ignoredBool bool + ignoreText := "(ignored for compatability)" + flagSet.BoolVar(&ignoredBool, "rw", false, ignoreText) + flagSet.BoolVar(&ignoredBool, "nosuid", false, ignoreText) + flagSet.BoolVar(&ignoredBool, "nodev", false, ignoreText) + // Actual parsing flagSet.Parse(os.Args[1:]) // "-openssl" needs some post-processing