Skip to content
This repository was archived by the owner on Mar 6, 2025. It is now read-only.

Return an error if we try to write a file to /#44

Merged
toby merged 6 commits into
charmbracelet:mainfrom
rubiojr:rubiojr/error-if-root-fs
Dec 20, 2021
Merged

Return an error if we try to write a file to /#44
toby merged 6 commits into
charmbracelet:mainfrom
rubiojr:rubiojr/error-if-root-fs

Conversation

@rubiojr
Copy link
Copy Markdown
Contributor

@rubiojr rubiojr commented Dec 18, 2021

Fixes #43

@rubiojr
Copy link
Copy Markdown
Contributor Author

rubiojr commented Dec 18, 2021

Should the client also append the path when no path is specified? i.e.

charm fs cp hello.txt charm:/

should create /hello.txt perhaps?

@rubiojr
Copy link
Copy Markdown
Contributor Author

rubiojr commented Dec 18, 2021

The client does the file path encryption before sending it to the server, so perhaps I could use more realistic paths in the tests I added, using EncryptPath from the fs package? Given EncryptPath also splits the path on / encrypting path components individually, don't think it makes a big difference it this particular case.

Copy link
Copy Markdown
Contributor

@toby toby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome! Great catch and thank you so much for the contributions @rubiojr!!

@toby toby merged commit f25aa3f into charmbracelet:main Dec 20, 2021
@rubiojr rubiojr deleted the rubiojr/error-if-root-fs branch December 20, 2021 18:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FS: copying the first file to charm:/ breaks the file server

2 participants