SHA256
1
0
forked from pool/systemd
systemd/systemctl-options.patch
Marcus Meissner e46422362e Accepting request 163593 from home:fcrozat:branches:Base:System
- Add improve-readahead-spinning.patch: improve readahead
  performance on spinning media with ext4.
- Add fix-journal-vacuum-logic.patch: fix vacuum logic in journal
  (bnc#789589).
- Add fix-lsb-provides.patch: ensure LSB provides are correctly
  handled if also referenced as dependencies (bnc#809646).
- Add fix-loopback-mount.patch: ensure udevd is started (and
  therefore static devices are created) before mounting
  (bnc#809820).
- Update systemd-sysv-convert to search services files in new
  location (bnc#809695).
- Add logind-nvidia-acl.diff: set ACL on nvidia devices
  (bnc#808319).
- Add do-no-isolate-on-fsck-failure.patch: do not turn off services
  if fsck fails (bnc#812874)
- Add wait-for-processes-killed.patch: wait for processes killed by
  SIGTERM before killing them with SIGKILL.
- Update systemctl-options.patch to only apply SYSTEMCTL_OPTIONS to
  systemctl command (bnc#801878).

OBS-URL: https://build.opensuse.org/request/show/163593
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=361
2013-04-11 10:11:09 +00:00

47 lines
1.7 KiB
Diff

Index: systemd-195/src/systemctl/systemctl.c
===================================================================
--- systemd-195.orig/src/systemctl/systemctl.c
+++ systemd-195/src/systemctl/systemctl.c
@@ -4118,10 +4118,32 @@ static int systemctl_parse_argv(int argc
};
int c;
+ char **to_free = NULL;
assert(argc >= 0);
assert(argv);
+ if (secure_getenv("SYSTEMCTL_OPTIONS")) {
+ char **parsed_systemctl_options = strv_split_quoted(getenv("SYSTEMCTL_OPTIONS"));
+
+ if (*parsed_systemctl_options && **parsed_systemctl_options) {
+ char **k,**a;
+ char **new_argv = new(char*, strv_length(argv) + strv_length(parsed_systemctl_options) + 1);
+ new_argv[0] = strdup(argv[0]);
+ for (k = new_argv+1, a = parsed_systemctl_options; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ for (a = argv+1; *a; k++, a++) {
+ *k = strdup(*a);
+ }
+ *k = NULL;
+ argv = new_argv;
+ argc = strv_length(new_argv);
+ strv_free (parsed_systemctl_options);
+ to_free = new_argv;
+ }
+ }
+
while ((c = getopt_long(argc, argv, "ht:p:aqfs:H:Pn:o:", options, NULL)) >= 0) {
switch (c) {
@@ -4297,6 +4319,8 @@ static int systemctl_parse_argv(int argc
return -EINVAL;
}
+ strv_free(to_free);
+
return 1;
}