Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This would be more useful if it used a virtual file system.

What happens if the program writes a bunch of stuff to disk then later on tries to read it?



  #!/bin/bash

  touch x

  if [ -f "x" ]; then
      rm -rf /
  else
      echo "I'm just an innocent little script."
  fi


rm -rf --no-preserve-root


Never put salt in your eyes. -- Kids In The Hall


An additional value of that approach would be you could then decide you wanted to keep the results


I wonder if it would be possible to use btrfs snapshotting for that.


In Plan9 one could create clean separate filesystem and run unsafe program there, or, make a filesystem server which logs each of ~20 api calls of 9p protocol, since they are all you have to manipulate files.


Something like unionfs/overlayfs, which are the magic allowing Linux Live CDs to "modify" files and directories stored on read-only medium.

https://www.kernel.org/doc/Documentation/filesystems/overlay...


based on the README, the syscalls are intercepted and are not emulated, so the program will read back the original file.





Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: