Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dir with trailing space: dir creation failed on windows (git clone) #64

Closed
christian-weiss opened this issue Dec 21, 2018 · 5 comments · Fixed by #84
Closed

Dir with trailing space: dir creation failed on windows (git clone) #64

christian-weiss opened this issue Dec 21, 2018 · 5 comments · Fixed by #84

Comments

@christian-weiss
Copy link

christian-weiss commented Dec 21, 2018

Import of following snippet from a keypass2 xml file:

<Group>
...
<Name>Tinmachine / Nutrition</Name>
...
</Group>

resulted in 2 dirs on my ubuntu disk:
Tinmachine (incl. trailing space)
and
Nutrition (incl. leading space; not visable in github markup)

When cloning this repo on a windows machine this results in dir named Tinmachine (without trailing space) and a failure when trying to create a dir in it named Nutrition (with leading space; not visable in github markup), but it fails, as it can not navigate to a dir name Tinmachine (with trailing space).

@christian-weiss
Copy link
Author

shell on ubuntu

ls -al
drwx------ 3 christian christian 4096 Dez 21 16:07 'Tinmachine '/
cd Tinmachine\ /
Tinmachine $ cd \ Nutrition/

this was discovered while testing your change from:
#55
#56

@roddhjav
Copy link
Owner

Hi Christian, thank for this feedback. I will investigate this tomorrow.

@christian-weiss christian-weiss changed the title Two dirs are commited to git as one single dir, dir creation failed on windows (git clone) Dir with trailing space: dir creation failed on windows (git clone) Dec 21, 2018
@roddhjav
Copy link
Owner

roddhjav commented Jan 10, 2019

Can you confirm me you use the convert and clean options when importing this?

@christian-weiss
Copy link
Author

Please re-open this issue due to:
#97

Statement is:
pass import --convert --all keepass zusammengefasst.xml

Error:

fatal: cannot create directory at '/my/path/Tinmachine / Nutrition': no such file or directory

My password-store contains the file .import:

# Separator string
separator: '-'

# The list of string that should be replaced by other string. Only activated
# if the `clean` option is enabled.
cleans:
  ' ': '-'
  '&': 'and'
  '@': At
  "'": ''
  '[': ''
  ']': ''

# The list of protocol. To be removed from the title.
protocols:
  - http://
  - https://

# The list of invalid caracters. Replaced by the separator.
invalids:
  - '<'
  - '>'
  - ':'
  - '"'
  - '/'
  - '\\'
  - '|'
  - '?'
  - '*'
  - '\0'

(i know these are the defaults, but i expect that defaults may vary in future releases and releases may vary on some of our team mates PCs - repo is team-shared.

The / (forward slash) is not a path separator on Win10, but it is still not allowed in directory names on windows (NTFS). Forward slash should be replace by separator (in this case: -) by --convert.

Ubuntu system:
Ubuntu 19.10
pass 1.7.3
pass import 2.6
keypass xml from keepass 2.38
git version 2.20.1

Windows system:
Windows 10 64-bit
git bash (Git for Windows): GNU bash, version 4.4.19(2)-release (x86_64-pc-msys)

@roddhjav
Copy link
Owner

cf #65

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants