From 2043072a87447a23ee61d8ffcaacb438159f5c0b Mon Sep 17 00:00:00 2001 From: Suzanne Soy Date: Tue, 17 Oct 2023 00:31:02 +0200 Subject: [PATCH] Added README, noted a couple of ideas/TODOs --- README.md | 2 ++ fs.py | 10 +++++++++- test.sh | 8 +++++++- 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..d1a8ee2 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +Similar projects by other people: +* https://github.com/mikeswain/cmdfs From what I understand, cmdfs needs to run the command on all files ahead of time in order to know the generated file size. It also seems to be more geared towards running a single command (e.g. convert ogg to mp3, or convert png to jpeg). I want to run different commands, and want them to be executed only when the file is accessed. \ No newline at end of file diff --git a/fs.py b/fs.py index f4a8eaf..03cad64 100755 --- a/fs.py +++ b/fs.py @@ -203,4 +203,12 @@ def main(source, cache, mountpoint): FUSE(FilterFS(source, cache), mountpoint, nothreads=True, foreground=True, direct_io = True) if __name__ == '__main__': - main(sys.argv[1], sys.argv[2], sys.argv[3]) \ No newline at end of file + main(sys.argv[1], sys.argv[2], sys.argv[3]) + +# TODO: an option to check that commands are signed with a trusted GPG key before executing them +# This would allow the user to run this on a filesystem containing a mix of trusted and +# untrusted files (e.g. tar -zxf untrusted-downloaded-file.tar.gz is dangerous). In order to +# prevent replay attacks, the signed data should include things like the path to the +# symlink-command (otherwise re-using that signed symlink-command in another location with +# different files could be used to change the semantics of the command), and/or the inputs +# (the command itself and the hash of the input files) \ No newline at end of file diff --git a/test.sh b/test.sh index 8d23447..fec5969 100755 --- a/test.sh +++ b/test.sh @@ -56,4 +56,10 @@ else printf '\033[1;31mFailure\033[m\n' fusermount -u test/mnt || kill -KILL $pid exit 1 -fi \ No newline at end of file +fi + +# TODO: tests for ctime +# e.g. using https://serverfault.com/questions/520322/unix-ctime-how-to-keep-this-precious-information-in-backups-tar +# or https://www.halfgaar.net/backing-up-unix +# or simply find -print0 | xargs -0 stat +# Note that on ext4 we can't access this information without root permissions: https://unix.stackexchange.com/questions/50177/birth-is-empty-on-ext4 \ No newline at end of file