chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
machine: validate machine names using machine_name_is_valid() instead of string_is_safe()
[elogind.git]
/
src
/
journal
/
sd-journal.c
diff --git
a/src/journal/sd-journal.c
b/src/journal/sd-journal.c
index daa04ac4fac7184f0863ef8730b07f4a614b1f75..ac57f4f6f8942f28d6ff9469f6d132e97487da16 100644
(file)
--- a/
src/journal/sd-journal.c
+++ b/
src/journal/sd-journal.c
@@
-1735,7
+1735,7
@@
_public_ int sd_journal_open_container(sd_journal **ret, const char *machine, in
assert_return(machine, -EINVAL);
assert_return(ret, -EINVAL);
assert_return((flags & ~(SD_JOURNAL_LOCAL_ONLY|SD_JOURNAL_SYSTEM)) == 0, -EINVAL);
assert_return(machine, -EINVAL);
assert_return(ret, -EINVAL);
assert_return((flags & ~(SD_JOURNAL_LOCAL_ONLY|SD_JOURNAL_SYSTEM)) == 0, -EINVAL);
- assert_return(
filename_is_safe
(machine), -EINVAL);
+ assert_return(
machine_name_is_valid
(machine), -EINVAL);
p = strappenda("/run/systemd/machines/", machine);
r = parse_env_file(p, NEWLINE, "ROOT", &root, "CLASS", &class, NULL);
p = strappenda("/run/systemd/machines/", machine);
r = parse_env_file(p, NEWLINE, "ROOT", &root, "CLASS", &class, NULL);