b26fa1a2fbcfee7d03b0c8fd15ec3aa64ae70b9f |
|
10-Feb-2016 |
Daniel Mack <daniel@zonque.org> |
tree-wide: remove Emacs lines from all files
This should be handled fine now by .dir-locals.el, so need to carry that
stuff in every file. |
cf0fbc49e67b55f8d346fc94de28c90113505297 |
|
16-Nov-2015 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
tree-wide: sort includes
Sort the includes accoding to the new coding style. |
eb3da9012f462da2451edeb8d67c5b67c833a0b1 |
|
13-Nov-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: optionally, when writing a string to a file, verify string on failure
With this change, the idiom:
r = write_string_file(p, buf, 0);
if (r < 0) {
if (verify_one_line_file(p, buf) > 0)
r = 0;
}
gets reduced to:
r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE);
i.e. when writing the string fails and the new flag
WRITE_STRING_FILE_VERIFY_ON_FAILURE is specified we'll not return a
failure immediately, but check the contents of the file. If it matches
what we wanted to write we suppress the error and exit cleanly. |
b5efdb8af40ea759a1ea584c1bc44ecc81dd00ce |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out allocation calls into alloc-util.[ch] |
6bedfcbb2970e06a4d3280c8fb62083d252ede73 |
|
27-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split string parsing related calls from util.[ch] into parse-util.[ch] |
3ffd4af22052963e7a29431721ee204e634bea75 |
|
25-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split out fd-related operations into fd-util.[ch]
There are more than enough to deserve their own .c file, hence move them
over. |
07630cea1f3a845c09309f197ac7c4f11edd3b62 |
|
24-Oct-2015 |
Lennart Poettering <lennart@poettering.net> |
util-lib: split our string related calls from util.[ch] into its own file string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files. |
c4cd1d4d93e4a45a088edb6517555aa7e06e5f86 |
|
30-Sep-2015 |
Aaro Koskinen <aaro.koskinen@nokia.com> |
fileio: make get_status_field() more generic
All users of get_status_field() expect the field pattern to occur in
the beginning of a line, and the delimiter is ':'.
Hardcode this into the function, and also skip any whitespace before ':'
to support fields in files like /proc/cpuinfo. Add support for returning
the full field value (currently stops on first whitespace).
Rename the function so it's easier to ensure all callers switch to new
semantics. |
4c1fc3e404d648c70bd2f50ac50aeac6ece8872e |
|
07-Jul-2015 |
Daniel Mack <daniel@zonque.org> |
fileio: consolidate write_string_file*()
Merge write_string_file(), write_string_file_no_create() and
write_string_file_atomic() into write_string_file() and provide a flags mask
that allows combinations of atomic writing, newline appending and automatic
file creation. Change all users accordingly. |
40beecdb6d1c73e5acb62ebac2ccbfd7891f2418 |
|
06-Jul-2015 |
Daniel Mack <daniel@zonque.org> |
fileio: add 'enforce_newline' argument to write_string_stream()
Add a flag to control whether write_string_stream() should always enforce a
trailing newline character in the file. |
0b452006de98294d1690f045f6ea2f7f6630ec3b |
|
10-Apr-2015 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
shared: add process-util.[ch] |
039f0e70a0fcd71dcf7cc2f3ba2cea2e3b186a60 |
|
23-Dec-2014 |
Lennart Poettering <lennart@poettering.net> |
env-util: don't include files from src/core/ |
cda134ab1eac84f874aacf8e885a07112a7fd5ce |
|
07-Nov-2014 |
Lennart Poettering <lennart@poettering.net> |
copy: teach copy_bytes() sendfile() support, and then replace sendfile_full() by it |
696c24fced77b152dda45f0bdbcf6411849bd8ab |
|
05-Nov-2014 |
Tom Gundersen <teg@jklm.no> |
test: fileio - make coverity happy
Explicitly check the length of the read.
Fixes CID#1250803. |
e07995a3e23cdadb8a24d47de03f1a3d319763f9 |
|
31-Oct-2014 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
tests: add tests for fileio.c
add tests for the following functions:
- write_string_file_no_create
- load_env_file_pairs |
7491ccf2cb237a2a88b831b2c7374ba2bb255cba |
|
17-Oct-2014 |
Lukas Nykryn <lnykryn@redhat.com> |
environment: append unit_id to error messages regarding EnvironmentFile |
bdf7026e9557349cd3eeb291c01655d5f2a55db8 |
|
04-Oct-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
test: only use assert_se
The asserts used in the tests should never be allowed to be
optimized away |
2b01a801f6c597a60a1e622978bf7ac0105b9666 |
|
30-Sep-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
test-fileio: Remove dead check
t cannot be null here |
76082570b8115c3410bac42bb5842ba201dddb76 |
|
18-Sep-2014 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
tests: fix resource & mem leaks |
cca0efb0477f9bb7d61b48ba270b885b29c0bb72 |
|
16-Sep-2014 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
test: silence a coverity report
We check the actual contents of the file on the line after but we
might as well also check the number of bytes read here.
Found by coverity. Fixes: CID#1237521 |
0709b743749c42f54ffc0d9aeacf7bff45d65af6 |
|
18-Aug-2014 |
Ronny Chevalier <chevalier.ronny@gmail.com> |
tests: add tests for fileio.c
add tests for:
- write_string_stream
- write_string_file
- sendfile_full |
717603e391b52983ca1fd218e7333a1b9dfc5c05 |
|
03-Jul-2014 |
Lennart Poettering <lennart@poettering.net> |
machinectl: show /etc/os-release information of container in status output |
2d5bdf5bc0e4714d42e5999a4e37553a6bf83575 |
|
28-Jan-2014 |
Lennart Poettering <lennart@poettering.net> |
always use the same code for creating temporary files
Let's unify our code here, and also always specifiy O_CLOEXEC. |
5fba7bbfa47ef5c03a28000252d06ec82405d461 |
|
12-Dec-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
scan-build: silence some warnings
test-fileio/test-strv:
Use the streq_ptr to make build-scan not worry about passing in a null
to a nonnull function.
test-dhcp-option:
Prevent a theoretical null pointer dereference |
d514feaa872820d5cb4e9321ad32673c09fbb3f4 |
|
12-Dec-2013 |
Thomas Hindoe Paaboel Andersen <phomes@gmail.com> |
test-fileio: replace mktemp with mkstemp to avoid warnings
This is a fairly useless thing to do but it makes the compilers
and analyzers shut up about the use of mktemp. |
1e5413f74faa378172d556e5dec35ab55de16bbf |
|
19-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Add more tests and fix capability logging |
d8a110034690bbe50e15455be4427c42dcd59dc6 |
|
17-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
test-fileio: assume that Buffers may be missing |
442e00839e4fc3c11506f5c8a9477b465865aecc |
|
16-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Assume that /proc/meminfo can be missing
Travis tests are failing, probably because /proc/meminfo is not available
in the test environment. The same might be true in some virtualized systems,
so just treat missing /proc/meminfo as a sign that hibernation is not
possible. |
69ab80881552d5f79ca95f6b3be48ad122ab1ec2 |
|
14-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Advertise hibernation only if there's enough free swap
Condition that is checked is taken from upower:
active(anon) < free swap * 0.98
This is really stupid, because the kernel knows the situation better,
e.g. there could be two swap files, and then hibernation would be
impossible despite passing this check, or the kernel could start
supporting compressed swap and/or compressed hibernation images, and
then this this check would be too stringent. Nevertheless, until
we have something better, this should at least return a true negative
if there's no swap.
Logging of capabilities in the journal is changed to not strip leading
zeros. I consider this more readable anyway.
http://cgit.freedesktop.org/upower/tree/src/up-daemon.c#n613
https://bugzilla.redhat.com/show_bug.cgi?id=1007059 |
ac4c8d6da8b5ebc35f02c9c6cb7595be7b134a05 |
|
12-Sep-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
Allow tabs in environment files
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 |
095b30cbf976b6c82a10c16bef76fa5b4c03f658 |
|
30-Jul-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
test-fileio: use random name for written file
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. |
68fee104e630eb19f04b8196a83c14c2c9c469e7 |
|
26-Jul-2013 |
Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> |
journalctl: use _COMM= match for scripts
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. |
98f59e59e0c31ffcb953d3a7dba0da5e6f2f55f7 |
|
18-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
fileio.c: do not parse comments after non-whitespace chars
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 |
ebc05a09ad6d1672cf4f426ee4252cf495daa139 |
|
17-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
core/execute: report invalid environment variables from files
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. |
db5372091664c977a937f6bc0fe4484363be0669 |
|
17-Apr-2013 |
Harald Hoyer <harald@redhat.com> |
fileio:parse_env_file_internal() fix environment file parsing
parse_env_file_internal() could not parse the following lines correctly:
export key="val"
key="val"#comment |
768100efd57ffbbefe9beaa33d1dd5ecc7f69173 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
fileio: write proper env var write-out code
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. |
f73141d7657b3f60b8669bc8386413d8a8a372c6 |
|
03-Apr-2013 |
Lennart Poettering <lennart@poettering.net> |
shared: rework env file reader
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. |