1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
Commit Graph

47764 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
b5c474f69b libsystemd-network: add comment explaining unusual memory access
Inspired by coverity CID#1435984. I'm confused by the union definion every time I look at it...
Let's at least add a comment to help future readers.
2020-11-10 15:52:32 +01:00
Zbigniew Jędrzejewski-Szmek
44ee03d111 tree-wide: unsetenv cannot fail
... when called with a valid environment variable name. This means that
any time we call it with a fixed string, it is guaranteed to return 0.
(Also when the variable is not present in the environment block.)
2020-11-10 15:52:32 +01:00
Zbigniew Jędrzejewski-Szmek
063f9f0da9 basic/env-util: add little helper to call setenv or unsetenv 2020-11-10 15:48:14 +01:00
Zbigniew Jędrzejewski-Szmek
55c540d39f sd-event: minor modernization
With this change the pattern used for epoll_ctl() is the same in all calls in
this file. Consistency FTW!
2020-11-10 14:19:20 +01:00
Zbigniew Jędrzejewski-Szmek
ac9f2640cb sd-event: increase n_enabled_child_sources just once
Neither source_child_pidfd_register() nor event_make_signal_data() look at
n_enabled_child_sources.
2020-11-10 14:19:20 +01:00
Zbigniew Jędrzejewski-Szmek
d2eafe61ca sd-event: update state at the end in event_source_enable
Coverity in CID#1435966 was complaining that s->enabled is not "restored" in
all cases. But the code was actually correct, since it should only be
"restored" in the error paths. But let's still make this prettier by not setting
the state before all operations that may fail are done.

We need to set .enabled for the prioq reshuffling operations, so move those down.

No functional change intended.
2020-11-10 14:18:47 +01:00
Zbigniew Jędrzejewski-Szmek
b8aac5014c
Merge pull request #17431 from msekletar/udev-link-update-race
udev: make algorithm that selects highest priority devlink less susceptible to race conditions
2020-11-10 09:41:57 +01:00
Yu Watanabe
6272aef5ff sd-bus: drop redundant abs()
strerror_safe() internally applies abs().
2020-11-10 09:24:34 +01:00
Yu Watanabe
72585a584d core: add missing oom check
Fixes #17552.
2020-11-10 09:22:43 +01:00
Zbigniew Jędrzejewski-Szmek
d61db498bf udev: log when we fail to query ID_NET_DRIVER
Inspired by #17532.
2020-11-10 09:18:53 +01:00
Zbigniew Jędrzejewski-Szmek
a1b24ee147
Merge pull request #17551 from yuwata/radv-router-lifetime
network: about router lifetime
2020-11-09 21:07:16 +01:00
Yu Watanabe
2075e596cf network: convert router lifetime from usec_t to uint16_t 2020-11-10 00:04:52 +09:00
Yu Watanabe
dd1b187075 sd-radv: refuse to set preference except medium when router lifetime is zero 2020-11-10 00:04:52 +09:00
Yu Watanabe
ac138551ce sd-radv: router lifetime is uint16_t 2020-11-10 00:04:52 +09:00
Yu Watanabe
71a5db49fd network: make default router lifetime to 30min
Closes #17527.
2020-11-10 00:04:42 +09:00
Lennart Poettering
df80c98cde
Merge pull request #17549 from yuwata/tiny-fixes
tiny fixes
2020-11-09 16:04:01 +01:00
Zbigniew Jędrzejewski-Szmek
c5b6b4b6d0
Merge pull request #17548 from yuwata/license-update
License: LGPL-2.1+ -> LGPL-2.1-or-later, and GPL-2.0+ -> GPL-2.0-or-later
2020-11-09 09:34:31 +01:00
Yu Watanabe
601844b71d core: reduce scope of variants
Fixes #17543.
2020-11-09 14:40:05 +09:00
Yu Watanabe
291bb0b01c sd-bus: fix possible division by 0
Fixes #17541.
2020-11-09 14:33:19 +09:00
Yu Watanabe
755b35b1aa home: fix copy-and-paste mistake
Fixes #17542.
2020-11-09 14:00:16 +09:00
Yu Watanabe
f13467ec23 license: GPL-2.0+ -> GPL-2.0-or-later 2020-11-09 13:25:50 +09:00
Yu Watanabe
db9ecf0501 license: LGPL-2.1+ -> LGPL-2.1-or-later 2020-11-09 13:23:58 +09:00
fwSmit
21d8f2533d
hwdb: Add support for HP ZBook Studio G5 keyboard (#17525)
I tested this on my ZBook Studio G5. I'm not sure if this works for other ZBook studio machines.

I have two more notes on this PR:
- some keys send multiple scancodes. I matched only on one of them, because I couldn't figure out how to match
on all of them. This results in the others still being visible:
Event: time 1604520228.146226, -------------- SYN_REPORT ------------
Event: time 1604520228.151533, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1604520228.151533, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 1
Event: time 1604520228.151533, -------------- SYN_REPORT ------------
Event: time 1604520228.259862, type 4 (EV_MSC), code 4 (MSC_SCAN), value 38
Event: time 1604520228.259862, type 1 (EV_KEY), code 56 (KEY_LEFTALT), value 0
Event: time 1604520228.259862, -------------- SYN_REPORT ------------
Event: time 1604520228.259944, type 4 (EV_MSC), code 4 (MSC_SCAN), value 66
Event: time 1604520228.259944, type 1 (EV_KEY), code 218 (KEY_CONNECT), value 0
Event: time 1604520228.259944, -------------- SYN_REPORT ------------
Event: time 1604520228.266513, type 4 (EV_MSC), code 4 (MSC_SCAN), value db
Event: time 1604520228.266513, type 1 (EV_KEY), code 125 (KEY_LEFTMETA), value 0
Event: time 1604520228.266513, -------------- SYN_REPORT ------------
 
I wanted to set the display key to switchvideomode, but another key is already set to that, so I set it to displaytoggle instead.
2020-11-07 12:20:03 +01:00
Lennart Poettering
eaa269484b resolved: fix non-initialized memory access
Fix for bug introduced in 1ed314087f.
2020-11-06 13:58:20 -08:00
Lennart Poettering
2386d1c1d3
Merge pull request #17534 from poettering/resolved-more-tweaks
seven smaller resolved tweaks
2020-11-06 22:39:09 +01:00
Lennart Poettering
76f772298e resolved: slightly extend debug log output about outgoing messages 2020-11-06 14:43:05 +01:00
Lennart Poettering
088648d081 resolved: don't resolve "local." via LLMNR
It's the mDNS top-level domain, hence don't consider it for LLMNR, ever.

Fixes: #16233
2020-11-06 14:43:01 +01:00
Lennart Poettering
dc194dce80 resolved: add comments for various query flags 2020-11-06 14:42:56 +01:00
Lennart Poettering
5cdcac6cf6 resolved: show all answer flags when dumping answer 2020-11-06 14:42:53 +01:00
Lennart Poettering
032b398224 resolved: add minor optimization path to dns_answer_merge() 2020-11-06 14:42:49 +01:00
Lennart Poettering
02c205359b resolved: suppress misleading debug message about ignored resolv.conf line 2020-11-06 14:42:45 +01:00
Lennart Poettering
8d50c14252 errno: ETIMEDOUT is also a connection error 2020-11-06 14:42:18 +01:00
Michal Sekletár
30f6dce62c udev: make algorithm that selects highest priority devlink less susceptible to race conditions
Previously it was very likely, when multiple contenders for the symlink
appear in parallel, that algorithm would select wrong symlink (i.e. one
with lower-priority).

Now the algorithm is much more defensive and when we detect change in
set of contenders for the symlink we reevaluate the selection. Same
happens when new symlink replaces already existing symlink that points
to different device node.
2020-11-06 13:35:05 +01:00
Michal Sekletár
a59b0a9f76 basic/stat-util: make mtime check stricter and use entire timestamp
Note that st_mtime member of struct stat is defined as follows,

 #define st_mtime st_mtim.tv_sec

Hence we omitted checking nanosecond part of the timestamp (struct
timespec) and possibly would miss modifications that happened within the
same second.
2020-11-06 12:28:40 +01:00
Ronan Pigott
ea394d48cc journalctl: show boot id in the reboot context separator 2020-11-06 12:17:03 +01:00
Jian-Hong Pan
f25e30dec4 hwdb: Fix Pinebook Pro's brightness up/down and sleep keys
Pinebook Pro's display brightness up & down keys do not work until the
keys are mapped to the corresponding codes.

Also, the sleep key is mapped to KEY_POWER code originally. This quirk
maps the sleep key to the KEY_SLEEP code.

This idea comes from the pinebookpro-post-install package [1] of Manjaro
ARM, which is the preloaded OS on Pinebook Pro.

[1]: 7ab1a134ea
2020-11-06 10:50:40 +01:00
Lennart Poettering
ce8f6d478e seccomp: allow turning off of seccomp filtering via env var
Fixes: #17504

(While we are it, also move $SYSTEMD_SECCOMP_LOG= env var description
into the right document section)

Also suggested in: https://github.com/systemd/systemd/issues/17245#issuecomment-704773603
2020-11-05 20:22:19 +01:00
Lennart Poettering
d72ff2df1c update TODO 2020-11-04 18:00:56 +01:00
Zbigniew Jędrzejewski-Szmek
961b341e85 selinux: also try the netlink-based fallback and continue on permission error
Fedora Rawhide still has the old policy, so selinux prevents our selinux code
from checking if selinux is enabled. But it seems smart to fall back to the old
API anyway.

Follow-up for fd5e402fa9.

Both the reference policy [1] and Fedora selinux policy [2] needed to be
updated, so it's likely that this will impact other distros too.

[1] https://github.com/SELinuxProject/refpolicy/pull/308
[2] https://github.com/fedora-selinux/selinux-policy/pull/464
2020-11-04 09:49:53 +01:00
Topi Miettinen
ae5e9bf46f shared/seccomp-util: move stime() to @obsolete
Quoting the manual page of stime(2): "Starting with glibc 2.31, this function
is no longer available to newly linked applications and is no longer declared
in <time.h>."
2020-11-04 09:48:33 +01:00
Zbigniew Jędrzejewski-Szmek
04bd604fb9 sd-login: fix parsing in sd_uid_is_on_seat
Bug introduced in 81823e6c12:
logind uses spaces not commas to separate items.
2020-11-04 09:46:59 +01:00
Zbigniew Jędrzejewski-Szmek
585d7a893e
Merge pull request #17521 from poettering/resolved-more-fixes
six fixes to resolved
2020-11-04 09:38:09 +01:00
Zbigniew Jędrzejewski-Szmek
ac5e2729c6
Merge pull request #17517 from keszybz/revert-hwdb-trailing-colon
Revert hwdb trailing colon
2020-11-04 09:26:31 +01:00
Zbigniew Jędrzejewski-Szmek
24309e6683
Merge pull request #17493 from Villemoes/va-arg-simplifications
Some vararg simplifications
2020-11-04 09:22:15 +01:00
Lennart Poettering
2f4c2db20a resolved: handle RRs where we don't have a signer
If we encounter an RR that has no matching signature, then we don't know
whether it was expanded from a wildcard or not. We need to accept that
and not make the NSEC test fail, just skip over the RR.
2020-11-03 20:36:02 +01:00
Lennart Poettering
de4a0138e7 resolved: drop unused family argument from manager_routable() 2020-11-03 20:35:09 +01:00
Lennart Poettering
014e8cc131 resolved: fix dumping of DnsAnswer objects 2020-11-03 20:35:09 +01:00
Lennart Poettering
398c611833 resolved: put size limit in DnsAnswer size to UINT16_MAX
The three answer sections can only carry up to UINT16_MAX entries, hence
put a hard upper limit on how far DnsAnswer can grow. The three count
fields in the DNS packet header are 16 bit only, hence the limit.

If code actually tries to add more than 64K RRs it will get ENOSPC with
this new checking.

And similar to DnsQuestion.
2020-11-03 20:35:04 +01:00
Lennart Poettering
a63a1252b5 resolved: check return value of memdup() correctly for OOM 2020-11-03 20:05:46 +01:00
Lennart Poettering
8b2e362651 man: remove misplaced comma 2020-11-03 20:05:46 +01:00