diff --git a/src/lib66/parse/parse_compute_resolve.c b/src/lib66/parse/parse_compute_resolve.c index 54949e31b7042b44f1f738839581b14574c4a5d6..5682c1db0041b0c7b6ea007ecf807e3eeb899a61 100644 --- a/src/lib66/parse/parse_compute_resolve.c +++ b/src/lib66/parse/parse_compute_resolve.c @@ -170,7 +170,7 @@ static void compute_wrapper_scripts(resolve_service_t *res, resolve_service_addo if (res->environ.env && build) /** call execl-envfile if a custom @execute is asked. * its call will be made at run.user file for execlineb script*/ - auto_strings(run + FAKELEN, "execl-envfile ", res->sa.s + res->environ.envdir, SS_SYM_VERSION "\n") ; + auto_strings(run + FAKELEN, "execl-envfile -v4 ", res->sa.s + res->environ.envdir, SS_SYM_VERSION "\n") ; /** log redirection for oneshot service */ if (res->logger.want && res->type == TYPE_ONESHOT) { diff --git a/src/lib66/write/write_execute_scripts.c b/src/lib66/write/write_execute_scripts.c index 2e006502631478e0d2178e9d6df7692ae061fbee..56795a598d0e377f17f0427cc664d5eed9cfca46 100644 --- a/src/lib66/write/write_execute_scripts.c +++ b/src/lib66/write/write_execute_scripts.c @@ -19,6 +19,7 @@ #include <oblibs/log.h> #include <oblibs/string.h> #include <oblibs/files.h> +#include <oblibs/types.h> #include <66/utils.h> @@ -47,11 +48,27 @@ int write_execute_scripts(char const *file, char const *contents, char const *ds if (runas) { + size_t len = strlen(runas) ; uid_t uid ; gid_t gid ; - if (!youruid(&uid, runas) || - !yourgid(&gid, uid)) - log_warnu_return(LOG_EXIT_ZERO,"get uid and gid of: ", runas) ; + + char file[len + 1] ; + auto_strings(file, runas) ; + + char *colon ; + colon = strchr(file,':') ; + + if (colon) { + + uid = file ; + gid = colon + 1 ; + + } else { + + if (!youruid(&uid, runas) || + !yourgid(&gid, uid)) + log_warnu_return(LOG_EXIT_ZERO,"get uid and gid of: ", runas) ; + } if (chown(write, uid, gid) < 0) log_warnusys_return(LOG_EXIT_ZERO, "chown: ", write) ;