mirror of
https://github.com/mgree/ffs.git
synced 2024-09-11 11:15:48 +03:00
fix broken unlink.sh, support access
This commit is contained in:
parent
6a613084a4
commit
3e0285b2a2
@ -100,7 +100,7 @@ for examples of external dependency installation.
|
||||
+ [x] rmdir
|
||||
+ [ ] fsync
|
||||
+ [ ] fallocate
|
||||
+ [ ] access
|
||||
+ [x] access
|
||||
+ [ ] create
|
||||
+ [ ] copy_file_range
|
||||
- [ ] Output final FS to file at unmount
|
||||
@ -109,3 +109,7 @@ for examples of external dependency installation.
|
||||
+ [ ] TOML
|
||||
+ [ ] XML
|
||||
+ [ ] Generic framework (detect/parse/unparse)
|
||||
- [ ] Missing tests
|
||||
+ [ ] access
|
||||
+ [ ] multi-user stuff
|
||||
+ [ ] error code coverage
|
||||
|
15
src/fs.rs
15
src/fs.rs
@ -165,7 +165,20 @@ impl Entry {
|
||||
|
||||
impl Filesystem for FS {
|
||||
fn destroy(&mut self, _req: &Request) {
|
||||
debug!("{:?}", self);
|
||||
debug!("{:?}", self.inodes);
|
||||
}
|
||||
|
||||
fn access(&mut self, req: &Request, inode: u64, _mask: i32, reply: ReplyEmpty) {
|
||||
match self.get(inode) {
|
||||
Ok(_) => {
|
||||
if self.check_access(req) {
|
||||
reply.ok()
|
||||
} else {
|
||||
reply.error(libc::EACCES)
|
||||
}
|
||||
}
|
||||
Err(_) => reply.error(libc::ENOENT),
|
||||
}
|
||||
}
|
||||
|
||||
fn lookup(&mut self, _req: &Request, parent: u64, name: &OsStr, reply: ReplyEntry) {
|
||||
|
@ -35,7 +35,7 @@ case $(ls) in
|
||||
(eyes*fingernails*human*name) ;;
|
||||
(*) fail ls3;;
|
||||
esac
|
||||
[ "$(cat human)" = "true" ] || fail human2
|
||||
[ "$(cat human)" = "false" ] || fail human2
|
||||
cd - >/dev/null 2>&1
|
||||
umount "$MNT" || fail unmount
|
||||
sleep 1
|
||||
|
Loading…
Reference in New Issue
Block a user