From ae267613cc239ce7e3208a0452838da75629e268 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Sun, 16 Oct 2022 00:59:06 +1100
Subject: [PATCH] install 66-fdholder-filler at libexec directory

---
 package/targets.mak |  9 ++++++---
 src/66/66-scandir.c | 12 +++---------
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/package/targets.mak b/package/targets.mak
index e0ec9126..0b50c65d 100644
--- a/package/targets.mak
+++ b/package/targets.mak
@@ -22,8 +22,11 @@ BIN_TARGETS := \
 66-umountall \
 66-echo \
 execl-envfile \
-66-nuke \
-66-oneshot \
-66-fdholder-filler
+66-nuke
+
+LIBEXEC_TARGETS := \
+66-fdholder-filler \
+66-oneshot
+
 
 LIB_DEFS := 66=66
diff --git a/src/66/66-scandir.c b/src/66/66-scandir.c
index 590a5662..4dd6dea1 100644
--- a/src/66/66-scandir.c
+++ b/src/66/66-scandir.c
@@ -659,14 +659,8 @@ static void create_service_fdholder(char const *scandir)
     if (symlink(dst, sym) < 0)
         log_dieusys(LOG_EXIT_SYS, "symlink: ", dst) ;
 
-    size_t runlen = strlen(SS_EXECLINE_SHEBANGPREFIX) +  277 + 1 ;
-    /* {
-     *
-     *
-     *
-     * should be libexec/66-fdholder-filler
-     *
-     * */
+    size_t runlen = strlen(SS_EXECLINE_SHEBANGPREFIX) + strlen(SS_LIBEXECPREFIX) + 277 + 1 ;
+
     char run[runlen] ;
     auto_strings(run, "#!" SS_EXECLINE_SHEBANGPREFIX "execlineb -P\n", \
                 "pipeline -dw -- {\n",
@@ -677,7 +671,7 @@ static void create_service_fdholder(char const *scandir)
                 "   if -nt -- {\n", \
                 "       redirfd -r 0 ./data/autofilled\n", \
                 "       s6-ipcclient -l0 -- s\n", \
-                "       /tmp/66/66-fdholder-filler -1 --\n", \
+                "       ", SS_LIBEXECPREFIX "66-fdholder-filler -1 --\n", \
                 "   }\n", \
                 "   s6-svc -t .\n", \
                 "}\n", \
-- 
GitLab