From e21fea24ae2a7a04f6d5c9d2bbbaf5833d248952 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Fri, 26 Jul 2013 05:22:22 +0200 Subject: rework systemd's own process environment handling/passing Stop importing non-sensical kernel-exported variables. All parameters in the kernel command line are exported to the initial environment of PID1, but suppressed if they are recognized by kernel built-in code. The EFI booted kernel will add further kernel-internal things which do not belong into userspace. The passed original environ data of the process is not touched and preserved across re-execution, to allow external reading of /proc/self/environ for process properties like container*=. --- src/shared/strv.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/shared/strv.c') diff --git a/src/shared/strv.c b/src/shared/strv.c index a5ce7e9593..3e7778d61c 100644 --- a/src/shared/strv.c +++ b/src/shared/strv.c @@ -387,6 +387,21 @@ fail: return NULL; } +char **strv_appendf(char **l, const char *format, ...) { + va_list ap; + _cleanup_free_ char *s = NULL; + int r; + + va_start(ap, format); + r = vasprintf(&s, format, ap); + va_end(ap); + + if (r < 0) + return NULL; + + return strv_append(l, s); +} + int strv_push(char ***l, char *value) { char **c; unsigned n; -- cgit v1.2.3-54-g00ecf