Commit graph

14 commits

Author SHA1 Message Date
Harald Hoyer 7fd1b19bc9 move _cleanup_ attribute in front of the type
http://lists.freedesktop.org/archives/systemd-devel/2013-April/010510.html
2013-04-18 09:11:22 +02:00
Zbigniew Jędrzejewski-Szmek d3b6d0c21e fileio: in envfiles, do not skip lines following empty lines
https://bugs.freedesktop.org/show_bug.cgi?id=63477
2013-04-13 20:24:39 -04:00
Zbigniew Jędrzejewski-Szmek 844ec79b3c catalog: open up catalog internals
In order to write tests for the catalog functions, they
are made non-static and start taking a 'database' parameter,
which is the name of a file with the preprocessed catalog
entries.

This makes it possible to make test-catalog part of the
normal test suite, since it now only operates on files
in /tmp.

Some more tests are added.
2013-03-28 23:45:59 -04:00
Zbigniew Jędrzejewski-Szmek 18cd5fe99f catalog: make sure strings are terminated
Coverity complains: systemd-199/src/journal/catalog.c:126:
buffer_size_warning: Calling strncpy with a maximum size argument of
32 bytes on destination array "i->language" of size 32 bytes might
leave the destination string unterminated.

...and unfortunately it was right. The string was defined as a
fixed-size string in some parts of the code, and used a
null-terminated string in others (e.g. in log statements). There's no
point in conserving one byte, so just define the max language tag
length to 31 bytes, and use null terminated strings everywhere.

Also, wrap some lines, zero-fill less bytes, use '\0' instead of just
0 to be more explicit that this is one byte.
2013-03-28 23:45:59 -04:00
Lukas Nykryn 464264ac5a catalog: fix error codes handling in catalog_list_items
Previously r was set to zero and so if(r<0) was never true.
2013-03-27 12:46:36 -04:00
Lukas Nykryn 2e8fb7026d log: fix error codes handling in catalog_list_items
It does not make sense to print error code from previous loop.
2013-03-27 12:01:44 -04:00
Zbigniew Jędrzejewski-Szmek 54b7254c1f journalct: beef up entry listing
The ability to dump catalog entries in full and by id is added.
2013-03-19 21:50:43 -04:00
Kay Sievers 7850b3b837 shared: conf-files - add root parameter 2013-02-08 10:23:04 +01:00
Zbigniew Jędrzejewski-Szmek 4ec24515da journal: use $(localstatedir)/lib/systemd/catalog for the catalog
The path doesn't change in the standard configuration.

Also, give full path to the journalctl binary in the hook,
since it might be installed outside of $PATH.

Also, add uninstall hook to remove the binary catalog.
2012-11-16 23:29:18 +01:00
Zbigniew Jędrzejewski-Szmek 943aad8ca5 journal, shared: fix warnings during compilation on 32 bits
Some filesystem magics are too big to fit in 31 bits,
and are wrapped to negative. f_type is an int on 32 bits, so
it is signed, and we get a warning on comparison.
2012-11-16 23:26:44 +01:00
Kay Sievers 7c670f5b44 journal: catalog - silent output, it's usually only called by package management 2012-11-16 19:34:53 +01:00
Zbigniew Jędrzejewski-Szmek 80343dc19a journalctl: better error messages for --update-catalog
Also add informational message about catalog size.
2012-11-16 10:46:50 +01:00
Lennart Poettering 83f6936a01 journal: extend catalog header to 64bit for all fields, just to be safe and follow the rest of the file formats 2012-11-16 01:35:11 +01:00
Lennart Poettering d4205751d4 journal: implement message catalog
The message catalog can be used to attach short help texts to log lines,
keyed by their MESSAGE_ID= fields. This is useful to help the
administrator understand the context and cause of a message, find
possible solutions and find further related documentation.

Since this is keyed off MESSAGE_ID= this will only work for native
journal messages.

The message catalog supports i18n, and is useful to augment english
language system messages with explanations in the local language.

This commit only includes short explanatory messages for a few example
message IDs, we'll add more complete documentation for the relevant
systemd messages later on.
2012-11-15 23:09:07 +01:00