summaryrefslogtreecommitdiff
path: root/src/test/test-fileio.c
AgeCommit message (Collapse)Author
2013-09-11Allow tabs in environment filesZbigniew Jędrzejewski-Szmek
bash allows them, and so should we. string_has_cc is changed to allow tabs, and if they are not wanted, they must be now checked for explicitly. There are two other callers, apart from the env file loaders, and one already checked anyway, and the other is changed to check. https://bugs.freedesktop.org/show_bug.cgi?id=68592 https://bugs.gentoo.org/show_bug.cgi?id=481554
2013-07-30test-fileio: use random name for written fileZbigniew Jędrzejewski-Szmek
If two instances of test-fileio were run in parallel, they could fail when trying to write the same file. This predictable name in /tmp/ wasn't actually a security issue, because write_env_file would not follow symlinks, so this could be an issue only when running tests in parallel.
2013-07-26journalctl: use _COMM= match for scriptsZbigniew Jędrzejewski-Szmek
In case of scripts, _EXE is set to the interpreter name, and _COMM is set based on the file name. Add a match for _COMM, and _EXE if the interpreter is not a link (e.g. for yum, the interpreter is /usr/bin/python, but it is a link to /usr/bin/python2, which in turn is a link to /usr/bin/python2.7, at least on Fedora, so we end up with _EXE=/usr/bin/python2.7). I don't think that such link chasing makes sense, because the final _EXE name is more likely to change.
2013-04-18fileio.c: do not parse comments after non-whitespace charsHarald Hoyer
systemd does not want to understand comments after the first non-whitespace char occured. key=foo #comment will result into key == "foo #comment" key="foo" #comment will result into key == "foo#comment" "key= #comment" will result into key == "#comment" "key #comment" is an invalid line
2013-04-17core/execute: report invalid environment variables from filesHarald Hoyer
Because "export key=val" is not supported by systemd, an error is logged where the invalid assignment is coming from. Introduce strv_env_clean_log() to log invalid environment assignments, where logging is possible and allowed. parse_env_file_internal() is modified to allow WHITESPACE in keys, to report the issues later on.
2013-04-17fileio:parse_env_file_internal() fix environment file parsingHarald Hoyer
parse_env_file_internal() could not parse the following lines correctly: export key="val" key="val"#comment
2013-04-03fileio: write proper env var write-out codeLennart Poettering
This will properly escape all weird chars when writing env var files. With this in place we can now read and write environment files where the values contain arbitrary weird chars. This enables hostnamed and suchlike to finally properly save pretty host names with backlashes or quotes in them.
2013-04-03shared: rework env file readerLennart Poettering
Implement this with a proper state machine, so that newlines and escaped chars can appear in string assignments. This should bring the parser much closer to shell.