From f53257c6334b5a54099d30d0fd70e1e41a99e832 Mon Sep 17 00:00:00 2001
From: obarun <eric@obarun.org>
Date: Sun, 4 Jun 2023 12:07:19 +1100
Subject: [PATCH] Fix the assignment of UID and GID

---
 src/lib66/write/write_execute_scripts.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/lib66/write/write_execute_scripts.c b/src/lib66/write/write_execute_scripts.c
index 56795a59..fe850860 100644
--- a/src/lib66/write/write_execute_scripts.c
+++ b/src/lib66/write/write_execute_scripts.c
@@ -60,8 +60,11 @@ int write_execute_scripts(char const *file, char const *contents, char const *ds
 
         if (colon) {
 
-            uid = file ;
-            gid = colon + 1 ;
+            if (!uid0_scan(file, &uid))
+                log_warnu_return(LOG_EXIT_ZERO,"get uid of: ", runas) ;
+
+            if (!gid0_scan(colon + 1, &gid))
+                log_warnu_return(LOG_EXIT_ZERO,"get gid of: ", runas) ;
 
         } else {
 
-- 
GitLab