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

check --extract file path for parent dir #248

Merged
merged 1 commit into from Sep 13, 2018

Conversation

M0ses
Copy link
Collaborator

@M0ses M0ses commented Aug 21, 2018

No description provided.

@lnussel
Copy link
Member

lnussel commented Aug 22, 2018

use os.path.normpath() for consistency with subdir?

@msmeissn
Copy link
Member

doing os.path.normpath will already collapse A/../B to B , so remove all ..

you should probably not called it before checking for ..

@M0ses
Copy link
Collaborator Author

M0ses commented Aug 22, 2018

normpath should only remove '..' which can be "resolved" in this path and if there is no attempt to access the parent dir, it might be an useless but still valid path definition

Example:

>>> import os
>>> # valid (even if useless)
>>> fn = os.path.normpath('foo/../bar')
>>> print(fn)
bar
>>> # invalid
>>> fn = os.path.normpath('foo/../../bar')
>>> print(fn)
../bar
>>> 

@M0ses M0ses merged commit 70d1aa4 into openSUSE:master Sep 13, 2018
@M0ses M0ses deleted the check_filename branch November 29, 2018 10:53
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 this pull request may close these issues.

None yet

4 participants