cgroup: when referencing cgroup controller trees allow omission of the path
This commit is contained in:
parent
2b3ab29de4
commit
baa89da40a
2
TODO
2
TODO
|
@ -56,6 +56,8 @@ CGroup Rework Completion:
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
||||||
|
* move config_parse_path_strv() out of conf-parser.c
|
||||||
|
|
||||||
* libdsystemd-bus should expose utf8 validation calls
|
* libdsystemd-bus should expose utf8 validation calls
|
||||||
|
|
||||||
* When using "systemd status" on a slice unit also show all messages
|
* When using "systemd status" on a slice unit also show all messages
|
||||||
|
|
|
@ -156,7 +156,9 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
for (i = optind; i < argc; i++) {
|
for (i = optind; i < argc; i++) {
|
||||||
int q;
|
int q;
|
||||||
printf("%s:\n", argv[i]);
|
|
||||||
|
fprintf(stdout, "%s:\n", argv[i]);
|
||||||
|
fflush(stdout);
|
||||||
|
|
||||||
if (arg_machine)
|
if (arg_machine)
|
||||||
root = strjoin("machine/", arg_machine, "/", argv[i], NULL);
|
root = strjoin("machine/", arg_machine, "/", argv[i], NULL);
|
||||||
|
|
|
@ -1003,19 +1003,28 @@ int cg_split_spec(const char *spec, char **controller, char **path) {
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
u = strdup(e+1);
|
if (streq(e+1, "")) {
|
||||||
if (!u) {
|
u = strdup("/");
|
||||||
free(t);
|
if (!u) {
|
||||||
return -ENOMEM;
|
free(t);
|
||||||
}
|
return -ENOMEM;
|
||||||
if (!path_is_safe(u) ||
|
}
|
||||||
!path_is_absolute(u)) {
|
} else {
|
||||||
free(t);
|
u = strdup(e+1);
|
||||||
free(u);
|
if (!u) {
|
||||||
return -EINVAL;
|
free(t);
|
||||||
}
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
path_kill_slashes(u);
|
if (!path_is_safe(u) ||
|
||||||
|
!path_is_absolute(u)) {
|
||||||
|
free(t);
|
||||||
|
free(u);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
path_kill_slashes(u);
|
||||||
|
}
|
||||||
|
|
||||||
if (controller)
|
if (controller)
|
||||||
*controller = t;
|
*controller = t;
|
||||||
|
|
Loading…
Reference in New Issue