Commit Graph

47857 Commits

Author SHA1 Message Date
Martin Wilck f1cb086054 test/udev-test.pl: suppress umount error message at startup
umount emits an error message "no mount point specified" if the
tmpfs isn't mounted yet, which is the normal case.
Suppress that by redirecting stderr.
2020-11-02 11:43:15 +01:00
Martin Wilck 0ed1b64469 test/sd-script.py: new helper script for udev testing
Script for generating LOTS of SCSI disk and partition devices in
the fake sysfs we use for udev testing.

This script is supposed to be run after sys-script.py. It uses
code from sys-script.py as template to generate additional SCSI disk data
structures. Together with the "generator" code in udev-test.pl
added in the previous patch, it allows to run udev tests with almost
arbitrarily many devices, and thus to do performance scaling tests.
2020-11-02 11:43:15 +01:00
Martin Wilck eb44d715eb test/udev-test.pl: generator for large list of block devices
Manually listing all devices in the test definition becomes cumbersome with
lots of devices. Add a function that scans on all block devices in
the test sysfs and generates a list of devices to test.
2020-11-02 11:43:15 +01:00
Martin Wilck 2ab0a8d00b test/udev-test.pl: add repeat count
for easier reproduction of sporadic test failures.
2020-11-02 11:43:15 +01:00
Martin Wilck 4a0ec82daf tests/udev-test.pl: add multiple device test
Add 4 new tests using multiple devices. Number 2-4 use many
devices claiming the same symlink, where only one device has
a higher priority thatn the others. They fail sporadically with
the current code, if a race condition causes the symlink to point
to the wrong device. Test 4 is like test 2 with sleeps in between,
it's much less likely to fail.
2020-11-02 11:43:15 +01:00
Martin Wilck b95c43982a test/udev-test.pl: count "good" results
This is helpful to catch possible regressions in the test.
Also, don't count wait() errors, they are likely not udev errors.
2020-11-02 11:43:15 +01:00
Martin Wilck a96cd21d31 test/udev-test.pl: merge import parent tests into one
As we can test multiple devices and multiple links per device
in one test now, these two tests can be merged into one.
2020-11-02 11:43:15 +01:00
Martin Wilck 2084fe0d32 test/udev-test.pl: merge "space and var with space" tests
As we can check multiple links in a single test now, these 3
tests can be merged into one.
2020-11-02 11:43:15 +01:00
Martin Wilck 86634df43b test/udev-test.pl: remove bogus rules from magic subsys test
These rules have survived from an ancient version of the code
and save no purpose any more.
2020-11-02 11:43:14 +01:00
Martin Wilck 06d4d4e24e test/udev-test.pl: Make some tests a little harder
Add some rules that make it a bit harder to pass, mainly the
non-existence checks.
2020-11-02 11:43:14 +01:00
Martin Wilck 17cce03153 test/udev-test.pl: last_rule is unsupported
the "last_rule" option hasn't been supported for some time.
Therefore this test fails if a "not_exp_links" attribute is added,
as it should be. Mark it appropriately.
2020-11-02 11:43:14 +01:00
Martin Wilck 46bc71b2b7 test/udev-test.pl: fix wrong test descriptions
udev hasn't supported renaming device nodes for some time.
2020-11-02 11:43:14 +01:00
Martin Wilck e62acc3159 test/udev-test.pl: allow checking multiple symlinks
Instead of testing the existence or non-exisitence of just a single
symlink, allow testing of several links per device.

Change the test definitions accordingly.
2020-11-02 11:43:14 +01:00
Martin Wilck 997683c8f1 test/udev-test.pl: test correctness of symlink targets
Test if symlinks are created correctly by comparing the symlink
targets to the devnode path. This implies (for the symlink) that
major/minor numbers and permissions are correct, as we have tested
that on the devnode already.
2020-11-02 11:43:14 +01:00
Martin Wilck f0dccf01a7 test/udev-test.pl: use computed devnode name
More often than not, the created devnode is the basename of the
sysfs entry. The "devnode" device may be used to override the
auto-detected node name.

Permissions and major/minor number are now verified on the devnode
itself, not on symlinks.

For those tests where exp_name is set to the computed devnode name,
the explicit "exp_name" can be removed. "exp_name" is only required for
symlinks.

This allows separate testing for devnodes and symlinks an a follow-up
patch.
2020-11-02 11:43:14 +01:00
Martin Wilck 09a4062d70 test/udev-test.pl: allow concurrent additions and removals
Allow testing cases where multiple devices are added and removed
simultaneously. Tests are started as synchronously as possible using a
semaphore, in order to test possible race conditions. If this isn't desired,
the test parameter "sleep_us" can be set to the number of microseconds to wait
between udev invocations.
2020-11-02 11:43:14 +01:00
Martin Wilck af7ee3eae6 test/udev-test.pl: create rules only once
It's not necessary to write the rules for every udev run, as we
now may have many (rather than just 2) per test.
2020-11-02 11:43:14 +01:00
Martin Wilck 255c05b724 test/udev-test.pl: allow multiple devices per test
Allow testing cases where multiple devices are added and removed.
This implies a change of the data structure: every test allows
for multiple devices to be added, and "exp_name" etc. are now properties
of the device, not of the test.
2020-11-02 11:43:14 +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
Zbigniew Jędrzejewski-Szmek c062cd9dde headers: use custom LicenseRef- spdx tag for various "public domain" files
There is no spdx tag defined for those versions of "public domain", but we can
add a custom tag, see
https://spdx.github.io/spdx-spec/6-other-licensing-information-detected/.

crc32.h is updated to match crc32.c.
2020-10-29 11:41:27 +01:00
Zbigniew Jędrzejewski-Szmek 448e7440c2 headers: add spdx tags to imported files with a known license
I added the header in the cases where the license text is present and it is
easy to find the appropriate SPDX header.

For "public domain" stuff: SDPX treats each "public domain" license as unique [1],
but luckily the one in siphash24.c is one of the identified variants. There are
some other cases which specify "public domain" but there doesn't seem to be a
SPDX identifier.

[1] https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files

gunicode.[ch] are imported from glib, which is licensed as LGPL2.1+,
see https://gitlab.gnome.org/GNOME/glib/-/blob/master/glib/gunicode.h.
2020-10-29 11:32:24 +01:00
Zbigniew Jędrzejewski-Szmek 59a711c2cd time-wait-sync: drop gpl snail mail boilerplate
No idea why this chunk was left when we removed the other copies.
2020-10-29 10:47:28 +01:00
Zbigniew Jędrzejewski-Szmek 4368277c74 tree-wide: use the usual SPDX header for our own files 2020-10-29 10:47:20 +01:00
Yu Watanabe 7b6c92e6bb journalctl: drop format_journal_url() if gcrypt is not used
Follow-up for f1b823596f.
2020-10-29 00:28:28 -07:00
Luca Weiss 50f7b8fb28 Update org.freedesktop.hostname1 documentation
This documents the polkit actions for `SetDeployment()` and `SetLocation()` which previously were undocumented.
2020-10-28 22:16:57 +01:00
Zbigniew Jędrzejewski-Szmek 23b13549fa
Merge pull request #17435 from poettering/event-shuffle-refactor
sd-event: split up sd_event_source_set_enable() function
2020-10-28 18:21:13 +01:00
Zbigniew Jędrzejewski-Szmek a1989bd84b
Merge pull request #17454 from keszybz/journal-dlopen-cleanup
Journal dlopen cleanup and qrcode printing test
2020-10-28 18:20:27 +01:00
Zbigniew Jędrzejewski-Szmek 32c3a623ce
Merge pull request #17467 from keszybz/unconditionally-pull-in-cryptsetup-remote
Unconditionally pull in cryptsetup-remote.target in the initramfs
2020-10-28 18:00:04 +01:00
Timo Rothenpieler f1f1714411 networkctl: use and print full hardware address
Intentionally not checking the iftype for the ieee_oui lookup to support
other ethernet-like devices.
2020-10-28 15:18:01 +01:00
Timo Rothenpieler 14b66dbc92 dhcp4: fix DHCP on InfiniBand interfaces
With these patches applied, networkd is successfully able to get an
address from a DHCP server on an IPoIB interface.

1)
Makes networkd pass the actual interface type to the dhcp client,
instead of hardcoding it to Ethernet.

2)
Fixes some issues in handling the larger (20 Byte) IB MAC addresses in
the dhcp code.

3)
Add a new field to networkds Link struct, which holds the interface
broadcast address.

3.1)
Modify the DHCP code to also expect the broadcast address as parameter.
On an Ethernet-Interface the Broadcast address never changes and is always
all 6 bytes set to 0xFF.
On an IB one however it is not neccesarily always the same, thus
fetching the actual address from the interface is neccesary.

4)
Only the last 8 bytes of an IB MAC are stable, so when using an IB MAC to
generate a client ID, only pass those 8 bytes.
2020-10-28 14:44:43 +01:00
Timo Rothenpieler b8162cd200 network: store full hardware address in Link struct
This passes the legacy ethernet address to functions in a lot of places,
which all will need migrated to handle arbitrary size hardware addresses
eventually.
2020-10-28 14:44:43 +01:00
Timo Rothenpieler 4fc8a29a7e sd-netlink: introduce netlink_message_{read,append}_hw_addr
Hardware addresses come in various shapes and sizes, these new functions
and accomapying data structures account for that instead of hard-coding
a hardware address to the 6 bytes of an ethernet MAC.
2020-10-28 14:44:43 +01:00
Lennart Poettering 48625dc437
Merge pull request #17471 from keszybz/man-update-fedora-version
Update fedora version in man pages
2020-10-28 10:09:12 +01:00
Lennart Poettering b370adb593 resolved: advertise smaller UDP datagram size on extra stubs 2020-10-28 10:01:07 +01:00
Lennart Poettering 8facd1ce4f resolved: remove redundant conditionalization
If all protocols are listed there's no point in having the if check.

Follow-up for 8b4198373b
2020-10-28 10:01:03 +01:00
Lennart Poettering 1ed314087f resolved: use structured initialization everywhere 2020-10-28 10:00:28 +01:00
Zbigniew Jędrzejewski-Szmek a149d4a95e
Merge pull request #17455 from poettering/packet-auxdata
add Timestamping= to socket units and some other .socket unit tweaks
2020-10-27 20:20:57 +01:00
Zbigniew Jędrzejewski-Szmek c37a43d2dd
Merge pull request #17438 from anitazha/systoomd_quick
Additional fix ups from #17417
2020-10-27 18:43:34 +01:00