Invalid directory issue with online editor #7024

Closed
opened 2025-11-02 07:13:46 -06:00 by GiteaMirror · 3 comments
Owner

Originally created by @KN4CK3R on GitHub (Mar 19, 2021).

  • Gitea version (or commit ref): current master

Description

When using the online editor an invalid directory name (because of a file with the same name exists) is detected and reported as an error. On the editor page the invalid directory is now embedded into the path and can't be changed anymore.

Screenshots

test

Originally created by @KN4CK3R on GitHub (Mar 19, 2021). - Gitea version (or commit ref): current master ## Description When using the online editor an invalid directory name (because of a file with the same name exists) is detected and reported as an error. On the editor page the invalid directory is now embedded into the path and can't be changed anymore. ## Screenshots ![test](https://user-images.githubusercontent.com/1666336/111799900-ba48bd80-88cb-11eb-8209-76c29114205b.gif)
Author
Owner

@silverwind commented on GitHub (Mar 19, 2021):

Huh, I guess no on really thought about putting directories there. If we continue to allow it, we must sanitize input for any .. path segments for security (thought I guess it may not be as critical as this operates on paths within the bare git repos, not directly on the file system).

@silverwind commented on GitHub (Mar 19, 2021): Huh, I guess no on really thought about putting directories there. If we continue to allow it, we must sanitize input for any `..` path segments for security (thought I guess it may not be as critical as this operates on paths within the bare git repos, not directly on the file system).
Author
Owner

@KN4CK3R commented on GitHub (Mar 19, 2021):

It looks like there isn't an error. The info tooltip says to press backspace on the left of the input field. In this case the directory name gets pulled into the name field again.

.. isn't a problem too:
grafik

@KN4CK3R commented on GitHub (Mar 19, 2021): It looks like there isn't an error. The info tooltip says to press backspace on the left of the input field. In this case the directory name gets pulled into the name field again. `..` isn't a problem too: ![grafik](https://user-images.githubusercontent.com/1666336/111818863-f5ed8280-88df-11eb-88ff-54517ee8dbe9.png)
Author
Owner

@zeripath commented on GitHub (Mar 19, 2021):

Agh but you have found a bug - we really should not be displaying /src/data/tmp/local-repo/...

@zeripath commented on GitHub (Mar 19, 2021): Agh but you have found a bug - we really should not be displaying `/src/data/tmp/local-repo/...`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#7024