1
0
mirror of https://github.com/systemd/systemd.git synced 2025-01-27 18:04:05 +03:00

33690 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
889e396046 shared/logs-show: export show_journal()
This is a nice function to output some journal entries without much ado.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
9b972c9aab journal: rename output_journal to show_journal_entry
We have show_journal, and output_journal, and it's not immediately clear
how they related. Rename the first to show that it just prints one entry.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
fd4885df94 journal: allow writing journal files even if machine-id is missing
The code to open journal files seems like the wrong place to enforce this. We
already check during boot and refuse to boot if machine-id is missing, no need
to enforce this here. In particular, it seems better to write logs from
journald even if they are not completely functional rather than refuse to
operate at all, and systemd-journal-remote also writes journal files and may
even be run on a system without systemd at all.

The docker image that oss-fuzz uses has an empty /etc/machine-id. Obviously
this is an error in the docker, but docker is fact of life, and it seems better
for systemd-journal-remote to work in such an incomplete environment.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
ea03f6ba0d sd-id128: return -ENOMEDIUM on null id
We currently return -ENOMEDIUM when /etc/machine-id is empty, and -EINVAL when
it is all zeros. But -EINVAL is also used for invalid args. The distinction
between empty and all-zero is not very important, let's use the same return
code.

Also document -ENOENT and -ENOMEDIUM since they can be a bit surprising.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
63e2ebcdaa fuzz-journal-remote: allow fuzzer to be built without µhttpd
journal-remote still requires µhttpd, but things are easier if the fuzzer
can be built without.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
40c10d3f00 shared/dissect-image: avoid warning about unused function when compiled w/o blkid 2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
757ed4fd2e log-generator: make message size configurable, add short options
Also remove "b''" from the generated MESSAGE= field.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
864876ec0f journal-remote: export handle_raw_source() 2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
c064d8db40 journal-remote: split out µhttpd support and main() into a separate file
This is in preparation to reusing the RemoteServer in other concepts.
I tried to keep changes to minimum:
- arg_* global variables are now passed as state in RemoteServer
- exported functions get the "journal_remote_" prefix
- some variables are renamed

In particular, there is an ugly global RemoveServer* variable. It was originally
added because µhttpd did not allow state to be passed to the callbacks. I'm not
sure if this has been remediated in µhttpd, but either way, this is not changed
here, the global variable is only renamed for clarity.
2018-05-31 13:04:18 +02:00
Zbigniew Jędrzejewski-Szmek
5d889c1365 journal: rewrap function args 2018-05-31 13:04:18 +02:00
Lennart Poettering
642b59ff40
Merge pull request #9115 from yuwata/rfe-8491
locale: re-read configuration files if necessary
2018-05-31 11:54:01 +02:00
Lennart Poettering
309ee4c26c
Merge pull request #9144 from yuwata/sysusers-spec
sysusers: support specifier expansion for GECOS and home directory
2018-05-31 11:41:29 +02:00
Lennart Poettering
49f733c053
Merge pull request #9131 from poettering/memory-startswith
add new memory_startswith() helper and make use of it everywhere
2018-05-31 11:21:43 +02:00
Lennart Poettering
4a0dbb8129
Merge pull request #9083 from yuwata/empty-assignment
load-fragment: make many settings accept empty string
2018-05-31 11:13:52 +02:00
Yu Watanabe
4156e767f6 locale: assume locale is for LANG= when variable name is not specified
Closes #6070.
2018-05-31 17:57:41 +09:00
Lennart Poettering
6696e2a631 smack: make mac_smack_fix() deal somewhat sensible with non-absolute paths
This tries to improve the mac_smack_fix() logic a bit, by properly
handling non-absolute paths.

It's still pretty broken though, which is sad for security technology:
non-normalized paths (for example "/usr/../dev/sda") will still not be
treated correctly. I am not sure how to fix that properly though, and I
don't understand SMACK well enough to do so. This fix hence just fixes
to most obvious glaring issue.
2018-05-31 10:50:50 +02:00
Lennart Poettering
a8d1b2422d
Merge pull request #9142 from yuwata/coverity-fixes
Coverity fixes
2018-05-31 10:50:10 +02:00
Yu Watanabe
b613b01920 doc: update TODO 2018-05-31 17:39:13 +09:00
Yu Watanabe
33ab22fcb9 man: mention that systemd-sysusers understand the specifier. 2018-05-31 17:37:57 +09:00
Yu Watanabe
b8bed70068 sysusers: support specifier expansion for GECOS and home directory fields 2018-05-31 17:36:22 +09:00
Yu Watanabe
df4fd2c757 locale: re-read configuration files if changed
Closes #8491.
2018-05-31 16:24:45 +09:00
Yu Watanabe
6a837b035f locale: use _cleanup_free_ and free_and_replace 2018-05-31 16:17:18 +09:00
Yu Watanabe
fe28d88746 locale: check xkb data before requesting authentication 2018-05-31 16:16:25 +09:00
Yu Watanabe
b47ff73b18 locale: return earlier if no operation will be done 2018-05-31 16:15:21 +09:00
Yu Watanabe
17ee3d72da load-fragment: use free_and_replace() 2018-05-31 13:27:06 +09:00
Yu Watanabe
3c381a671f load-fragment: add missing oom check
Fixes CID#1391379.
2018-05-31 13:26:27 +09:00
Yu Watanabe
66c9dfdddc portable: fix memleak
Fixes CID#1391382.
2018-05-31 13:16:51 +09:00
Yu Watanabe
7be9df7d4a core/socket: fix coding style 2018-05-31 11:09:41 +09:00
Yu Watanabe
535775805a load-fragment: move macro-defined config parsers 2018-05-31 11:09:41 +09:00
Yu Watanabe
984faf29da load-fragment: use DEFINE_CONFIG_PARSE_*() macros 2018-05-31 11:09:41 +09:00
Yu Watanabe
e405b67d23 load-fragment: make IPTOS= accept the empty string 2018-05-31 11:09:41 +09:00
Yu Watanabe
00463fbf0d load-fragment: make SocketProtocol= accept the empty string 2018-05-31 11:09:41 +09:00
Yu Watanabe
fa65c28176 namespace: rename parse_protect_{home,system}_or_bool() to protect_{home,system}_or_bool_to_string()
Hence, we can define config_parse_protect_{home,system}() by using
DEFINE_CONFIG_PARSE_ENUM() macro.
2018-05-31 11:09:41 +09:00
Yu Watanabe
b54e98ef8e socket-util: rename parse_socket_address_bind_ipv6_only_or_bool() to socket_address_bind_ipv6_only_or_bool_from_string()
Hence, we can define config_parse_socket_bind() by using
DEFINE_CONFIG_PARSE_ENUM() macro.
2018-05-31 11:09:41 +09:00
Yu Watanabe
2d1729ca3f conf-parser: introduce DEFINE_CONFIG_PARSE*() macros
This introduces several macros for defining config parsers.
Also this fixes errno in DEFINE_CONFIG_PARSE_ENUM() and _ENUMV()
and makes the log level lower when a duplicated item is
specified to the settings parsed by the function defined by
DEFINE_CONFIG_PARSE_ENUMV().
2018-05-31 11:09:41 +09:00
Yu Watanabe
0a9e363870 load-fragment: drop config_parse_no_new_privileges() and use config_parse_bool() instead 2018-05-31 11:09:41 +09:00
Yu Watanabe
862fcffd9c load-fragment: make WorkingDirectory= accept the empty string 2018-05-31 11:09:41 +09:00
Yu Watanabe
fb27be3f60 load-fragment: use parse_sec_fix_0() instead of updating the value later 2018-05-31 11:09:41 +09:00
Yu Watanabe
6c58305ac3 load-fragment: use config_parse_sec_fix_0() for TimeoutStopSec= 2018-05-31 11:09:41 +09:00
Yu Watanabe
71e270150f load-fragment: always include config_parse_warn_compat() in the table used by unit_dump_config_items() 2018-05-31 11:09:41 +09:00
Yu Watanabe
47544ea1cb load-fragment: drop unused function config_parse_sysv_priority() 2018-05-31 11:09:41 +09:00
Yu Watanabe
b00e1a9e2a load-fragment: make CPUSchedulingPolicy= accept the empty string 2018-05-31 11:09:41 +09:00
Yu Watanabe
617d253afa load-fragment: make IOScheduling{Class,Priority}= accept the empty string 2018-05-31 11:09:41 +09:00
Yu Watanabe
de5e6038ca load-fragment: setting empty string to Nice= resets the previous assignments 2018-05-31 11:09:41 +09:00
Jared Kazimir
18944130b0 hwdb: consolidate multiple razer evdev sections 2018-05-31 00:59:07 +02:00
Lennart Poettering
4afae2a820
Merge pull request #9132 from poettering/sd-bus-slot-set-floating
make sure we don't leak bus slots when sd_bus_add_match_async() is used
2018-05-31 00:58:41 +02:00
Sergio Lindo Mansilla
c2f32f616b Fix pattern to detect distribution
With operator '=', when in /etc/os-release:
ID_LIKE="opensuse suse" # Tumbleweed since at least 2018-04-24
or
ID_LIKE="suse opensuse" # Leap 15
2018-05-30 18:13:14 +02:00
Lennart Poettering
fc2d4c89b8 sd-bus: make add match method callback slot "floating"
When we allocate an asynchronous match object we will allocate an
asynchronous bus call object to install the match server side.
Previously the call slot would be created as regular slot, i.e.
non-floating which meant installing the match even if it was itself
floating would result in a non-floating slot to be created internally,
which ultimately would mean the sd_bus object would be referenced by it,
and thus never be freed.

Let's fix that by making the match method callback floating in any case
as we have no interest in leaving the bus allocated beyond the match
slot.

Fixes: #8551
2018-05-30 17:34:34 +02:00
Lennart Poettering
7ae497b936 bus-slot: for bus slot objects with no explicit description use the match string as description
Let's make debugging a but easier with implicit descriptions for some
match objects.
2018-05-30 17:34:34 +02:00
Lennart Poettering
1004b2c7bc man: document the new sd_bus_slot_set_floating() call
Also extend the memory management description of sd-bus highlighting the
effect of "floating" slot objects a bit.
2018-05-30 17:34:34 +02:00