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

Entry title was splitted in 2 parts; one for dir and one part for filename #55

Closed
christian-weiss opened this issue Nov 20, 2018 · 5 comments · Fixed by #53
Closed

Entry title was splitted in 2 parts; one for dir and one part for filename #55

christian-weiss opened this issue Nov 20, 2018 · 5 comments · Fixed by #53

Comments

@christian-weiss
Copy link

christian-weiss commented Nov 20, 2018

I tried to import a keepass 2.38 XML file with 1200+ entries.

Representation in XML:
<Value>Apple ID (für iTunes / iPhone)</Value>

Was imported as a directory with the name "Apple ID (für iTunes " (incl. trailing space),
and as file name " iPhone)" (incl. leading space).

Sure "/" has a special meaning on unix/linux filesystems, it should be converted e.g. to "-" (or another allowed character). From semantic standpoint a single entry should be imported as a single filesytem entry (not as 1x dir + 1x file).

If you do not want to do conversion by default you should skip that entry with a warning and have at least a "--force-import" and "--convert" command line option.

I discovered alot of other issues related to naming and filesystem. I used keepass/keepassX on Ubuntu, MacOS, Windows7, Windows10, iPhone and Android and i used pass (with QtPass) for the same set of devices and OS. This means that i have to take care about interoperability. While pass is file base, it means that it is limited by filesystem restrictions (special chars) opposed to other password managers (database based). Sadly pass itself do not print warning for interoperability issues, and one can get used with that when creating new passwords. But when dealing with old passwords (that do not have to deal with limitations in the past) then the situation is worse - especially on 1200+ passwords.

That means the importer should at least warn on interoperability issues (and should provide a option to convert it on import). Current git version of pass-import could lead to problems when i import e.g. on Ubuntu and then try to "git pull" password store on a windows system.

Not allowed on windows:

< (less than)
> (greater than)
: (colon - sometimes works, but is actually NTFS Alternate Data Streams)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar or pipe)
? (question mark)
* (asterisk)
ASCII 0-31
can not end with spaces / dots
some filenames are not allowed: CON, PRN, AUX, NUL, COM1, COM2, COM3, COM4, COM5, COM6, COM7, COM8, COM9, LPT1, LPT2, LPT3, LPT4, LPT5, LPT6, LPT7, LPT8, LPT9

Not allowed on linux:

/ (forward slash)
ASCII 0 (null bypte)
(should not start with dot)

Fore sure you can not cover all possible filesystems and all filesystem limitations but above should cover most problematic once.

@christian-weiss
Copy link
Author

Some filesystems are not case sensitive (e.g. on MacOS, Windows), so the importer should warn for "equal" file/dir names: e.g. "another" and "AnOthER".

@roddhjav
Copy link
Owner

Thank again for this bug report. I indeed need to improve this conversion part (mostly for Windows).

Regarding the Unix / issue, however; it already exists a solution for this with the -c or --clean option that replaces all / by -.

This is an option because it also does the following (not always wanted) changes:

Old New
_
& and
/ -
\ -
@ At
' ``
[ ``
] ``

So I might split this option in two and thus create a --convert option as you wrote.

@christian-weiss
Copy link
Author

I vote for splitting it. "--convert" would be fine for everything, except the path separators (windows / linux).
It would be fantastic if pass-import can pick conversion settings / replacement characters from .pass-import file (team shared file), see #56 for details about this "config file".

@christian-weiss
Copy link
Author

Please extend the list of converted chars (see my list above).

@roddhjav roddhjav mentioned this issue Nov 25, 2018
roddhjav added a commit that referenced this issue Nov 26, 2018
List of notable changes
- Move lib/import.py to pass_import.py
- Add setup.py and install pass_import with it.
- Add Gitlab CI
- Use prospector to lint the python code
- Simplify the bash tests
- Multiple fixes linked to the structure changes
- Add .import config file. Fix #56
- Add convert and separator options. Fix #55
- Improve the duplicate system:
- Create sub-folder if title identical. Fix #41 and #49
- Use the separator to duplicate paths. Fix #43
@roddhjav
Copy link
Owner

I added the --convert function and reorganised the conversion part.
Tell me if it suits your needs.

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