1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-12 09:17:44 +03:00
Commit Graph

49330 Commits

Author SHA1 Message Date
Yu Watanabe
eaef130d3f libudev: use hashmap_ensure_put() 2021-02-02 02:22:35 +09:00
Yu Watanabe
8b9708d1d3 sd-event: retrieve more events when epoll_wait() returns number equivalent to the buffer size
When epoll_wait() returns number equivalent to the buffer size, there
may exist remaining events which may have higher priority. To make priority
sorting correctly, let's retrieve all events.
2021-02-02 01:14:39 +09:00
Yu Watanabe
ac714078bf test: add test for udev_event_spawn() 2021-02-02 01:14:33 +09:00
Yu Watanabe
2be0218a70 udev: ignore OOM error in on_spawn_io() 2021-02-02 01:10:59 +09:00
Yu Watanabe
28a5065149 udev: use strv_split_newlines() to parse result of spawned command 2021-02-01 23:37:27 +09:00
Yu Watanabe
90d260d81f udev: add debugging logs in spawn_wait() 2021-02-01 23:37:27 +09:00
Evgeny Vereshchagin
77591e9732 oss-fuzz: show meson logs
It should help to make it more clear what causes issues like
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=30140
and https://github.com/google/oss-fuzz/pull/5084
2021-02-01 22:51:43 +09:00
Anita Zhang
934d0d023e tools: make update-dbus-docs compatible with Python 3.6
668b3a42fe allowed update-dbus-docs.py to start
running on Cent OS 8 (instead of skipping). But subprocess.check_output()'s
text argument didn't exist until Python 3.7 and C8 is still running
Python 3.6. Use universal_newlines instead for backwards compatibility.
2021-02-01 11:21:10 +00:00
Daan De Meyer
5e1f0e6fca boot: Make all efivar util functions take the guid as an argument
Let's make these functions a little more generic so we can have
them work on more than one GUID. More specifically, this allows
using them with the global guid which will be used a bit more to
extend the secure boot support.
2021-01-31 21:46:05 +00:00
Daan De Meyer
7d2ebb6f85 boot: Turn all guid constants into C99 compound initializers
Avoids having to use the address operator all the time and
avoids having to cast or do other unintuitive stuff.
2021-01-31 21:46:05 +00:00
Daan De Meyer
5021222842 boot: Enable C99
Instead of using -nostdinc, we use -nostdlib. This is necessary
to allow moving to C99 as efibind.h includes stdint.h when C99
is enabled. It isn't necessarily problematic to use some standard
library headers as long as they don't contain functions defined in
libc or another system library (or in other words, header only
headers are fine to use in sd-boot).
2021-01-31 21:46:05 +00:00
Daan De Meyer
ce0f078f4d boot: Move Secure Boot logic to new file 2021-01-31 21:46:05 +00:00
Simonas Kazlauskas
a3c5d7e95b hwdb: Add evdev for Huawei EUL-XW9
The device is very similar to MACH-WX9 in many ways, including this
particular one. Adding these rules gets rid of evdev warnings as buttons
are being pressed on this device.
2021-01-31 17:22:52 +00:00
Yu Watanabe
85cf96e3f5 log: skip reading the kernel command line if the process is invoked by a script
CLI tools may be used in a script. E.g., a script for monitoring a
service may use `systemctl`. Previously, if the kernel command line has
e.g. systemd.log-level=debug, then systemctl in the script produces
debugging logs when the script is invoked by a .service unit, but does
not when the script is running in a terminal. Then,
https://github.com/systemd/systemd/pull/18281#discussion_r561697482,
> I expect users to be (negatively) surprised.

In the previous commit, $SYSTEMD_EXEC_PID= is introduced. Then, we can
now detect whether a command is directly invoked by systemd or through
a script. Let's skip reading the kernel command line when a command is
invoked through a script.
2021-02-01 01:19:57 +09:00
Yu Watanabe
d754890843 import,home: update $SYSTEMD_EXEC_PID= if it is set
The subsequent execv() or execl() always calls tools provided by
systemd. So, it is safe to update the variable.
2021-02-01 01:19:52 +09:00
Yu Watanabe
43f565c677 core: also set $SYSTEMD_EXEC_PID= for generators 2021-02-01 01:13:44 +09:00
Yu Watanabe
cfd1c6e262 env-util: introduce env_update_systemd_exec_pid()
Will be used in later commits.
2021-02-01 01:13:44 +09:00
Yu Watanabe
2824374f95 test: use test_setup_logging() in test-env-util 2021-02-01 01:13:44 +09:00
Yu Watanabe
dc4e2940e8 core: set $SYSTEMD_EXEC_PID= environment variable for executed commands
It may be useful to detect a command is directly executed by systemd
manager, or indirectly as a child of another process.
2021-02-01 01:13:44 +09:00
Yu Watanabe
d2acb93dc5 tree-wide: enable colorized logging for daemons when run in console
It may be useful when debugging daemons.
2021-02-01 01:13:44 +09:00
Yu Watanabe
74189020eb log: make tools also read the kernel command line when run as a service
This effectively reverts 41d1f469cf.

Before this, e.g., `networkctl reload` invoked by `systemctl reload systemd-networkd.service`
does not produce debugging logs even if systemd.log-level=debug is set. This fixes
the issue.
2021-02-01 01:13:44 +09:00
Yu Watanabe
8ccc31d498 network: drop one more link_dirty()
Follow-up for 9092113d93.

link_dirty() will be called later in this function when a DNS or domain
is dropped.
2021-02-01 01:11:44 +09:00
Yu Watanabe
5caac53adb
Merge pull request #18417 from DaanDeMeyer/sd-boot-no-include
sd-boot fixes
2021-01-31 22:26:59 +09:00
Daan De Meyer
47381f8f64 sd-boot: Add missing includes
Let's make all headers self-sufficient by including the necessary
EFI headers in the headers themselves.
2021-01-31 10:38:59 +00:00
Daan De Meyer
9a383acadd sd-boot: Make internal functions static 2021-01-31 10:38:59 +00:00
Daan De Meyer
ad612eba51 resolve: Add show-multicast verb
The show-multicast verb calls the GetMulticastHosts() D-Bus method
and displays all its results formatted into a table.
2021-01-31 10:14:40 +00:00
Daan De Meyer
bc556335b1 tree-wide: Drop custom formatting for print() help messages
I think this formatting was originally used because it simplified
adding new options to the help messages. However, these days, most
tools their help message end with "\nSee the %s for details.\n" so
the final line almost never has to be edited which eliminates the
benefit of the custom formatting used for printf() help messages.
Let's make things more consistent and use the same formatting for
printf() help messages that we use everywhere else.

Prompted by https://github.com/systemd/systemd/pull/18355#discussion_r567241580
2021-01-31 13:14:02 +09:00
Pavel Hrdina
16455ee2b1 man: fix small issue in AllowedMemoryNodes description
It should not mention "CPU" but "NUMA nodes".
2021-01-30 18:19:17 +01:00
Zbigniew Jędrzejewski-Szmek
ea3640ac96
Merge pull request #18320 from yuwata/network-reduce-trigger-network-events
network: do not trigger unnecessary network events
2021-01-30 15:30:17 +01:00
Daan De Meyer
69988fee43 resolve: Add GetMulticastHosts() D-Bus method
GetMulticastHosts() returns an array of hostnames/addresses discovered via
LLMNR or Multicast DNS. It does not trigger any discovery on its own.
Instead, it simply returns whatever is already in resolved's cache.
2021-01-30 13:51:41 +00:00
Daan De Meyer
d8067d4041 mkosi: Add a postinstall script to setup .gdbinit.
systemd is compiled with relative source file paths so we need to
issue a directory command to make sure gdb can find systemd's
source files. Let's put this in a .gdbinit file so it's executed
automatically when we run gdb.
2021-01-30 13:28:34 +00:00
Einsler Lee
9c587d6618 man: make it clear how systemd calculate the DefaultTasksMax.
Actually, systemd takes the minimum of 
* a) the maximum tasks value the kernel allows on this architecture
* b) the cgroups pids_max attribute for the system
* c) the kernel's configured maximum PID value
to calculate the DefaultTasksMax. Here, kernel.thread-max should also be methioned.
2021-01-30 12:48:15 +01:00
Daan De Meyer
7a1fed85d7
Merge pull request #18407 from keszybz/resolved-reference-counting-again
Use reference counting for DnsQueryCandidate
2021-01-29 23:04:46 +00:00
Lennart Poettering
82446c66cc
Merge pull request #18399 from keszybz/man-proofreading
Various man page cleanups
2021-01-29 20:04:07 +01:00
Lennart Poettering
e01b47a500
Merge pull request #18408 from poettering/import-fixlets3
5 more small fixes to importd
2021-01-29 19:01:50 +01:00
Peter Hutterer
9fc168cd1e hwdb: check for the right set of MOUSE_WHEEL_CLICK_ properties
As documented at the top of the file we require the normal property if we have
the horizontal property, and we require the CLICK_ANGLE property if the
CLICK_COUNT property is present. Codify this into the hwdb parser so we can
pick up on it.
2021-01-29 17:17:52 +01:00
Zbigniew Jędrzejewski-Szmek
0e0fd08fc8 resolved: use reference counting for DnsQueryCandidate objects
Follow-up for 4ea8b443de. The logic that manages DnsQueryCandidate is rather
complicated: a calls to dns_query_complete() that wants to destroy a
DnsQueryCandidate can be nested inside a deep chain of calls. Using reference
counts seems like the simplest approach.

DnsSearchDomain already uses reference counting.

This patch effectively brings dns_query_candidate_go() to the state before
4ea8b443de, but wraps the iteration over DnsQueryCandidate.transactions in
dns_query_candidate_ref+dns_query_candidate_unref.
2021-01-29 17:14:15 +01:00
Zbigniew Jędrzejewski-Szmek
c805014a35 resolved: minor cleanups 2021-01-29 17:12:48 +01:00
Zbigniew Jędrzejewski-Szmek
1d3a473b4a man: use ellipses for ranges in range descriptions
… and in few other places ;)
2021-01-29 17:02:23 +01:00
Lennart Poettering
ff2f779758 import: properly verify roothash_signature + verity download, too
Follow-up for 133b34f69a where this was
forgotten.

While we are at it, bring the parameters into the same order as we
declare them in the PullRaw/PullTar objects, i.e. match them to the
canonical order.
2021-01-29 16:40:20 +01:00
Lennart Poettering
c9b6ebef8c import: make sure we can import empty files 2021-01-29 16:40:20 +01:00
Lennart Poettering
9f0b5640bd import: don't invoke compress callbacks with empty data
It's pointless if no data was generated. (This happens if an empty file
is compressed)
2021-01-29 16:40:20 +01:00
Lennart Poettering
0dfb650387 import: use unlink_and_free() + rm_rf_subvolume_and_free() more 2021-01-29 16:40:20 +01:00
Lennart Poettering
be7c98c240 import: fix typo in help text 2021-01-29 16:40:20 +01:00
Zbigniew Jędrzejewski-Szmek
0c3c9a4096
Merge pull request #18395 from bluca/make_docs_img_clean
Add Python 3.7 compat in update-dbus-docs and fix regression in integration tests 'make clean'
2021-01-29 14:07:54 +01:00
Topi Miettinen
ddc155b2fd New directives NoExecPaths= ExecPaths=
Implement directives `NoExecPaths=` and `ExecPaths=` to control `MS_NOEXEC`
mount flag for the file system tree. This can be used to implement file system
W^X policies, and for example with allow-listing mode (NoExecPaths=/) a
compromised service would not be able to execute a shell, if that was not
explicitly allowed.

Example:
[Service]
NoExecPaths=/
ExecPaths=/usr/bin/daemon /usr/lib64 /usr/lib

Closes: #17942.
2021-01-29 12:40:52 +00:00
Luca Boccassi
21be71eefb test: fix 'make clean' not removing shared image 2021-01-29 09:56:45 +00:00
Luca Boccassi
668b3a42fe tools: make update-dbus-docs compatible with Python 3.7
Debian Stable uses Python 3.7, but there are a couple of 3.8 features used
in the script. Add fallbacks.
2021-01-29 09:53:34 +00:00
Zbigniew Jędrzejewski-Szmek
75909cc7e4 man: various typos and other small issues
Fixes #18397.
2021-01-29 08:42:39 +01:00
Frantisek Sumsal
78dff3f3d7 ci: build the Fedora RPMs with -Werror 2021-01-29 11:02:54 +09:00