aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-06-16 23:23:09 +0200
committerJakob Unterwurzacher2016-06-16 23:23:09 +0200
commitcc2a75b05029453192cbf90687ce5af5016841ad (patch)
tree4389f5e3d0d63b389f107c1ba8844145d0edc44e /main.go
parent3234b9b5cee8de995dcf42b5384b9290d906397f (diff)
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.
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 5 insertions, 2 deletions
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)
}