-
Notifications
You must be signed in to change notification settings - Fork 383
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
Fix remote server path resolution #4131
Conversation
source_file_name = os.path.realpath(os.path.join( | ||
self.__source_root, report.file.original_path)) | ||
self.__source_root, report.file.original_path.strip('/'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Should this use lstrip
instead of plain strip
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid question, the goal is to make report.file.original_path
not absolute. lstrip would only remove the forward slash from the front of the path string.
source_file_name = os.path.realpath(os.path.join( | ||
self.__source_root, report.file.original_path)) | ||
self.__source_root, report.file.original_path.strip('/'))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Why isn't this using the fakeroot_path
from 7a98601?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question, I need to better understand if path manipulation can be achieved at this stage.
Eg.: can Mallory construct an original_path
that can navigate out of the temp folder, and cause harm there.
Another question: Shouldn't this patch first go into the |
19c8791
to
af3a8a2
Compare
@whisperity We are planning to release a patch release today (or tomorrow), as it affects all servers that is not running in a docker container. |
f0b88aa
to
29ae5b6
Compare
46c68d6
to
1ac6077
Compare
report.file.original_path, self.__source_root) | ||
else: | ||
# in this branch we are operating on the original filesystem, | ||
# and we need the path to he original file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# and we need the path to he original file | |
# and we need the path to the original file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"On this branch the server runs on the same file system where the source file is"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its very interesting and not at all trivial why we need to branch on this -- can you create an issue to remind us to document this properly?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, for the review, will make an issue tomorrow
1ac6077
to
ad3a5ec
Compare
No description provided.