Live data from Hacker News

Show HN: Bashfs – Run commands as your filesystem

github.com

21–30 of 35 posts

Re: Show HN: Bashfs – Run commands as your filesystem

#21
Is there something like FUSE for a single file?

My use case is for pass. I like to keep my secret files in there, but I still have plain text redudancy, because, well, encrypted files are useless while encrypted.

I would like to have a "virtual file" which any program could accept as its config file where I could control the results of `read()`

In my case, I would associate the current file to its pass equivalent, decrypt the pass equivalent and return the decrypted data.

Re: Show HN: Bashfs – Run commands as your filesystem

#22

Earlier quoted context omitted.

They address this in the README. https://github.com/pcgrosen/bashfs#why

I appreciate the attempt to help, but I disagree. The README "addresses" a question of "why?". But because that's not a real answer, it's not a valid response to " but really why?"

"Why not?" here is an idiom for "I know it serves little purpose but I did it for the fun of tinkering with stuff."

Re: Show HN: Bashfs – Run commands as your filesystem

#23
post #20

No, but really, why? I am not putting it down. I just don’t understand what is happening exactly, and the why might help.

I get that it's for fun but the danger is security. Someone could use this as a "fun" feature at work and then get pwned.

Eh, if an attacker has filesystem access you're already pwned.

Re: Show HN: Bashfs – Run commands as your filesystem

#24

I worked on a semi-similar project, to let people turn bash scripts into FUSE filesystems: https://github.com/jasonhansel/microfs For example, this script is used to make a FS that turns the web into a filesystem, so reading /www.google.com/GET will show the Google homepage: https://github.com/jasonhansel/microfs/blob/master/http.sh

microfs looks interesting to me, but unfortunately crashes with a SEGFAULT on Ubuntu 19.04:

Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7de88b8 in __GI__IO_fread (buf=buf@entry=0x7fffffffd4f0, size=size@entry=1, count=count@entry=1024, fp=0x0) at iofread.c:35

Re: Show HN: Bashfs – Run commands as your filesystem

#26
post #21

Is there something like FUSE for a single file? My use case is for pass. I like to keep my secret files in there, but I still have plain text redudancy, because, well, encrypted files are useless while encrypted. I would like to have a "virtual file" which any program could accept as its config file where I could control the results of `read()` In my case, I would associate the current file to its pass equivalent, de…

Sure, fuse actually implements the lesser known CUSE protocol as well. Stands for character device in user space, and does exactly what you describe.

Re: Show HN: Bashfs – Run commands as your filesystem

#27

There's a lot of 'Why?'s here, what I feel from this is that the FS can now be a turing-complete system. This will allow to extend the 'Everything is a file' concept in UNIX (whether it's good or bad is a different question;) to computation. With BashFS, computation & interaction with other programs is now a file; we can 'open' a appropriate file instead of managing subprocesses anymore! This (at least to me) blur th…

Check out Plan 9.

Re: Show HN: Bashfs – Run commands as your filesystem

#28
post #21

Is there something like FUSE for a single file? My use case is for pass. I like to keep my secret files in there, but I still have plain text redudancy, because, well, encrypted files are useless while encrypted. I would like to have a "virtual file" which any program could accept as its config file where I could control the results of `read()` In my case, I would associate the current file to its pass equivalent, de…

That is exactly how fuse operates.

Re: Show HN: Bashfs – Run commands as your filesystem

#29

I worked on a semi-similar project, to let people turn bash scripts into FUSE filesystems: https://github.com/jasonhansel/microfs For example, this script is used to make a FS that turns the web into a filesystem, so reading /www.google.com/GET will show the Google homepage: https://github.com/jasonhansel/microfs/blob/master/http.sh

microfs looks interesting to me, but unfortunately crashes with a SEGFAULT on Ubuntu 19.04: Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7de88b8 in __GI__IO_fread (buf=buf@entry=0x7fffffffd4f0, size=size@entry=1, count=count@entry=1024, fp=0x0) at iofread.c:35

This was a school project that only had to compile on one specific machine.

I may rewrite it in Rust (probably with lots of new features) if there is interest.

Post reply on HN