README (2489B)
1 sfakeroot 2 ========= 3 4 sfakeroot is a minimalist fakeroot[1]. It uses LD_PRELOAD 5 to provide an environment in which stat() and related calls 6 return uid/gid 0, so that files appear to be owned by root even when they're 7 not. Inside the fakeroot environment permissions can be modified as if the 8 current user is root, though ownership of the underlying files is never 9 really changed. Any permissions set within the fakeroot environment will 10 last only for the duration of the session, once sfakeroot exits all changes 11 are lost. If you need to preserve session state between calls you can tell sfakeroot to save the session to a file, which can be loaded again when sfakeroot runs. See man page for details. 12 13 Why? 14 ---- 15 16 sfakeroot was written because there is no OpenBSD compatible fakeroot 17 equivalent, I considered porting fakeroot but it seemed too difficult. 18 On Linux you will probably just use docker, but this could be a useful 19 tool if docker is not an option. 20 21 Currently supported calls 22 -------------------------- 23 24 This is a list of calls that will currently be intercepted by sfakeroot: 25 26 * stat 27 * lstat 28 * fstat 29 * fstatat 30 * chown 31 * lchown 32 * fchown 33 * fchownat 34 * chmod 35 * statx 36 37 Installation 38 ------------ 39 40 To build run: 41 42 $ make 43 44 followed by (as root), 45 46 # make install 47 48 to install to standard locations. 49 50 You can also uninstall with (as root), 51 52 # make uninstall 53 54 Contributing 55 ------------ 56 57 Please feel welcome to submit patches and bug reports via email 58 to my public-inbox ~richardipsum/public-inbox@lists.sr.ht 59 alternatively patches may be submitted in private using the address 60 found in the git log. 61 62 See https://git-send-email.io/ for details on contributing 63 via email with git. 64 65 The archive of my public-inbox can be found at 66 https://lists.sr.ht/~richardipsum/public-inbox. 67 68 Known issues 69 ------------ 70 71 Since OpenBSD's base utils are statically linked sfakeroot may be less 72 useful on OpenBSD than it is on Linux, since the LD_PRELOAD tricks only 73 work with dynamically linked executables. Even with dynamically linked 74 executables sfakeroot may be of limited use for any programs using pledge(), 75 since sfakeroot may try to make use of syscalls not specified in the pledge() 76 call thereby causing sfakeroot to be terminated with SIGABRT. 77 78 To make better use of sfakeroot on OpenBSD you may wish to use it with sbase[2]. 79 80 [1]: http://freshmeat.sourceforge.net/projects/fakeroot 81 [2]: https://git.suckless.org/sbase/ 82 83 TODO 84 ---- 85 86 * Support fts and ftw functions. 87 * Support fchmod fchmodat