main: add -e as an alias for -exclude
This commit is contained in:
parent
7a02f71fc2
commit
5acfbc1b2f
|
@ -76,7 +76,7 @@ prior to 1.9, which fall back to weak random data when the getrandom syscall
|
||||||
is blocking. Using this option can block indefinitely when the kernel cannot
|
is blocking. Using this option can block indefinitely when the kernel cannot
|
||||||
harvest enough entropy.
|
harvest enough entropy.
|
||||||
|
|
||||||
#### -exclude PATH
|
#### -e PATH, -exclude PATH
|
||||||
Only for reverse mode: exclude relative plaintext path from the encrypted
|
Only for reverse mode: exclude relative plaintext path from the encrypted
|
||||||
view. Can be passed multiple times. Example:
|
view. Can be passed multiple times. Example:
|
||||||
|
|
||||||
|
|
|
@ -158,7 +158,7 @@ vNEXT, in progress
|
||||||
* Only print master key once, on init
|
* Only print master key once, on init
|
||||||
([#76](https://github.com/rfjakob/gocryptfs/issues/76),
|
([#76](https://github.com/rfjakob/gocryptfs/issues/76),
|
||||||
[commit](https://github.com/rfjakob/gocryptfs/commit/6d64dfe8f7acd8e9ca4a659d26318e442c2db85a))
|
[commit](https://github.com/rfjakob/gocryptfs/commit/6d64dfe8f7acd8e9ca4a659d26318e442c2db85a))
|
||||||
* Add `-exclude` option for reverse mode
|
* Add `-e` / `-exclude` option for reverse mode
|
||||||
([#235](https://github.com/rfjakob/gocryptfs/issues/235),
|
([#235](https://github.com/rfjakob/gocryptfs/issues/235),
|
||||||
[commit](https://github.com/rfjakob/gocryptfs/commit/ec2fdc19cf9358ae7ba09c528a5807b6b0760f9b))
|
[commit](https://github.com/rfjakob/gocryptfs/commit/ec2fdc19cf9358ae7ba09c528a5807b6b0760f9b))
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,8 @@ func parseCliOpts() (args argContainer) {
|
||||||
flagSet.StringVar(&args.force_owner, "force_owner", "", "uid:gid pair to coerce ownership")
|
flagSet.StringVar(&args.force_owner, "force_owner", "", "uid:gid pair to coerce ownership")
|
||||||
flagSet.StringVar(&args.trace, "trace", "", "Write execution trace to file")
|
flagSet.StringVar(&args.trace, "trace", "", "Write execution trace to file")
|
||||||
|
|
||||||
|
// -e, --exclude
|
||||||
|
flagSet.Var(&args.exclude, "e", "Alias for -exclude")
|
||||||
flagSet.Var(&args.exclude, "exclude", "Exclude relative path from reverse view")
|
flagSet.Var(&args.exclude, "exclude", "Exclude relative path from reverse view")
|
||||||
|
|
||||||
flagSet.IntVar(&args.notifypid, "notifypid", 0, "Send USR1 to the specified process after "+
|
flagSet.IntVar(&args.notifypid, "notifypid", 0, "Send USR1 to the specified process after "+
|
||||||
|
|
|
@ -44,7 +44,7 @@ func ctlsockEncryptPath(t *testing.T, sock string, path string) string {
|
||||||
return response.Result
|
return response.Result
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestExclude(t *testing.T) {
|
func testExclude(t *testing.T, flag string) {
|
||||||
pOk := []string{
|
pOk := []string{
|
||||||
"file2",
|
"file2",
|
||||||
"dir1/file1",
|
"dir1/file1",
|
||||||
|
@ -74,7 +74,7 @@ func TestExclude(t *testing.T) {
|
||||||
sock := mnt + ".sock"
|
sock := mnt + ".sock"
|
||||||
cliArgs := []string{"-reverse", "-extpass", "echo test", "-ctlsock", sock}
|
cliArgs := []string{"-reverse", "-extpass", "echo test", "-ctlsock", sock}
|
||||||
for _, v := range pExclude {
|
for _, v := range pExclude {
|
||||||
cliArgs = append(cliArgs, "-exclude", v)
|
cliArgs = append(cliArgs, flag, v)
|
||||||
}
|
}
|
||||||
if plaintextnames {
|
if plaintextnames {
|
||||||
cliArgs = append(cliArgs, "-config", "exclude_test_fs/.gocryptfs.reverse.conf.plaintextnames")
|
cliArgs = append(cliArgs, "-config", "exclude_test_fs/.gocryptfs.reverse.conf.plaintextnames")
|
||||||
|
@ -102,3 +102,8 @@ func TestExclude(t *testing.T) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestExclude(t *testing.T) {
|
||||||
|
testExclude(t, "-exclude")
|
||||||
|
testExclude(t, "-e")
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue