bfrascher / passpy

ZX2C4's pass compatible Python library and cli
GNU General Public License v3.0
42 stars 9 forks source link

Passpy fails if pass path is a symbolic link or a submodule #6

Open lyz-code opened 4 years ago

lyz-code commented 4 years ago

In order to have different pass repositories with different teams each of the members of my team has his main password store and imports the teams repositories as links or submodules.

When generating a new key with store.gen_key() the step of adding the change to the git repository fails with the following errors:

...
  File "~/.local/lib/python3.7/site-packages/passpy/util.py", line 92, in initialised_wrapper
    return func(*args, **kwargs)
  File "~/.local/lib/python3.7/site-packages/passpy/util.py", line 66, in trap_wrapper
    return func(*args, **kwargs)
  File "~/.local/lib/python3.7/site-packages/passpy/store.py", line 377, in gen_key
    verbose=self.verbose)
  File "~/.local/lib/python3.7/site-packages/passpy/git.py", line 88, in git_add_path
    repo.git.add(*path)
  File "~/.local/lib/python3.7/site-packages/git/cmd.py", line 542, in <lambda>
    return lambda *args, **kwargs: self._call_process(name, *args, **kwargs)
  File "~/.local/lib/python3.7/site-packages/git/cmd.py", line 1005, in _call_process
    return self.execute(call, **exec_kwargs)
  File "~/.local/lib/python3.7/site-packages/git/cmd.py", line 822, in execute
    raise GitCommandError(command, status, stderr_value, stdout_value)
git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git add ~/.password-store/team_1/ansible-vault/production.gpg
  stderr: 'fatal: pathspec '~/.password-store/team_1/ansible-vault/production.gpg' is beyond a symbolic link'
... Same as above ...

git.exc.GitCommandError: Cmd('git') failed due to: exit code(128)
  cmdline: git add ~/.password-store/team_1/ansible-vault/production.gpg
  stderr: 'fatal: Pathspec '~/.password-store/team_1/ansible-vault/production.gpg' is in submodule 'team_1''