From 2ce0f9de5e4da32eca0d217889a4a62f79feacd1 Mon Sep 17 00:00:00 2001 From: "Anna (navi) Figueiredo Gomes" Date: Thu, 15 Jun 2023 18:38:23 -0300 Subject: misc.c: export the right paths when in user mode Signed-off-by: Anna (navi) Figueiredo Gomes --- src/shared/misc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/shared/misc.c') diff --git a/src/shared/misc.c b/src/shared/misc.c index fbb50b59..11393d33 100644 --- a/src/shared/misc.c +++ b/src/shared/misc.c @@ -147,6 +147,7 @@ env_config(void) char *path; char *p; char *e; + char *svcdir; size_t l; struct utsname uts; FILE *fp; @@ -187,8 +188,12 @@ env_config(void) setenv("RC_VERSION", VERSION, 1); setenv("RC_LIBEXECDIR", RC_LIBEXECDIR, 1); - setenv("RC_SVCDIR", RC_SVCDIR, 1); - setenv("RC_TMPDIR", RC_SVCDIR "/tmp", 1); + svcdir = rc_svcdir(); + setenv("RC_SVCDIR", svcdir, 1); + xasprintf(&e, "%s/%s", svcdir, "/tmp"); + setenv("RC_TMPDIR", e, 1); + free(e); + free(svcdir); setenv("RC_BOOTLEVEL", RC_LEVEL_BOOT, 1); e = rc_runlevel_get(); setenv("RC_RUNLEVEL", e, 1); -- cgit v1.2.3