aboutsummaryrefslogtreecommitdiff
path: root/cli_args.go
diff options
context:
space:
mode:
authorCharles Duffy2017-05-30 16:01:06 -0500
committerrfjakob2017-06-01 00:26:17 +0200
commitcf1ded5236157e2f9ec06eeea26023b67b40f16d (patch)
tree48c9926efd8c10a76b6f28943397f8b1ae5cc3da /cli_args.go
parentfc2a5f5ab0149d48b5d45a9af96799b07d802ae6 (diff)
Implement force_owner option to display ownership as a specific user.
Diffstat (limited to 'cli_args.go')
-rw-r--r--cli_args.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cli_args.go b/cli_args.go
index 5f4b328..bdce4ec 100644
--- a/cli_args.go
+++ b/cli_args.go
@@ -13,6 +13,7 @@ import (
"github.com/rfjakob/gocryptfs/internal/prefer_openssl"
"github.com/rfjakob/gocryptfs/internal/stupidgcm"
"github.com/rfjakob/gocryptfs/internal/tlog"
+ "github.com/hanwen/go-fuse/fuse"
)
// argContainer stores the parsed CLI options and arguments
@@ -22,7 +23,7 @@ type argContainer struct {
longnames, allow_other, ro, reverse, aessiv, nonempty, raw64,
noprealloc, speed, hkdf, serialize_reads, forcedecode, hh, info bool
masterkey, mountpoint, cipherdir, cpuprofile, extpass,
- memprofile, ko, passfile, ctlsock, fsname string
+ memprofile, ko, passfile, ctlsock, fsname, force_owner string
// Configuration file name override
config string
notifypid, scryptn int
@@ -31,6 +32,8 @@ type argContainer struct {
_configCustom bool
// _ctlsockFd stores the control socket file descriptor (ctlsock stores the path)
_ctlsockFd net.Listener
+ // _forceOwner is, if non-nil, a parsed, validated Owner (as opposed to the string above)
+ _forceOwner *fuse.Owner
}
var flagSet *flag.FlagSet
@@ -136,6 +139,7 @@ func parseCliOpts() (args argContainer) {
flagSet.StringVar(&args.ko, "ko", "", "Pass additional options directly to the kernel, comma-separated list")
flagSet.StringVar(&args.ctlsock, "ctlsock", "", "Create control socket at specified path")
flagSet.StringVar(&args.fsname, "fsname", "", "Override the filesystem name")
+ flagSet.StringVar(&args.force_owner, "force_owner", "", "uid:gid pair to coerce ownership")
flagSet.IntVar(&args.notifypid, "notifypid", 0, "Send USR1 to the specified process after "+
"successful mount - used internally for daemonization")
flagSet.IntVar(&args.scryptn, "scryptn", configfile.ScryptDefaultLogN, "scrypt cost parameter logN. Possible values: 10-28. "+