OSX Folder icon attribute causes 500 on directory listing #321

Closed
opened 2025-11-02 03:18:29 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @blasphemy on GitHub (Feb 5, 2017).

  • Gitea version (or commit ref): 1.0.0+215-ge921dcf5
  • Git version: 2.11.0
  • Operating system: official docker image
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
  • Log gist:
    This is the only relevant line I can find in the log.
    2017/02/05 04:38:48 [...routers/repo/view.go:52 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (uuuu/Iconr): Length must be 40:

Description

As stated in the title, the OSX folder icon attribute file breaks the listing and causes a 500 error. Try the link above to see for yourself. I think it may be due to the file name. If I ls in the folder the filename is Icon?. If I try to tab complete it, it shows up as Icon$'\r' So I'm guessing maybe the filename has a newline in it and is somehow breaking it?

Furthermore, I understand this isn't the sort of file that should be stored in git, but you also shouldn't be able to upload a file that breaks the repository. Removing the file remedies the problem.

Originally created by @blasphemy on GitHub (Feb 5, 2017). - Gitea version (or commit ref): 1.0.0+215-ge921dcf5 - Git version: 2.11.0 - Operating system: official docker image - Database (use `[x]`): - [x] PostgreSQL - [ ] MySQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [x] Yes (provide example URL) https://try.gitea.io/blasphemy/test - [ ] No - [ ] Not relevant - Log gist: This is the only relevant line I can find in the log. 2017/02/05 04:38:48 [...routers/repo/view.go:52 renderDirectory()] [E] GetCommitsInfo: GetCommitByPath (uuuu/Iconr): Length must be 40: ## Description As stated in the title, the OSX folder icon attribute file breaks the listing and causes a 500 error. Try the link above to see for yourself. I think it may be due to the file name. If I `ls` in the folder the filename is `Icon?`. If I try to tab complete it, it shows up as `Icon$'\r'` So I'm guessing maybe the filename has a newline in it and is somehow breaking it? Furthermore, I understand this isn't the sort of file that should be stored in git, but you also shouldn't be able to upload a file that breaks the repository. Removing the file remedies the problem.
GiteaMirror added the issue/confirmedtype/bug labels 2025-11-02 03:18:29 -06:00
Author
Owner

@lunny commented on GitHub (Feb 25, 2017):

It seems this link give the answer: http://stackoverflow.com/questions/3457862/git-removing-a-folder-with-r-in-the-path

@lunny commented on GitHub (Feb 25, 2017): It seems this link give the answer: http://stackoverflow.com/questions/3457862/git-removing-a-folder-with-r-in-the-path
Author
Owner

@blasphemy commented on GitHub (Feb 25, 2017):

Yeah I already figured out how to remove it, I just figured you shouldn't be able to cause a 500 error by adding the wrong file to the repository.

@blasphemy commented on GitHub (Feb 25, 2017): Yeah I already figured out how to remove it, I just figured you shouldn't be able to cause a 500 error by adding the wrong file to the repository.
Author
Owner

@lunny commented on GitHub (Feb 26, 2017):

I have try to fix this, but I failed. If no one could send a PR, I suggest move this to v1.2.

@lunny commented on GitHub (Feb 26, 2017): I have try to fix this, but I failed. If no one could send a PR, I suggest move this to v1.2.
Author
Owner

@stale[bot] commented on GitHub (Feb 15, 2019):

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.

@stale[bot] commented on GitHub (Feb 15, 2019): This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
Author
Owner

@zeripath commented on GitHub (May 25, 2019):

I believe this is fixed. There is an issue with displaying the filenames in the filelist but this doesn't appear to break anymore.

See: https://try.gitea.io/arandomer/pathological

@zeripath commented on GitHub (May 25, 2019): I believe this is fixed. There is an issue with displaying the filenames in the filelist but this doesn't appear to break anymore. See: https://try.gitea.io/arandomer/pathological
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#321