[Github-comments] [geany/geany] Use relative paths for project session files if base directory is relative (PR #3021)

xiota notifications at xxxxx
Sat Nov 27 00:46:10 UTC 2021


> but #3015 basically kills the possibility to move projects to other location without losing session files for that project so then this pull request becomes pointless.

It does not "kills the possibility to move projects to other location".  I have noted [several ways](https://github.com/geany/geany/issues/3015#issuecomment-979876697) that moving project files could be supported.

> So I'm getting ready to be the evil guy who dislikes #3015 :-)

#3015 is a discussion issue.  If you dislike discussion, you don't have to participate.  But you'd give up letting others know of your concerns and use cases.

> To @xiota... just more context why I want this to work:

As I've stated, I think this PR is reasonable and would support merging it with a few minor changes.

* Add some comments to make clear to people staring at the code in the future what the intended behavior is.
  + To note that `g_file_get_relative_path` does not create `..` paths.
  + To make clear that the purpose of lines 1290-1298 is to unpack relative paths for project files.  (similar to the comment at 368-369)
  * To note that non-project relative paths are not handled at this time (so people working on config/session split will know what to do when refactoring this code).
* Add a check to drop paths with `..` to prevent access to files outside the project folder.
  +  Even though this PR doesn't write relative paths in certain ways, session and project files can be edited externally or another PR may change it.


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3021#issuecomment-980477322
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211126/ac010736/attachment.htm>


More information about the Github-comments mailing list