Anita Zhang [Wed, 19 Sep 2018 19:03:01 +0000 (12:03 -0700)]
Make Watchdog Signal Configurable
Allows configuring the watchdog signal (with a default of SIGABRT).
This allows an alternative to SIGABRT when coredumps are not desirable.
Appropriate references to SIGABRT or aborting were renamed to reflect
more liberal watchdog signals.
Closes #8658
Lennart Poettering [Wed, 26 Sep 2018 13:56:32 +0000 (15:56 +0200)]
Merge pull request #10158 from keszybz/seccomp-log-tightening
Seccomp log tightening
Lennart Poettering [Wed, 26 Sep 2018 13:37:22 +0000 (15:37 +0200)]
Merge pull request #10168 from keszybz/coverity-fixes
Coverity fixes
Patrik Flykt [Wed, 26 Sep 2018 00:09:17 +0000 (18:09 -0600)]
networkd-dhcp6: Set initial value of route to NULL
Start with route set to NULL should there be no route created. Remove
the explicit route_free as the _cleanup_ will take care of that after
the continue;.
Yu Watanabe [Tue, 25 Sep 2018 11:58:24 +0000 (20:58 +0900)]
libsystemd: add missing 'global' specifier in libsystemd.sym
William Douglas [Mon, 10 Sep 2018 19:07:29 +0000 (12:07 -0700)]
RFC tmpfiles: Allow configuration to ignore execution errors
This is an implementation that covers making errors encountered when writing
file content optionally fatal. If this is something that folks would want I'll
add handling of this for all the other directives. I'd appreciate suggestions
on how this might better be structured as well (use of a goto fail or such) as
I'm not super happy with the approach.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 17:50:49 +0000 (19:50 +0200)]
Merge pull request #10169 from poettering/putenv-error-handling
add missing putenv() error handling
Lennart Poettering [Tue, 25 Sep 2018 10:35:36 +0000 (12:35 +0200)]
Merge pull request #10088 from keszybz/man-systemctl-return
man: add a description of systemctl return codes
Lennart Poettering [Tue, 25 Sep 2018 10:34:30 +0000 (12:34 +0200)]
Merge pull request #10059 from yuwata/env-exec-directory
core: introduce $RUNTIME_DIRECTORY= or friends
Lennart Poettering [Tue, 25 Sep 2018 10:03:06 +0000 (12:03 +0200)]
exec-util: add missing logging call
This function logs about all errors, but one case was forgotten. Fix
that.
Lennart Poettering [Tue, 25 Sep 2018 10:02:26 +0000 (12:02 +0200)]
exec-util: handle putenv() errors
Just paranoia, as putenv() can fail and we should catch it, like we
catch all other errors.
Follow-up for #10073
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:34:52 +0000 (11:34 +0200)]
test-journal-syslog: initialize variable
The *priority argument to syslog_parse_priority() needs to be initialized
if the last argument (with_facility) is false.
CID #1394690.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:29:54 +0000 (11:29 +0200)]
udev-builtin-net_id: do not assume "type" attribute exists
It *should*, but who knows, let's be more defensive here.
CID #1395805.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:22:13 +0000 (11:22 +0200)]
journal-upload: fix off-by-one in assert()
CID #1394386.
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:15:27 +0000 (11:15 +0200)]
sd-event: use new cleanup function more
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 09:10:12 +0000 (11:10 +0200)]
sd-event: remove dead code and use _cleanup_
CID #1393250.
Lennart Poettering [Mon, 24 Sep 2018 17:01:37 +0000 (19:01 +0200)]
docs: clarify controller mount logic in hybrid cgroups mode
Fixes: #10107
Thiago Macieira [Mon, 24 Sep 2018 20:03:02 +0000 (13:03 -0700)]
Make bzip2 an optional dependency for systemd-importd
Yes, there are still a lot of users of bzip2, but it's fallen out of
favour after LZMA/xz, which can compress a lot more and often
decompresses faster than bzip2 too.
Lennart Poettering [Tue, 25 Sep 2018 08:24:30 +0000 (10:24 +0200)]
Merge pull request #10163 from poettering/inhibit-format-table
systemd-inhibit --list: port to format-table.c
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 08:07:23 +0000 (10:07 +0200)]
Merge pull request #10073 from xnox/execve
Execute generators with manager's environment exported
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 07:29:36 +0000 (09:29 +0200)]
DHCPv6: use unsigned for flags
Zbigniew Jędrzejewski-Szmek [Tue, 25 Sep 2018 07:24:14 +0000 (09:24 +0200)]
Merge pull request #10164 from poettering/btrfs-resize-fix
btrfs resize fix
Lennart Poettering [Mon, 24 Sep 2018 16:59:54 +0000 (18:59 +0200)]
udev: fix some type sloppiness
We use strtoul() which returns an "unsigned long", but then assign this
to int or unsigned in, i.e. drop 32bit silently on 64bit systems. Let's
clean this up a bit, and retain the right types.
Lennart Poettering [Mon, 24 Sep 2018 22:02:41 +0000 (01:02 +0300)]
logind: fix blacklist/whitelist confusion in comment (#10165)
Triggered by this:
https://github.com/systemd/systemd/commit/
602a41c22ac2df33b4b5e5083719c1cfaf58acf9#r30575293
Lennart Poettering [Mon, 24 Sep 2018 21:25:48 +0000 (00:25 +0300)]
docs: fix CONTRIBUTING path (#10160)
Lennart Poettering [Mon, 24 Sep 2018 17:47:42 +0000 (19:47 +0200)]
btrfs: log at debug log when we ignore errors
This stuff is likely to fail in many setups (for example when quota is
not supported by the btrfs version), hence only log at debug
level. Previously we'd silently ignore things altogether which makes
things pretty hard to debug.
Lennart Poettering [Mon, 24 Sep 2018 17:44:06 +0000 (19:44 +0200)]
btrfs: fix loopback resizing code
This corrects the block device to use, to the right path, as it was
before
553e15f21bd7b1ecb709edfb5686d5768fe942f2.
Replaces: #10153
Lennart Poettering [Mon, 24 Sep 2018 17:01:08 +0000 (19:01 +0200)]
update TODO
Lennart Poettering [Wed, 19 Sep 2018 18:21:45 +0000 (21:21 +0300)]
inhibit: use format-table to format systemd-inhibit --list
This changes the output a bit, as the previous multi-line output of each
inhibitor is changed to a single line, but it does unify the output look
with the one of our other tools. Moreover this adds proper sorting.
Lennart Poettering [Wed, 19 Sep 2018 17:57:42 +0000 (20:57 +0300)]
inhibit: normalize variable types
When we parse an "u" from an sd_bus_message then we need to do that into
a uint32_t, not a pid_t or uid_t, even if this is likely the same.
Also, let's count objects we keep in memory as size_t as usual.
Lennart Poettering [Wed, 19 Sep 2018 17:53:22 +0000 (20:53 +0300)]
inhibit: normalize when we log about failures to list inhibitors
let's print log messages about all types of errors inside of the
function, since otherwise we might sometimes log twice about some
specific cases.
Yu Watanabe [Sun, 23 Sep 2018 07:17:03 +0000 (16:17 +0900)]
fs-util: make symlink_idempotent() optionally create relative link
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 15:27:49 +0000 (17:27 +0200)]
Merge pull request #9989 from yuwata/sd-device-enoent
sd-device: make sd_device_get_*() return -ENOENT if the values are not set
Zbigniew Jędrzejewski-Szmek [Thu, 20 Sep 2018 12:19:41 +0000 (14:19 +0200)]
seccomp: tighten checking of seccomp filter creation
In seccomp code, the code is changed to propagate errors which are about
anything other than unknown/unimplemented syscalls. I *think* such errors
should not happen in normal usage, but so far we would summarilly ignore all
errors, so that part is uncertain. If it turns out that other errors occur and
should be ignored, this should be added later.
In nspawn, we would count the number of added filters, but didn't use this for
anything. Drop that part.
The comments suggested that seccomp_add_syscall_filter_item() returned negative
if the syscall is unknown, but this wasn't true: it returns 0.
The error at this point can only be if the syscall was known but couldn't be
added. If the error comes from our internal whitelist in nspawn, treat this as
error, because it means that our internal table is wrong. If the error comes
from user arguments, warn and ignore. (If some syscall is not known at current
architecture, it is still silently ignored.)
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 14:59:12 +0000 (16:59 +0200)]
seccomp: reduce logging about failure to add syscall to seccomp
Our logs are full of:
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldstat() / -10037, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call get_thread_area() / -10076, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call set_thread_area() / -10079, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldfstat() / -10034, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldolduname() / -10036, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call oldlstat() / -10035, ignoring: Numerical argument out of domain
Sep 19 09:22:10 autopkgtest systemd[690]: Failed to add rule for system call waitpid() / -10073, ignoring: Numerical argument out of domain
...
This is pointless and makes debug logs hard to read. Let's keep the logs
in test code, but disable it in nspawn and pid1. This is done through a function
parameter because those functions operate recursively and it's not possible to
make the caller to log meaningfully.
There should be no functional change, except the skipped debug logs.
Zbigniew Jędrzejewski-Szmek [Fri, 21 Sep 2018 12:14:45 +0000 (14:14 +0200)]
test-seccomp: log function names
Various tests produce similar output, and the function names make it
easier to see where the output is generated.
Zbigniew Jędrzejewski-Szmek [Fri, 21 Sep 2018 12:12:04 +0000 (14:12 +0200)]
test-seccomp: move two similar tests closer
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 13:15:23 +0000 (15:15 +0200)]
Merge pull request #10087 from keszybz/xnox/fix-test-functions
test/test-functions: drop all prefixes
Dimitri John Ledkov [Wed, 12 Sep 2018 18:52:30 +0000 (19:52 +0100)]
core: execute generators with manager's environmnet
Dimitri John Ledkov [Wed, 12 Sep 2018 18:51:23 +0000 (19:51 +0100)]
core: execute environment_generators with manager's environment
Dimitri John Ledkov [Wed, 12 Sep 2018 17:19:13 +0000 (18:19 +0100)]
exec-util: in execute_directories, support initial exec environment
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 11:14:06 +0000 (13:14 +0200)]
Merge pull request #10082 from porrided/udev-ipoib
Introduce predictable naming for IP-over-InfiniBand NICs
Zbigniew Jędrzejewski-Szmek [Mon, 24 Sep 2018 11:02:24 +0000 (13:02 +0200)]
Merge pull request #9981 from pfl/dhcp6_pd_other_information_quirk
DHCPv6 PD other information quirk
Yu Watanabe [Sat, 1 Sep 2018 14:13:54 +0000 (23:13 +0900)]
tree-wide: drop unnecessary initializations
Yu Watanabe [Sat, 1 Sep 2018 14:12:47 +0000 (23:12 +0900)]
tree-wide: do not assign unused return values
Yu Watanabe [Sat, 1 Sep 2018 14:09:54 +0000 (23:09 +0900)]
logind-acl: replace strdup()+set_consume() by set_put_strdup()
Yu Watanabe [Sat, 1 Sep 2018 14:07:18 +0000 (23:07 +0900)]
gpt-auto-generator: do not assign '*ret' on error
Yu Watanabe [Sat, 1 Sep 2018 14:03:22 +0000 (23:03 +0900)]
tree-wide: use streq() instead of streq_ptr()
Yu Watanabe [Sat, 1 Sep 2018 09:05:27 +0000 (18:05 +0900)]
sd-device: make sd_device_get_*() return -ENOENT if the values are not set
Yu Watanabe [Fri, 21 Sep 2018 08:10:34 +0000 (17:10 +0900)]
test-udev: use LOG_REALM_UDEV
Otherwise, even if SYSTEMD_LOG_LEVEL=debug is specified, the test does
not show most debug messages.
Yu Watanabe [Fri, 21 Sep 2018 08:45:26 +0000 (17:45 +0900)]
udevadm: show only version number for '--version' option
This effectively reverts
2bc54be485def3d1697a00209ff73ae21aa7f268
and relevant changes in #9920, as it is used to determine the version
of udev, e.g., dracut.
Fixes dracutdevs/dracut#468.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Sep 2018 21:07:48 +0000 (23:07 +0200)]
Merge pull request #10135 from yuwata/log-skipped-tests
test: add log messages when some tests are skipped
Yu Watanabe [Fri, 14 Sep 2018 06:55:15 +0000 (15:55 +0900)]
test-seccomp: add log messages when skipping tests
Yu Watanabe [Thu, 20 Sep 2018 07:09:05 +0000 (16:09 +0900)]
test-process-util: logs something when skipping tests
Yu Watanabe [Thu, 20 Sep 2018 07:38:19 +0000 (16:38 +0900)]
sd-hwdb: initialize variable
The variable 'fn' was not initialized on compat mode.
Fixes CID#1395731.
João Paulo Rechi Vita [Tue, 18 Sep 2018 22:03:54 +0000 (15:03 -0700)]
tmpfiles: Order tmpfiles-setup after journald
systemd-tmpfiles-setup.service needs to be ordered after
systemd-journald.service, so entries in /run/log/journal are already
created when systemd-tmpfiles tries to adjust its permissions.
This is specially problematic for setups using a volatile journal where
the initrd does not ship a machine-id (i.e. OSTree-based systems), where
logs from the initrd will be inaccessible for users in the
systemd-journal group. It also has a side effect of `journalctl --user`
failing with "No journal files were opened due to insufficient
permissions".
Fixes #10128.
Zbigniew Jędrzejewski-Szmek [Thu, 20 Sep 2018 07:01:58 +0000 (09:01 +0200)]
meson: fix dirname/basename confusion in meson-and-wants.sh install helper (#10126)
We would create a useless empty directory under build/.
It seems we were lucky and all symlinks were installed into directories
which were alredy created because we installed something into the same
location earlier.
While at it, also add '-v' to 'mkdir -p'. This will print the names of
directories as they are created (just once), making it easier to see all of
what the install script is doing.
Patrik Flykt [Wed, 19 Sep 2018 00:32:30 +0000 (18:32 -0600)]
networkd-manager: Fix route removals on shutdown
In order to shut down networkd properly, the delegated routes added
need to be removed properly, and as error reporting is wanted, the
network link is needed in the debug output.
Solve this by calling manager_dhcp6_prefix_remove_all(), which will
remove each prefix stored in the Manager structure, and while doing
that reference each link so that it isn't freed before the route
removal callback is called. This in turn causes the network link to
be referenced once more, and an explicit hashmap_remove() must be
called to remove the network link from the m->links hashmap.
Also, since the registered callback is not called when the DHCPv6
client is stopped with sd_dhcp6_client_stop(), an explicit call
to dhcp6_lease_pd_prefix_lost() needs to be made to clean up any
unreachable routes set up for the delegated prefixes.
Patrik Flykt [Wed, 19 Sep 2018 00:32:28 +0000 (18:32 -0600)]
networkd-manager: Update logging of route additions and removals
Log route additions and removals when the action is to be done, as
the reply rtnl message may contain only a success or failure.
Patrik Flykt [Wed, 19 Sep 2018 00:32:26 +0000 (18:32 -0600)]
sd-dhcp6-client: Reference and unreference a stored lease
In order to be able to properly free a DHCPv6 lease, unreference the
previous lease and reference the new one.
Patrik Flykt [Wed, 19 Sep 2018 00:32:23 +0000 (18:32 -0600)]
networkd-dhcp6: Remove functions whose output is not used
Remove dhcp6_reset_pd_prefix_network() that returns the network, but
whose output is not used anywhere.
Patrik Flykt [Wed, 19 Sep 2018 00:32:19 +0000 (18:32 -0600)]
networkd-dhcp6: Set one unreachable route per DHCPv6 delegated prefix
Instead of setting many small unreachable routes for each of the /64
subnets that were not distributed between the links requesting delegated
prefixes, set one unreachable route for the size of the delegated
prefix. Each subnet asssigned to a downstream link will add a routable
subnet for that link, and as the subnet assigned to the downstream link
has a longer prefix than the whole delegated prefix, the downstream
link subnet routes are preferred over the unroutable delegated one.
The unreachable route is not added when the delegated prefix is exactly
a /64 as the prefix size cannot be used to sort out the order of routing
into a bigger blocking subnet with the smaller /64 punching routable
"holes" into it.
When stopping the DHCPv6 client, the unroutable delegated prefix is
removed before the downstream link prefixes are unassigned.
Patrik Flykt [Tue, 11 Sep 2018 22:26:01 +0000 (16:26 -0600)]
dhcp6-client: Store lease timeouts T1 and T1 in client struct
Since we now have the possibility to request prefixes to be delegated
without corresponding IPv6 addresses, it does not make sense to store
lease T1 and T2 timeouts in the otherwise unused IA_NA structure.
Therefore lease timeouts T1 and T2 are moved to the DHCPv6 client
structure, as there will be only one set of stateful timeouts required
by RFC 7550, Section 4.3.
Patrik Flykt [Tue, 11 Sep 2018 17:55:38 +0000 (11:55 -0600)]
dhcp6-client: Select T1 and T2 timeouts from IA_NA and IA_PD
Select T1 and T2 timeouts based on whether addresses or prefixes were
requested and what the server offered. The address and prefix timeouts
values have been computed earlier when the relevant DHCPv6 options were
parsed.
Patrik Flykt [Fri, 7 Sep 2018 20:37:56 +0000 (14:37 -0600)]
dhcp6-lease: Add function to fetch the IAID for the prefix
Add function to fetch the IAID for the delegated IA_PD prefix. In
order to keep things simple in the implemntation, the same IAID
is used with IA_NA addresses and IA_PD prefixes. But the DHCPv6
server can choose to return only IA_PD prefixes, and the client
can nowadays omit requesting of IA_NA addresses. Since the function
fetching said IAID from the lease looks only for IA_NA ones, it
will return an empty IAID, which of course does not match the one
set for prefixes.
Fix this by adding a function returning the IAID for the prefix.
Patrik Flykt [Fri, 7 Sep 2018 20:15:55 +0000 (14:15 -0600)]
networkd-network: Introduce DHCPv6 PD knob for RFC 7084 WPD-4
RFC 7084, WPD-4, requires Customer Edge end routers to behave
according to the following:
"WPD-4: By default, the IPv6 CE router MUST initiate DHCPv6 prefix
delegation when either the M or O flags are set to 1 in a
received Router Advertisement (RA) message. Behavior of the
CE router to use DHCPv6 prefix delegation when the CE router
has not received any RA or received an RA with the M and the
O bits set to zero is out of scope for this document."
Since it cannot be automatically detected whether DHCPv6 is to be
operated as an CE end router or whether to initiate an Informational
exchange to obtain other useful network information via DHCPv6 when the
Router Advertisement 'O' bit is set, a 'ForceDHCPv6PDOtherInformation'
boolean network configuration option in the '[DHCP]' section of a is
introduced. Setting this option causes DHCPv6 to be started in stateful
mode, although only the 'O' bit is seen in the Router Advertisement.
When 'ForceDHCPv6PDOtherInformation' is set and the Router Advertisement
has only the Other information 'O' bit set, disable requests for IA_NA
addresses.
Fixes #9745.
Patrik Flykt [Fri, 7 Sep 2018 15:24:15 +0000 (09:24 -0600)]
dhcp6-client: Add tests for address, information and prefix requests
Add simple test cases to ensure the request for addresses, prefixes
and information request are handled as expected.
Patrik Flykt [Fri, 7 Sep 2018 20:00:10 +0000 (14:00 -0600)]
dhcp6-client: Function for enabling/disabling IA_NA request
Add function to enable/disable IA_NA address requests. Internally
handle the request as a bit mask and add IA_PD prefix delegation
to the same bit mask instead of having a separate boolean. Thus
the calling code can set requests for prefix and address delegation
separately. This is handy when supporting RFC 7084.
Add a check in the code that at least something is requested from
the server in Managed mode. By default request IA_NA addresses from
the DHCPv6 server. Although a value has been defined for IA_TA,
temporay IA_TA addresses are not yet requested.
Patrik Flykt [Thu, 6 Sep 2018 17:31:48 +0000 (11:31 -0600)]
dhcp6_client: Add helper for fetching Prefix Delegation information
Add helper function for fetching enabled/disabled state of Prefix
Delegation for a DHCPv6 client. Update function setting prefix
delegation to use an int instead of a boolean.
Zbigniew Jędrzejewski-Szmek [Wed, 19 Sep 2018 11:34:01 +0000 (13:34 +0200)]
Merge pull request #10113 from yuwata/unify-hwdb
hwdb,udevadm: unify duplicated code and move it to hwdb-util.c
Yu Watanabe [Tue, 18 Sep 2018 14:14:18 +0000 (23:14 +0900)]
hwdb,udevadm: also unify hwdb_query() and hwdb_test()
Yu Watanabe [Tue, 18 Sep 2018 14:09:43 +0000 (23:09 +0900)]
sd-hwdb: use structured initializers
Yu Watanabe [Tue, 18 Sep 2018 13:57:45 +0000 (22:57 +0900)]
hwdb: unify duplicated code and move it to hwdb-util.c
Both 'systemd-hwdb update' and 'udevadm hwdb --update' creates hwdb
database. The database created by systemd-hwdb containes additional
information such that priority, line number, and source filename.
The unified function 'hwdb_update()' can take a flag 'compat' which
controls the format version of created database.
Yu Watanabe [Tue, 18 Sep 2018 04:37:51 +0000 (13:37 +0900)]
sd-hwdb: adjust included headers
Yu Watanabe [Tue, 18 Sep 2018 03:50:33 +0000 (12:50 +0900)]
hwdb: use _cleanup_ attribute at one more place
Yu Watanabe [Tue, 18 Sep 2018 03:49:51 +0000 (12:49 +0900)]
hwdb: make trie_node_cleanup() can take NULL
javitoom [Wed, 19 Sep 2018 07:29:25 +0000 (09:29 +0200)]
Remove trailing space
Remove trailing space
javitoom [Mon, 17 Sep 2018 14:48:41 +0000 (16:48 +0200)]
hwdb: Add accelerometer orientation quirk for the Teclast X98 Plus I (A5C6) tablet
Add accelerometer orientation quirk for the Teclast X98 Plus I (A5C6) tablet.
Yu Watanabe [Tue, 18 Sep 2018 23:42:01 +0000 (08:42 +0900)]
nspawn: suppress one more log message when --quiet is passed
Fixes #10119.
Tony Novak [Tue, 18 Sep 2018 20:17:08 +0000 (16:17 -0400)]
Support for Kensington Expert Mouse in hwdb
Fixes #10120.
Zbigniew Jędrzejewski-Szmek [Wed, 19 Sep 2018 06:15:58 +0000 (08:15 +0200)]
Merge pull request #10112 from yuwata/typesafe-qsort
tree-wide: use typesafe_qsort() or friends
Yu Watanabe [Tue, 18 Sep 2018 23:28:50 +0000 (08:28 +0900)]
busctl,sd-lldp: explicitly specify type of argument in compare function
Several functions are shared by qsort and hash_ops or Prioq.
This makes these functions explicitly specify argument type,
and cast to __compar_fn_t where necessary.
Yu Watanabe [Tue, 18 Sep 2018 02:08:23 +0000 (11:08 +0900)]
tree-wide: use typesafe_bsearch() or typesafe_bsearch_r()
Yu Watanabe [Tue, 18 Sep 2018 02:05:20 +0000 (11:05 +0900)]
util: introduce typesafe_bsearch() and typesafe_bsearch_r()
Yu Watanabe [Mon, 17 Sep 2018 23:58:42 +0000 (08:58 +0900)]
tree-wide: use typesafe_qsort_r()
Yu Watanabe [Mon, 17 Sep 2018 23:58:21 +0000 (08:58 +0900)]
util: introduce typesafe_qsort_r()
Yu Watanabe [Mon, 17 Sep 2018 23:39:24 +0000 (08:39 +0900)]
tree-wide: use typesafe_qsort()
Arseny Maslennikov [Tue, 18 Sep 2018 10:01:46 +0000 (13:01 +0300)]
udev: Fix "strtol" -> "strtoul" for unsigned source values
Arseny Maslennikov [Tue, 18 Sep 2018 09:47:20 +0000 (12:47 +0300)]
udev: Provide a fallback for IPoIB device port numbers
In older kernels IPoIB network devices expose the port number via
the sysfs attribute 'dev_id', which is not intended to be used this way.
Let's support both options for a while.
Arseny Maslennikov [Wed, 29 Aug 2018 01:20:43 +0000 (04:20 +0300)]
udev: Disable HW-address-based naming for IB NICs
An InfiniBand network address is 20 bytes long. Only the least
significant 8 bytes can be interpreted as a persistent hardware unit
identifier; the other 12 are transiently derived at runtime from metadata
specific to the protocol stack.
However, since the network interface name length is hard-capped by
IFNAMSIZ at 16 chars and the 2-byte type prefix with '\0' at the end
leave us only at 13, we cannot squeeze a descriptive representation of a
HW address into an interface name. Thus, it makes the most sense to drop
the scheme for IPoIB interfaces entirely.
Currently udev just gets confused and does what it has been taught
to do: fetches the first six bytes and puts them into a permanent
device attribute.
Arseny Maslennikov [Wed, 29 Aug 2018 01:07:55 +0000 (04:07 +0300)]
udev: Introduce predictable naming for InfiniBand NICs
We've long neglected IP-over-InfiniBand network interfaces, let's treat
them the same way we treat anyone else.
IPoIB interfaces will retain the 'ib' prefix; otherwise the naming scheme
is the same one we use for other network interfaces. E.g. a IPoIB network
device provided by a PCI card at bus 21 slot 0 function 6 will be named
'ibp21s0f6'.
Zbigniew Jędrzejewski-Szmek [Thu, 13 Sep 2018 07:24:36 +0000 (09:24 +0200)]
detect-virt: do not try to read all of /proc/cpuinfo
Quoting https://github.com/systemd/systemd/issues/10074:
> detect_vm_uml() reads /proc/cpuinfo with read_full_file()
> read_full_file() has a file max limit size of READ_FULL_BYTES_MAX=(4U*1024U*1024U)
> Unfortunately, the size of my /proc/cpuinfo is bigger, approximately:
> echo $(( 4* $(cat /proc/cpuinfo | wc -c)))
> 9918072
> This causes read_full_file() to fail and the Condition test fallout.
Let's just read line by line until we find an intersting line. This also
helps if not running under UML, because we avoid reading as much data.
Yu Watanabe [Tue, 18 Sep 2018 14:24:58 +0000 (23:24 +0900)]
verbs: reset optind (#10116)
optind may be used in each verb, e.g., udevadm. So, let's initialize
optind before calling verbs.
Without this, e.g., udevadm -d hwdb --update causes error in parsing arguments.
Alexander Filippov [Mon, 17 Sep 2018 09:49:40 +0000 (12:49 +0300)]
core: fix the check if CONFIG_CGROUP_BPF is on
Since the commit torvalds/linux@
fdb5c4531c1e0e50e609df83f736b6f3a02896e2
the syscall BPF_PROG_ATTACH return EBADF when CONFIG_CGROUP_BPF is
turned off and as result the bpf_firewall_supported() returns the
incorrect value.
This commmit replaces the syscall BPF_PROG_ATTACH with BPF_PROG_DETACH
which is still work as expected.
Resolves openbmc/linux#159
See also systemd/systemd#7054
Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
Zbigniew Jędrzejewski-Szmek [Tue, 18 Sep 2018 09:21:59 +0000 (11:21 +0200)]
Merge pull request #10114 from yuwata/namespace-logs
namespace: log message cleanups
Yu Watanabe [Wed, 5 Sep 2018 06:12:37 +0000 (15:12 +0900)]
core/execute: do not use the negative errno when setup_namespace() returns -ENOANO
Without this, log shows meaningless error message 'No anode', e.g.,
===
Failed to unshare the mount namespace: Operation not permitted
foo.service: Failed to set up mount namespacing: No anode
foo.service: Failed at step NAMESPACE spawning /usr/bin/test: No anode
===
Follow-up for
1beab8b0d0ff2d7d1436b52d4a0c3d56dc908962.
Yu Watanabe [Mon, 3 Sep 2018 15:31:05 +0000 (00:31 +0900)]
core/namespace: add more log messages
Jon Ringle [Tue, 18 Sep 2018 03:29:36 +0000 (23:29 -0400)]
doc: Fix link to CONTRIBUTING.md (#10109)
Evgeny Vereshchagin [Sat, 15 Sep 2018 14:21:33 +0000 (14:21 +0000)]
tests: make UBSan print full backtraces
This should make it easier to get backtraces that can be
pasted into issues like https://github.com/systemd/systemd/issues/10096.
Yu Watanabe [Sun, 16 Sep 2018 14:46:58 +0000 (23:46 +0900)]
sd-device: use qsort_safe() (#10099)
The number of found devices may be zero. So, let's use qsort_safe().
Follow-up for
0a1665890cec06032a17c16206e9f519ca88446e.
Fixes #10096.