diff options
author | Jakob Unterwurzacher | 2018-03-22 00:02:10 +0100 |
---|---|---|
committer | Jakob Unterwurzacher | 2018-03-22 00:02:10 +0100 |
commit | 9bc039a4bac6b51d9ebe116de5c311e90343a088 (patch) | |
tree | f4ebd37e2cbe4088435421fb7c9550c186161b09 /mount.go | |
parent | 9c86daf499dca8a69b058ec56803d06fbba4fdab (diff) |
Add `-masterkey=stdin` functionality
https://github.com/rfjakob/gocryptfs/issues/218
Diffstat (limited to 'mount.go')
-rw-r--r-- | mount.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -98,9 +98,14 @@ func doMount(args *argContainer) { { // Get master key (may prompt for the password) var masterkey []byte + masterkeyFromStdin := false + if args.masterkey == "stdin" { + args.masterkey = string(readpassword.Once("", "Masterkey")) + masterkeyFromStdin = true + } if args.masterkey != "" { // "-masterkey" - masterkey = parseMasterKey(args.masterkey) + masterkey = parseMasterKey(args.masterkey, masterkeyFromStdin) } else if args.zerokey { // "-zerokey" tlog.Info.Printf("Using all-zero dummy master key.") @@ -354,7 +359,7 @@ func initFuseFrontend(masterkey []byte, args *argContainer, confFile *configfile } srv, err := fuse.NewServer(conn.RawFS(), args.mountpoint, &mOpts) if err != nil { - tlog.Fatal.Printf("fuse.NewServer failed: %v", err) + tlog.Fatal.Printf("fuse.NewServer failed: %q", err) if runtime.GOOS == "darwin" { tlog.Info.Printf("Maybe you should run: /Library/Filesystems/osxfuse.fs/Contents/Resources/load_osxfuse") } |