Skip to content

mkdir: return 403 error for mkdir action in the root dir#1351

Merged
KernelDeimos merged 2 commits intoHeyPuter:mainfrom
XiaochenCui:fs/mkdir-1348
Jul 15, 2025
Merged

mkdir: return 403 error for mkdir action in the root dir#1351
KernelDeimos merged 2 commits intoHeyPuter:mainfrom
XiaochenCui:fs/mkdir-1348

Conversation

@XiaochenCui
Copy link
Copy Markdown
Contributor

fix: #1348

This PR adds check in the "mkdir" logic.
Backend now throws a "403 forbidden" instead of "500 internal server error" when creating dir in the root.

This PR has been tested manually for the following cases:

// return "403 forbiddend" error
puter.fs.mkdir('/foo')

// create successfully
//
// "/bold_toy_921/Videos" is a dir created automatically when running puter locally
puter.fs.mkdir('/bold_toy_921/Videos/foo')

// "readdir" should be able to see "foo" dir now
await puter.fs.readdir('/bold_toy_921/Videos/')

@XiaochenCui XiaochenCui marked this pull request as ready for review July 15, 2025 18:08
@XiaochenCui
Copy link
Copy Markdown
Contributor Author

hey @jelveh
this pr is ready for merge

Comment thread src/backend/src/filesystem/hl_operations/hl_mkdir.js
@KernelDeimos KernelDeimos merged commit d574969 into HeyPuter:main Jul 15, 2025
4 checks passed
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.

Bug: 500 Internal Server Error When Creating Directory in Root

2 participants