Files
infix/package/finit/0001-Remove-redundant-global-path-var-and-fix-memory-corr.patch
T
Joachim Wiberg ea5071a264 package/finit: backport upstream fixes
Backport fixes from upstream post v4.16 release.  Mainly to fix
mdns-alias crash+restart counter issue when avahi-daemon has to
be restarted.  Finit did not properly clear the dependency that
mdns-alias had on avahi-daemon, causing it to crash and have its
restart counter incremented.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
2026-03-20 16:18:02 +01:00

55 lines
1.4 KiB
Diff

From 184c079c08387d1b0f74de25b63c56304d2156d0 Mon Sep 17 00:00:00 2001
From: bazub <github@zubko.cc>
Date: Tue, 3 Mar 2026 20:31:33 +0000
Subject: [PATCH 1/3] Remove redundant global path var and fix memory
corruption
Organization: Wires
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/conf.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/src/conf.c b/src/conf.c
index d0abb61d..6e8ec834 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -121,9 +121,6 @@ static uev_t etcw;
static TAILQ_HEAD(, conf_change) conf_change_list = TAILQ_HEAD_INITIALIZER(conf_change_list);
-static char *path;
-static char *shell;
-
static int parse_conf(char *file, int is_rcsd);
static void drop_changes(void);
@@ -377,8 +374,6 @@ void conf_parse_cmdline(int argc, char *argv[])
fstab = strdup(ptr);
finit_conf = strdup(FINIT_CONF);
finit_rcsd = strdup(FINIT_RCSD);
- path = getenv("PATH");
- shell = getenv("SHELL");
for (int i = 1; i < argc; i++)
parse_arg(argv[i]);
@@ -404,13 +399,9 @@ void conf_reset_env(void)
free(node);
}
- if (path)
- setenv("PATH", path, 1);
- else
+ if (!getenv("PATH"))
setenv("PATH", _PATH_STDPATH, 1);
- if (shell)
- setenv("SHELL", shell, 1);
- else
+ if (!getenv("SHELL"))
setenv("SHELL", _PATH_BSHELL, 1);
setenv("LOGNAME", "root", 1);
setenv("USER", "root", 1);
--
2.43.0