summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2016-01-31 18:09:39 +0100
committerJakob Unterwurzacher2016-01-31 18:09:39 +0100
commit6454db68d97667f90ec1f0f838c7da275c46d2b8 (patch)
tree8e7078f815a74c78f0c620723903e1ef1e88d0d3 /main.go
parent4c9e249e3ac1fc2995e01eb1ed24799c3a3bc66b (diff)
Add new "-wpanic" option and enable it for the automated tests
Diffstat (limited to 'main.go')
-rw-r--r--main.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/main.go b/main.go
index 09046da..da98481 100644
--- a/main.go
+++ b/main.go
@@ -37,7 +37,7 @@ const (
type argContainer struct {
debug, init, zerokey, fusedebug, openssl, passwd, foreground, version,
- plaintextnames, quiet, diriv, emenames, gcmiv128, nosyslog bool
+ plaintextnames, quiet, diriv, emenames, gcmiv128, nosyslog, wpanic bool
masterkey, mountpoint, cipherdir, cpuprofile, config, extpass,
memprofile string
notifypid, scryptn int
@@ -160,6 +160,7 @@ func main() {
flagSet.BoolVar(&args.emenames, "emenames", true, "Use EME filename encryption. This option implies diriv.")
flagSet.BoolVar(&args.gcmiv128, "gcmiv128", true, "Use an 128-bit IV for GCM encryption instead of Go's default of 96 bits")
flagSet.BoolVar(&args.nosyslog, "nosyslog", false, "Do not redirect output to syslog when running in the background")
+ flagSet.BoolVar(&args.wpanic, "wpanic", false, "When encountering a warning, panic and exit immediately")
flagSet.StringVar(&args.masterkey, "masterkey", "", "Mount with explicit master key")
flagSet.StringVar(&args.cpuprofile, "cpuprofile", "", "Write cpu profile to specified file")
flagSet.StringVar(&args.memprofile, "memprofile", "", "Write memory profile to specified file")
@@ -184,6 +185,10 @@ func main() {
cryptfs.Debug.Enabled = true
cryptfs.Debug.Printf("Debug output enabled")
}
+ if args.wpanic {
+ cryptfs.Warn.PanicAfter = true
+ cryptfs.Debug.Printf("Panicing on warnings")
+ }
// Every operation below requires CIPHERDIR. Check that we have it.
if flagSet.NArg() >= 1 {
args.cipherdir, _ = filepath.Abs(flagSet.Arg(0))