Commit Graph

14 Commits

Author SHA1 Message Date
Jakob Unterwurzacher
aa1d8a0f90 cli: don't split multiple-strings flags on comma
Looks like I used StringSliceVar (which splits on comma)
where I should have always used StringArrayVar (which does not).

Bug report contains this example of misbehavoir:

	#gocryptfs -extpass 'echo abc,123' -init testdir
	Reading password from extpass program "echo abc", arguments: ["123"]
	extpass cmd start failed: exec: "echo abc": executable file not found in $PATH

Fixes https://github.com/rfjakob/gocryptfs/issues/730
2023-05-03 21:14:53 +02:00
Jakob Unterwurzacher
6c14d25d44 tests: TestParseCliOpts: de-uglify testcase list 2023-05-03 20:56:36 +02:00
Jakob Unterwurzacher
d14c9340d6 cli: add -longnamemax
Fixes https://github.com/rfjakob/gocryptfs/issues/499
2021-10-21 15:58:19 +02:00
Jakob Unterwurzacher
1a58667293 stupidgcm: add PreferOpenSSL{AES256GCM,Xchacha20poly1305}
Add PreferOpenSSLXchacha20poly1305,
rename PreferOpenSSL -> PreferOpenSSLAES256GCM.
2021-09-08 19:48:13 +02:00
Jakob Unterwurzacher
69d88505fd go mod: declare module version v2
Our git version is v2+ for some time now, but go.mod
still declared v1. Hopefully making both match makes
https://pkg.go.dev/github.com/rfjakob/gocryptfs/v2 work.

All the import paths have been fixed like this:

  find . -name \*.go | xargs sed -i s%github.com/rfjakob/gocryptfs/%github.com/rfjakob/gocryptfs/v2/%
2021-08-23 15:05:15 +02:00
Jakob Unterwurzacher
0c16616117 main: add testcases for convertToDoubleDash & parseCliOpts 2021-08-10 19:42:33 +02:00
Jakob Unterwurzacher
463f6e8962 main: take advantage of pflag slice types
Our multipleStrings type is now built in.
2021-08-10 19:09:58 +02:00
Jakob Unterwurzacher
8c9a1c1121 main: push TestPrefixOArgs testcase struct into TestPrefixOArgs
No need to have it declared globally.
2021-08-10 09:33:19 +02:00
Jakob Unterwurzacher
eaa5aecd42 cli: add multipleStrings type
Will be used for --exclude.
2018-08-11 23:25:17 +02:00
Jakob Unterwurzacher
e29a81efc3 main: make prefixOArgs errors testable
By returning an error instead of calling os.Exit,
error cases can be tested easily. Error cases
were not tested until now.
2018-06-05 21:02:35 +02:00
Jakob Unterwurzacher
e135a72bda main: "--" should also block "-o" parsing
Includes test cases.
2017-04-29 15:11:17 +02:00
Jakob Unterwurzacher
f41d2e0676 Run cli_args_test.go through "gofmt -s" 2016-10-24 19:36:44 +02:00
Jakob Unterwurzacher
7b2049c769 main: accept "-o" at the front AND at the end
Moving "-o" to the end broke a third-party app, SiriKali.
Breaking your users is bad, so let's accept "-o" anywhere.
2016-10-10 19:44:34 +02:00
Jakob Unterwurzacher
b70d2ffd94 main: add tests for the "-o" parsing 2016-10-09 20:54:40 +02:00