Repositories / jai.git
jai.git
Clone (read-only): git clone http://git.guha-anderson.com/git/jai.git
@@ -1,6 +1,8 @@ -This software only runs on modern versions of linux. It makes -extensive use of non-portable file system namespace facilities. +This software only runs on modern versions of linux, starting with +linux 6.13. It makes extensive use of non-portable +file-descriptor-based mount calls and file system namespace +facilities. To get the software, run:
@@ -1,6 +1,6 @@  -# JAI - An ultra lightweight jail for AI CLIs on linux +# JAI - An ultra lightweight jail for AI CLIs on linux 6.13 and later `jai` strives to be the easiest container in the world to configure--so easy that you never again need to run a code assistant
@@ -335,10 +335,13 @@ Config::make_home_overlay() restore.reset(); Fd fsfd = xfsopen("overlay", cat("jai-", sb).c_str()); - if (fsconfig(*fsfd, FSCONFIG_SET_FD, "lowerdir+", nullptr, home()) || - fsconfig(*fsfd, FSCONFIG_SET_FD, "upperdir", nullptr, *changes) || - fsconfig(*fsfd, FSCONFIG_SET_FD, "workdir", nullptr, *work)) - syserr("fsconfig(FSCONFIG_SET_FD)"); + auto xsetfd = [&](const char *param, int fd) { + if (fsconfig(*fsfd, FSCONFIG_SET_FD, param, nullptr, fd)) + syserr("fsconfig(FSCONFIG_SET_FD, \"{}\")", param); + }; + xsetfd("lowerdir+", home()); + xsetfd("upperdir", *changes); + xsetfd("workdir", *work); Fd mnt = make_mount(*fsfd); xmnt_move(*mnt, *sandboxed_home);