Only assert private dirs, when worktree = $HOME (#171)
This commit is contained in:
parent
cc1993dc14
commit
84a173551e
2 changed files with 12 additions and 9 deletions
|
@ -38,7 +38,7 @@ def test_perms(runner, yadm_y, paths, ds1, autoperms):
|
||||||
cmd = 'perms'
|
cmd = 'perms'
|
||||||
if autoperms != 'notest':
|
if autoperms != 'notest':
|
||||||
cmd = 'status'
|
cmd = 'status'
|
||||||
run = runner(yadm_y(cmd))
|
run = runner(yadm_y(cmd), env={'HOME': paths.work})
|
||||||
assert run.success
|
assert run.success
|
||||||
assert run.err == ''
|
assert run.err == ''
|
||||||
if cmd == 'perms':
|
if cmd == 'perms':
|
||||||
|
@ -81,7 +81,7 @@ def test_perms_control(runner, yadm_y, paths, ds1, sshperms, gpgperms):
|
||||||
assert not oct(private.stat().mode).endswith('00'), (
|
assert not oct(private.stat().mode).endswith('00'), (
|
||||||
'Path started secured')
|
'Path started secured')
|
||||||
|
|
||||||
run = runner(yadm_y('perms'))
|
run = runner(yadm_y('perms'), env={'HOME': paths.work})
|
||||||
assert run.success
|
assert run.success
|
||||||
assert run.err == ''
|
assert run.err == ''
|
||||||
assert run.out == ''
|
assert run.out == ''
|
||||||
|
|
3
yadm
3
yadm
|
@ -1107,6 +1107,8 @@ function perms() {
|
||||||
# include the archive created by "encrypt"
|
# include the archive created by "encrypt"
|
||||||
[ -f "$YADM_ARCHIVE" ] && GLOBS+=("$YADM_ARCHIVE")
|
[ -f "$YADM_ARCHIVE" ] && GLOBS+=("$YADM_ARCHIVE")
|
||||||
|
|
||||||
|
# only include private globs if using HOME as worktree
|
||||||
|
if [ "$YADM_WORK" = "$HOME" ]; then
|
||||||
# include all .ssh files (unless disabled)
|
# include all .ssh files (unless disabled)
|
||||||
if [[ $(config --bool yadm.ssh-perms) != "false" ]] ; then
|
if [[ $(config --bool yadm.ssh-perms) != "false" ]] ; then
|
||||||
GLOBS+=(".ssh" ".ssh/*" ".ssh/.[!.]*")
|
GLOBS+=(".ssh" ".ssh/*" ".ssh/.[!.]*")
|
||||||
|
@ -1116,6 +1118,7 @@ function perms() {
|
||||||
if [[ $(config --bool yadm.gpg-perms) != "false" ]] ; then
|
if [[ $(config --bool yadm.gpg-perms) != "false" ]] ; then
|
||||||
GLOBS+=(".gnupg" ".gnupg/*" ".gnupg/.[!.]*")
|
GLOBS+=(".gnupg" ".gnupg/*" ".gnupg/.[!.]*")
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# include any files we encrypt
|
# include any files we encrypt
|
||||||
GLOBS+=("${ENCRYPT_INCLUDE_FILES[@]}")
|
GLOBS+=("${ENCRYPT_INCLUDE_FILES[@]}")
|
||||||
|
|
Loading…
Reference in a new issue