Commit Graph

47721 Commits

Author SHA1 Message Date
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
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 81823e6c12771721e9a729f6280a9de26fd70bad:
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
Zbigniew Jędrzejewski-Szmek 9887369972 Partially revert "hwdb: reindent commments and say that "*" should always be trailing"
This partially reverts commit 62ad1c6495.

I kept the reindents and other cosmetic changes, but removed the statements
about trailing ":*".
2020-11-03 15:02:52 +01:00
Zbigniew Jędrzejewski-Szmek a21ac934a1 Revert "parse_hwdb: enforce the ":*" suffix"
This reverts commit ad2d8e61ee.
2020-11-03 14:26:51 +01:00
Rasmus Villemoes 3d2b1fa473 strv.c: simplify strv_new_ap
Instead of duplicating the code for x and the varargs, handle them all the same
way by using for loops.
2020-11-03 14:26:08 +01:00
Rasmus Villemoes bd8e699c27 signal-util: make sigaction_many_ap a little more concise
There's no reason to duplicate the stop condition sig < 0, nor the sigaction()
call.
2020-11-03 14:26:08 +01:00
Rasmus Villemoes 6ced0770c7 string-util: improve overflow checking
The current overflow checking is broken in the corner case of the strings'
combined length being exactly SIZE_MAX: After the loop, l would be SIZE_MAX,
but we're not testing whether the l+1 expression overflows.

Fix it by simply pre-accounting for the final '\0': initialize l to 1 instead
of 0.
2020-11-03 14:26:08 +01:00
Rasmus Villemoes 020003f235 string-util: simplify logic in strjoin_real()
The loops over (x, then all varargs, until a NULL is found) can be written much
simpler with an ordinary for loop. Just initialize the loop variable to x, test
that, and in the increment part, fetch the next va_arg(). That removes a level
of indentation, and avoids doing a separate strlen()/stpcpy() call for x.

While touching this code anyway, change (size_t)-1 to the more readable
SIZE_MAX.
2020-11-03 14:25:28 +01:00
Zbigniew Jędrzejewski-Szmek 3a7771c9c4 Partially revert "hwdb: add trailing ":*" everywhere"
This reverts commit c0443b97b7.

I got various cases wrong:
"usb:v04F3p2B7Cd5912dc00dsc00dp00ic03isc00ip00in00"
"usb:v0627p0001:QEMU USB Tablet"
"input:b0003v0627p0001e0001-e0,1,2,4,k110,111,112,r0,1,8,B,am4,lsfw"

OTOH:
-evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnASUSTeKComputerInc.:pnN53SV:*
+evdev:name:ETPS/2 Elantech Touchpad:dmi:*svnASUSTeKComputerInc.:pnN53SV*
is OK. Other parts follow after 'pn'.

-mouse:*:name:*Trackball*:*
-mouse:*:name:*trackball*:*
-mouse:*:name:*TrackBall*:*
+mouse:*:name:*Trackball*:
+mouse:*:name:*trackball*:
+mouse:*:name:*TrackBall*:
... and anything else with :name should be OK too, because our imports always
include ":" at the end:
IMPORT{builtin}="hwdb 'joystick:$env{ID_BUS}:v$attr{id/vendor}p$attr{id/product}:name:$attr{name}:'"
Including '*' at the end makes the pattern work even if we decide to add
something to the match string later.

Fixes #17499.
2020-11-03 14:17:53 +01:00
Lennart Poettering d3dcf4e3b9 fileio: beef up READ_FULL_FILE_CONNECT_SOCKET to allow setting sender socket name
This beefs up the READ_FULL_FILE_CONNECT_SOCKET logic of
read_full_file_full() a bit: when used a sender socket name may be
specified. If specified as NULL behaviour is as before: the client
socket name is picked by the kernel. But if specified as non-NULL the
client can pick a socket name to use when connecting. This is useful to
communicate a minimal amount of metainformation from client to server,
outside of the transport payload.

Specifically, these beefs up the service credential logic to pass an
abstract AF_UNIX socket name as client socket name when connecting via
READ_FULL_FILE_CONNECT_SOCKET, that includes the requesting unit name
and the eventual credential name. This allows servers implementing the
trivial credential socket logic to distinguish clients: via a simple
getpeername() it can be determined which unit is requesting a
credential, and which credential specifically.

Example: with this patch in place, in a unit file "waldo.service" a
configuration line like the following:

    LoadCredential=foo:/run/quux/creds.sock

will result in a connection to the AF_UNIX socket /run/quux/creds.sock,
originating from an abstract namespace AF_UNIX socket:

    @$RANDOM/unit/waldo.service/foo

(The $RANDOM is replaced by some randomized string. This is included in
the socket name order to avoid namespace squatting issues: the abstract
socket namespace is open to unprivileged users after all, and care needs
to be taken not to use guessable names)

The services listening on the /run/quux/creds.sock socket may thus
easily retrieve the name of the unit the credential is requested for
plus the credential name, via a simpler getpeername(), discarding the
random preifx and the /unit/ string.

This logic uses "/" as separator between the fields, since both unit
names and credential names appear in the file system, and thus are
designed to use "/" as outer separators. Given that it's a good safe
choice to use as separators here, too avoid any conflicts.

This is a minimal patch only: the new logic is used only for the unit
file credential logic. For other places where we use
READ_FULL_FILE_CONNECT_SOCKET it is probably a good idea to use this
scheme too, but this should be done carefully in later patches, since
the socket names become API that way, and we should determine the right
amount of info to pass over.
2020-11-03 09:48:04 +01:00
Lennart Poettering ff640bd2e1 update TODO 2020-11-02 15:30:16 +01:00
Muhammet Kara cf45341d11 po: Update Turkish translation 2020-11-02 12:41:39 +01:00
Purushottam choudhary 92b555aaab network: selinux hook handling to enumerate nexthop
When selinux is enabled, the call of
manager_rtnl_enumerate_nexthop() fails.

This fix is to facilitate selinux hook handling for enumerating
nexthop.

In manager_rtnl_enumerate_nexthop() there is a check
if "Not supported" is returned by the send_netlink() call.

This check expects that -EOPNOTSUPP is returned,
the selinux hook seems to return -EINVAL instead.

This happens in kernel older than 5.3
(more specificallytorvalds/linux@65ee00a) as it does not support
nexthop handling through netlink.

And if SELinux is enforced in the order kernel, callingRTM_GETNEXTHOP
returns -EINVAL.

Thus adding a call in the manager_rtnl_enumerate_nexthop for the
extra return -EINVAL.
2020-11-01 23:28:21 +09:00
Sorin Ionescu d008666aca Fix typo 2020-11-01 23:26:16 +09:00
Lennart Poettering acd156d197 automount: make user unmounting for automount units more debuggable
Let's add an explicit log message plus an error state for automount
units, if users explicitly unmounted our autofs mount.

Prompted by: #17448
2020-10-30 13:10:42 +01:00
Lennart Poettering bfeb927a55 pid1: various minor watchdog modernizations
Just some clean-ups.
2020-10-30 13:02:06 +01:00
Yu Watanabe 819a555bc5
Merge pull request #17399 from afq984/udev-escaped-string
Allow escaped string in udev rules
2020-10-30 09:52:45 +09:00
Zbigniew Jędrzejewski-Szmek 58f848148f
Merge pull request #17444 from BtbN/fix_ib_dhcp4
networkd: fix DHCP on InfiniBand interfaces
2020-10-29 19:27:29 +01:00
Zbigniew Jędrzejewski-Szmek e61f999755
Merge pull request #17472 from keszybz/spdx-license-headers
More SPDX license headers
2020-10-29 19:05:05 +01:00
Zbigniew Jędrzejewski-Szmek ae7e5d2037
Merge pull request #17476 from poettering/resolved-tweaks
three small resolved cleanups
2020-10-29 18:58:56 +01:00
Hans de Goede ac6a1b9017 hwdb: Add accel orientation quirk for Predia Basic tablet
Add a quirk to fix the accelerometer orientation on the
Predia Basic tablet.
2020-10-29 17:41:24 +01:00
Yu, Li-Yu bc117ec359 document udev escaped string in udev(7) 2020-10-29 22:57:00 +08:00
Yu, Li-Yu c32d562da5 udev: add fuzzer for udev_rule_parse_value 2020-10-29 20:19:29 +08:00
Yu, Li-Yu 9abfd759d2 udev: test udev_rule_parse_value() 2020-10-29 20:19:29 +08:00
Yu, Li-Yu aea3253e71 udev: escaped string syntax e"..." in rule files
* Existing valid rule files written with KEY="value" are not affected
* Now, KEY=e"value\n" becomes valid. Where `\n` is a newline character
* Escape sequences supported by src/basic/escape.h:cunescape() is
  supported
2020-10-29 20:15:23 +08:00