From cc2a75b05029453192cbf90687ce5af5016841ad Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 16 Jun 2016 23:23:09 +0200 Subject: Mount v0.6 and older filesystems as read-only This is part of the phase-out of very old filesystems. See https://github.com/rfjakob/gocryptfs/wiki/Compatibility for more info. --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'main.go') diff --git a/main.go b/main.go index 2d7b50f..b29b2f6 100644 --- a/main.go +++ b/main.go @@ -122,8 +122,11 @@ func loadConfig(args *argContainer) (masterkey []byte, confFile *configfile.Conf pw := readpassword.Once(args.extpass) tlog.Info.Println("Decrypting master key") masterkey, confFile, err = configfile.LoadConfFile(args.config, pw) - if err != nil { - tlog.Fatal.Println(err.Error()) + if _, ok := err.(configfile.DeprecatedFsError); ok { + // Force read-only mode + args.ro = true + } else if err != nil { + tlog.Fatal.Println(err) os.Exit(ERREXIT_LOADCONF) } -- cgit v1.2.3