Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine safe operations within ReadDir #7

Open
nickray opened this issue Apr 14, 2020 · 0 comments
Open

Determine safe operations within ReadDir #7

nickray opened this issue Apr 14, 2020 · 0 comments

Comments

@nickray
Copy link
Member

nickray commented Apr 14, 2020

There seems to be some flexibility in what can be done while iterating over a directory, for instance the current file can be read, and it can even be deleted.

However, some things must be prevented. E.g. in a setup like

.
├── a.txt
├── b.txt
└── c.txt

if c.txt is deleted while the iterator is at b.txt, there's a crash: thread 'fsc::tests::todo' panicked at 'slice index starts at 4294966960 but ends at 4096', src/libcore/slice/mod.rs:2680:5

The plan is then to have read_dir_and_then expose a RestrictedFilesystem, that e.g. might prevent Filesystem::remove (mark as unsafe, or remove method completely).

We do want to keep Filesystem::remove_dir_all for instance, though.

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

No branches or pull requests

1 participant