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*=.
This commit is contained in:
Kay Sievers
2013-07-26 18:40:40 +02:00
parent 68fee104e6
commit e21fea24ae
8 changed files with 77 additions and 97 deletions
+15
View File
@@ -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;
+1
View File
@@ -42,6 +42,7 @@ unsigned strv_length(char * const *l) _pure_;
char **strv_merge(char **a, char **b);
char **strv_merge_concat(char **a, char **b, const char *suffix);
char **strv_append(char **l, const char *s);
char **strv_appendf(char **l, const char *format, ...) _printf_attr_(2, 3);
int strv_extend(char ***l, const char *value);
int strv_push(char ***l, char *value);