Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1# Tup needs a setuid fusermount which may be outside $PATH. 2 3diff --git a/src/tup/server/fuse_server.c b/src/tup/server/fuse_server.c 4index d4ab648d..2dc9294b 100644 5--- a/src/tup/server/fuse_server.c 6+++ b/src/tup/server/fuse_server.c 7@@ -105,16 +105,21 @@ static void *fuse_thread(void *arg) 8 #if defined(__linux__) 9 static int os_unmount(void) 10 { 11- int rc; 12 #ifdef FUSE3 13- rc = system("fusermount3 -u -z " TUP_MNT); 14+#define FUSERMOUNT "fusermount3" 15 #else 16- rc = system("fusermount -u -z " TUP_MNT); 17+#define FUSERMOUNT "fusermount" 18 #endif 19+ int rc; 20+ const char *cmd = (access("/run/wrappers/bin/" FUSERMOUNT, X_OK) == 0) 21+ ? "/run/wrappers/bin/" FUSERMOUNT " -u -z " TUP_MNT 22+ : FUSERMOUNT " -u -z " TUP_MNT; 23+ rc = system(cmd); 24 if(rc == -1) { 25 perror("system"); 26 } 27 return rc; 28+#undef FUSERMOUNT 29 } 30 #elif defined(__APPLE__) 31 static int os_unmount(void)