]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
5 years agoshared/bootspec: treat empty EFI vars as missing
Zbigniew Jędrzejewski-Szmek [Wed, 6 Mar 2019 21:45:37 +0000 (22:45 +0100)] 
shared/bootspec: treat empty EFI vars as missing

We shouldn't really make any fuss about this. Also, change 'var' to 'variable'
for consistency with systemctl.c.

5 years agoshared/bootspec: minor simplification
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 12:56:18 +0000 (13:56 +0100)] 
shared/bootspec: minor simplification

5 years agoMerge pull request #11898 from keszybz/meson-conv-lib
Lennart Poettering [Wed, 6 Mar 2019 09:46:18 +0000 (10:46 +0100)] 
Merge pull request #11898 from keszybz/meson-conv-lib

Use a convenience library for the sources shared between core/ and shutdown/

5 years agojson: log about the right line number
Lennart Poettering [Tue, 5 Mar 2019 17:11:35 +0000 (18:11 +0100)] 
json: log about the right line number

We mean the line number in the json data, not the line number in our
C source code.

Addresses: https://github.com/systemd/systemd/pull/9762#issuecomment-441183987

5 years agomeson: drop "_la_" from variable name 11898/head
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 15:22:33 +0000 (16:22 +0100)] 
meson: drop "_la_" from variable name

A left-over from libtool times.

5 years agomeson: use a convenience library for the sources shared between core/ and the outside
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 15:19:40 +0000 (16:19 +0100)] 
meson: use a convenience library for the sources shared between core/ and the outside

This avoids double compilation. Those files are tiny, so it doesn't save time,
but we avoid repeated warnings and errors, and it's generally cleaner to it
this way.

The number of commands in 'ninja -C build clean && ninja -C build' drops from
1462 to 1455 for me.

5 years agoMerge pull request #10495 from poettering/login-boot-hookup
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 19:38:41 +0000 (20:38 +0100)] 
Merge pull request #10495 from poettering/login-boot-hookup

add "systemctl reboot --boot-loader-menu=" and "systemctl reboot --boot-loader-entry="

5 years agopkgconfig: avoid double slash with split-usr configuration
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 15:46:52 +0000 (16:46 +0100)] 
pkgconfig: avoid double slash with split-usr configuration

By defining rootprefix= we avoid a double slash in $systemdsystemunitdir and
other variables. This fixes a regression introduced in
1c2c7c6cb3d92315624f3711114e86b0acfbce63 where the variables using rootprefix=/
would start with a double slash. This should be interpreted the same, but is
certainly ugly.

The rootprefix variable was added to systemd.pc in
1c2c7c6cb3d92315624f3711114e86b0acfbce63, so there is no question of backwards
compatiblity. If people try to "override" the prefix and specify
--define-variable=rootprefix=/, they will get a double slash, which should be
OK, and is the same as --define-variable=rootprefix=/something/, which also
results in a double slash somewhere in the strings.

5 years agoupdate TODO 10495/head
Lennart Poettering [Tue, 23 Oct 2018 12:17:22 +0000 (14:17 +0200)] 
update TODO

5 years agodocs: document the new environment variables logind groks
Lennart Poettering [Tue, 23 Oct 2018 13:53:18 +0000 (15:53 +0200)] 
docs: document the new environment variables logind groks

5 years agologind: refactor logic of returning polkit challenge result into its own function
Lennart Poettering [Tue, 23 Oct 2018 11:58:41 +0000 (13:58 +0200)] 
logind: refactor logic of returning polkit challenge result into its own function

Let's share some code.

5 years agosystemctl: add support for booting into boot menu/entry
Lennart Poettering [Mon, 22 Oct 2018 18:43:45 +0000 (20:43 +0200)] 
systemctl: add support for booting into boot menu/entry

(This also removes support for booting into the EFI firmware setup
without logind. That's because otherwise the non-EFI fallback logind
implements can't work.)

Fixes: #9896
5 years agologind: add support for booting into the boot menu or a specific boot menu entry
Lennart Poettering [Mon, 22 Oct 2018 18:06:52 +0000 (20:06 +0200)] 
logind: add support for booting into the boot menu or a specific boot menu entry

This behaves similar to the "boot into firmware" logic, and also allows
either direct EFI operation (which sd-boot supports and others might
support eventually too) or override through env var.

5 years agobootspec: validate bootpsec entry ids before we use them
Lennart Poettering [Mon, 4 Mar 2019 18:19:30 +0000 (19:19 +0100)] 
bootspec: validate bootpsec entry ids before we use them

5 years agobootspec: get rid of find_default_boot_entry() entirely
Lennart Poettering [Mon, 4 Mar 2019 17:02:30 +0000 (18:02 +0100)] 
bootspec: get rid of find_default_boot_entry() entirely

Now only two operations are left. Let's just move this into the caller,
since it should make things simpler, clearer and shorter, in particular
as there's only a single user for this.

5 years agobootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto()
Lennart Poettering [Mon, 4 Mar 2019 16:57:54 +0000 (17:57 +0100)] 
bootspec: rework find_default_boot_entry() to use boot_entries_load_config_auto()

it's pretty much the same code now, hence use it.

5 years agobootspec: introduce new helper boot_entries_load_config_auto()
Lennart Poettering [Mon, 4 Mar 2019 16:52:17 +0000 (17:52 +0100)] 
bootspec: introduce new helper boot_entries_load_config_auto()

It's a simple wrapper around boot_entries_load_config(), but determines
the ESP/XBOOTLDR paths automatically at first. Also, it looks for a path
/run/boot-loader-entries/ and loads the entries from there if it
exists. This is supposed to be a hook for other boot loaders to make our
tools aware of their own entries.

5 years agobootspec: correct error code shown in log msg
Lennart Poettering [Fri, 1 Mar 2019 17:38:32 +0000 (18:38 +0100)] 
bootspec: correct error code shown in log msg

5 years agobootspec: move augmentation of loader-discovered entries into bootspec.c
Lennart Poettering [Fri, 1 Mar 2019 17:35:26 +0000 (18:35 +0100)] 
bootspec: move augmentation of loader-discovered entries into bootspec.c

Previously, bootctl would show boot loader entries discovered by the
boot loader which couldn't found locally separately in the output.

Let's move this code into bootspec.c, and beef it up a bit. This way we
can use it later on for logind, and correctly show automatically
discovered windows/macos entries too.

5 years agobootspec: simplify find_default_boot_entry()
Lennart Poettering [Fri, 1 Mar 2019 16:51:15 +0000 (17:51 +0100)] 
bootspec: simplify find_default_boot_entry()

If the only caller passes NULL for the two paths, let's remove the
parameter altogether.

5 years agosystemctl: let's FORK_WAIT where we can
Lennart Poettering [Fri, 1 Mar 2019 16:48:31 +0000 (17:48 +0100)] 
systemctl: let's FORK_WAIT where we can

5 years agosystemctl: when something is not supported use EOPNOTSUPP
Lennart Poettering [Fri, 1 Mar 2019 16:47:50 +0000 (17:47 +0100)] 
systemctl: when something is not supported use EOPNOTSUPP

5 years agosystemctl: be careful with boot loader entries lacking a 'linux' line
Lennart Poettering [Fri, 1 Mar 2019 16:46:58 +0000 (17:46 +0100)] 
systemctl: be careful with boot loader entries lacking a 'linux' line

A boot loader entry might not have a 'linux' line, but an 'efi' line or
something else. Let's handle that case nicely.

5 years agobootspec: move log msg from systemctl.c to bootspec.c
Lennart Poettering [Fri, 1 Mar 2019 15:53:11 +0000 (16:53 +0100)] 
bootspec: move log msg from systemctl.c to bootspec.c

find_default_boot_entry() is only used by systemctl.c, and currently
handles one log message in the caller instead of the callee. Let's
simplify that and move it over, too

5 years agobootctl: tweak 'list' output a bit
Lennart Poettering [Fri, 1 Mar 2019 15:05:14 +0000 (16:05 +0100)] 
bootctl: tweak 'list' output a bit

Let's suppress the final newline in the list if it's the last entry we
are outputting.

5 years agologind: optionally support non-EFI reboot-to-firmware
Lennart Poettering [Mon, 22 Oct 2018 18:02:25 +0000 (20:02 +0200)] 
logind: optionally support non-EFI reboot-to-firmware

This extends the reboot-to-firmware logic in logind, so that other than
EFI firmwares could be theoretically support. The scheme is like this:
if you want to support this, set the $SYSTEMD_REBOOT_TO_FIRMWARE=1 env
var for logind. If so, this will override the EFI logic, and cause a
file /run/systemd/reboot-to-firmware file to be created when
reboot-to-firmware is requested. This file has no contents, it's mere
existance indicates a reboot with reboot-to-firmware set.

The idea is that for alternative firmwares a drop-in for logind is added
that sets the env var, in combination with some code run during shutdown
that checks for the file and does the right thing.

5 years agoefivars: extend character set that may be used in boot loader entry ids a bit
Lennart Poettering [Fri, 16 Nov 2018 17:55:51 +0000 (18:55 +0100)] 
efivars: extend character set that may be used in boot loader entry ids a bit

See https://github.com/systemd/systemd/pull/10495#discussion_r233992570

5 years agoMerge pull request #11896 from poettering/shutdown-fixes
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 14:36:03 +0000 (15:36 +0100)] 
Merge pull request #11896 from poettering/shutdown-fixes

move src/core/shutdown.c and helpers to src/shutdown/

5 years agodocs: add a note about compilation options
Zbigniew Jędrzejewski-Szmek [Tue, 5 Mar 2019 10:03:59 +0000 (11:03 +0100)] 
docs: add a note about compilation options

Closes #6371.

5 years agocore: warn if people use the undocumented/depreacted ConditionNull=
Lennart Poettering [Mon, 4 Mar 2019 16:51:54 +0000 (17:51 +0100)] 
core: warn if people use the undocumented/depreacted ConditionNull=

Triggered by:

https://github.com/systemd/systemd/issues/11812

5 years agoudev: restore debug level when logging a failure in the external prog called by IMPOR...
Franck Bui [Tue, 5 Mar 2019 10:03:07 +0000 (11:03 +0100)] 
udev: restore debug level when logging a failure in the external prog called by IMPORT{program}

It was already the case before commit a75211421fc9366068e6d9446e8e567246c72feb,
which upgraded the log to warning.

This seems an unintended side effect as the commit message doesn't mention it
and the old behavior looks more appropriate.

5 years agoshutdown: rearrange shutdown sources in source tree 11896/head
Lennart Poettering [Tue, 5 Mar 2019 11:12:33 +0000 (12:12 +0100)] 
shutdown: rearrange shutdown sources in source tree

Let's move the shutdown binary into its own subdirectory in
src/shutdown, after all it is relatively isolated from the normal PID 1
sources, being a different binary and all.

Unfortunately it's not possible to move some of the code, since it is
shared with PID 1, that I wished we could move, but I still think it's
worth it.

5 years agoshutdown: (void)ify more stuff
Lennart Poettering [Tue, 5 Mar 2019 10:53:39 +0000 (11:53 +0100)] 
shutdown: (void)ify more stuff

5 years agoshutdown: fix up return type of sync_making_progress()
Lennart Poettering [Tue, 5 Mar 2019 10:52:54 +0000 (11:52 +0100)] 
shutdown: fix up return type of sync_making_progress()

We shouldn't return negative errnos as "bool", hence fix the type of the
function to "int".

5 years agoupdate TODO
Lennart Poettering [Tue, 5 Mar 2019 10:52:32 +0000 (11:52 +0100)] 
update TODO

5 years agoMerge pull request #11881 from yuwata/networkd-vs-interface-renaming
Lennart Poettering [Tue, 5 Mar 2019 09:05:57 +0000 (10:05 +0100)] 
Merge pull request #11881 from yuwata/networkd-vs-interface-renaming

Networkd vs interface renaming

5 years agoudev: run programs in the specified order
Yu Watanabe [Mon, 4 Mar 2019 19:01:34 +0000 (04:01 +0900)] 
udev: run programs in the specified order

This fixes bugs introduced by 29448498c724da7ade1b5efb20d7472c1b128d2c
and d838e14515c82b05a07f2bf393cce057b45b2b53.

Previously, RUN and SECLABEL keys are stored in udev_list with its unique
flag is false. If the flag is false, then udev_list is just a linked
list and new entries are always added in the last.
So, we should use OrderedHashmap instead of Hashmap.

Fixes #11368.

5 years agohwdb: add touchpad resolutions for 2015-2017 MacBook(Pro)'s. (#11874)
roadrunner2 [Tue, 5 Mar 2019 07:52:22 +0000 (23:52 -0800)] 
hwdb: add touchpad resolutions for 2015-2017 MacBook(Pro)'s. (#11874)

These are all models using an SPI keyboard and touchpad and using the
same applespi kernel driver.

5 years agotravis: use /bin/systemd instead of /usr/bin/systemd
Evgeny Vereshchagin [Tue, 5 Mar 2019 04:44:11 +0000 (05:44 +0100)] 
travis: use /bin/systemd instead of /usr/bin/systemd

Apparently systemd is in /bin now.

5 years agodhcp: refuse to configure DHCP IAID if the interface is under renaming 11881/head
Yu Watanabe [Mon, 4 Mar 2019 03:20:51 +0000 (12:20 +0900)] 
dhcp: refuse to configure DHCP IAID if the interface is under renaming

systemd-networkd itself does not start dhcp client, but the code
may be used in other projects. So, check that the interface is under
renaming or not.

5 years agonetwork: do not configure interfaces under renaming
Yu Watanabe [Mon, 4 Mar 2019 03:19:05 +0000 (12:19 +0900)] 
network: do not configure interfaces under renaming

5 years agoutil: introduce device_is_renaming()
Yu Watanabe [Mon, 4 Mar 2019 03:16:46 +0000 (12:16 +0900)] 
util: introduce device_is_renaming()

It will be used in the later commit.

5 years agonetwork: always drop configs when interface is renamed
Yu Watanabe [Mon, 4 Mar 2019 03:01:26 +0000 (12:01 +0900)] 
network: always drop configs when interface is renamed

Before the renaming, wrong .network file may be assigned to the link.
So, let's always drop link configuration.

5 years agoudev: set ID_RENAMING property when interface renaming is requested
Yu Watanabe [Mon, 4 Mar 2019 02:45:58 +0000 (11:45 +0900)] 
udev: set ID_RENAMING property when interface renaming is requested

And drop the property on the corresponding 'move' uevent.

5 years agoudev: do not read UdevEvent object before checking it is non-NULL
Yu Watanabe [Tue, 5 Mar 2019 01:31:20 +0000 (10:31 +0900)] 
udev: do not read UdevEvent object before checking it is non-NULL

5 years agoudev: drop unnecessary copy of new interface name
Yu Watanabe [Mon, 4 Mar 2019 02:26:23 +0000 (11:26 +0900)] 
udev: drop unnecessary copy of new interface name

5 years agonetlink: check new interface name is valid or not before sending request
Yu Watanabe [Mon, 4 Mar 2019 02:24:33 +0000 (11:24 +0900)] 
netlink: check new interface name is valid or not before sending request

5 years agoMerge pull request #11841 from keszybz/dns-packet-speedup
Lennart Poettering [Mon, 4 Mar 2019 18:30:23 +0000 (19:30 +0100)] 
Merge pull request #11841 from keszybz/dns-packet-speedup

DNS packet speedup

5 years agoMerge pull request #11871 from yuwata/systemctl-show-format-unprintable
Lennart Poettering [Mon, 4 Mar 2019 18:04:27 +0000 (19:04 +0100)] 
Merge pull request #11871 from yuwata/systemctl-show-format-unprintable

systemctl: format many entries in 'show' command

5 years agoMerge pull request #11888 from keszybz/non-atomic
Lennart Poettering [Mon, 4 Mar 2019 18:03:46 +0000 (19:03 +0100)] 
Merge pull request #11888 from keszybz/non-atomic

Drop unused atomic operations

5 years agofuzz-dns-packet: add test case with lots of labels 11841/head
Zbigniew Jędrzejewski-Szmek [Wed, 27 Feb 2019 12:09:37 +0000 (13:09 +0100)] 
fuzz-dns-packet: add test case with lots of labels

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=13422

5 years agoresolved: when adding RR to an answer, avoid comparing keys twice
Zbigniew Jędrzejewski-Szmek [Wed, 27 Feb 2019 09:37:40 +0000 (10:37 +0100)] 
resolved: when adding RR to an answer, avoid comparing keys twice

We'd call dns_resource_record_equal(), which calls dns_resource_key_equal()
internally, and then dns_resource_key_equal() a second time. Let's be
a bit smarter, and call dns_resource_key_equal() only once.

(before)
dns_resource_key_hash_func_count=514
dns_resource_key_compare_func_count=275
dns_resource_key_equal_count=62371
4.13s user 0.01s system 99% cpu 4.153 total

(after)
dns_resource_key_hash_func_count=514
dns_resource_key_compare_func_count=276
dns_resource_key_equal_count=31337
2.13s user 0.01s system 99% cpu 2.139 total

5 years agoresolve: split the RR comparison function in two
Zbigniew Jędrzejewski-Szmek [Wed, 27 Feb 2019 09:27:35 +0000 (10:27 +0100)] 
resolve: split the RR comparison function in two

No functional change.

5 years agoresolved: use a temporary Set to speed up dns question parsing
Zbigniew Jędrzejewski-Szmek [Wed, 27 Feb 2019 06:01:50 +0000 (07:01 +0100)] 
resolved: use a temporary Set to speed up dns question parsing

This doesn't necessarily make things faster, because we still spend more time
in dns_answer_add(), but it improves the compuational complexity of this part.
If we even make dns_resource_key_equal_faster, this will become worthwhile.

5 years agosystemctl: format LogExtraFields= in 'show' command 11871/head
Yu Watanabe [Sat, 2 Mar 2019 17:48:43 +0000 (02:48 +0900)] 
systemctl: format LogExtraFields= in 'show' command

5 years agosystemctl: format BindPaths= or TemporaryFileSystems= in 'show' command
Yu Watanabe [Sat, 2 Mar 2019 17:27:04 +0000 (02:27 +0900)] 
systemctl: format BindPaths= or TemporaryFileSystems= in 'show' command

5 years agosystemctl: print RestrictAddressFamilies= in 'show' command
Yu Watanabe [Sat, 2 Mar 2019 17:06:18 +0000 (02:06 +0900)] 
systemctl: print RestrictAddressFamilies= in 'show' command

5 years agosystemctl: show nothing if no LoadError=
Yu Watanabe [Sat, 2 Mar 2019 16:59:58 +0000 (01:59 +0900)] 
systemctl: show nothing if no LoadError=

5 years agosystemctl: format IPIngressBytes= or friends nicely
Yu Watanabe [Sat, 2 Mar 2019 16:35:18 +0000 (01:35 +0900)] 
systemctl: format IPIngressBytes= or friends nicely

5 years agosystemctl: show IPAddressAllow= and IPAddressDeny= in 'show' command
Yu Watanabe [Sat, 2 Mar 2019 16:27:10 +0000 (01:27 +0900)] 
systemctl: show IPAddressAllow= and IPAddressDeny= in 'show' command

5 years agotest: add tests for test_in_addr_prefix_to_string()
Yu Watanabe [Mon, 4 Mar 2019 14:07:35 +0000 (23:07 +0900)] 
test: add tests for test_in_addr_prefix_to_string()

5 years agotest: move tests for in_addr_prefix_from_string()
Yu Watanabe [Mon, 4 Mar 2019 13:47:10 +0000 (22:47 +0900)] 
test: move tests for in_addr_prefix_from_string()

5 years agoutil: introduce in_addr_prefix_to_string()
Yu Watanabe [Sat, 2 Mar 2019 16:17:32 +0000 (01:17 +0900)] 
util: introduce in_addr_prefix_to_string()

5 years agoutil: use _cleanup_ attributes
Yu Watanabe [Sat, 2 Mar 2019 16:16:50 +0000 (01:16 +0900)] 
util: use _cleanup_ attributes

5 years agocore: fix received size of signal or status size
Yu Watanabe [Sat, 2 Mar 2019 15:35:58 +0000 (00:35 +0900)] 
core: fix received size of signal or status size

sd_bus_message_read_array() returns size of array in bytes, not number
of elements.

This also convert int to int32_t, as the dbus type 'i' is int32_t.

5 years agosd-hwdb: fix off_t vs. size_t confusion in cast 11888/head
Zbigniew Jędrzejewski-Szmek [Mon, 4 Mar 2019 14:42:58 +0000 (15:42 +0100)] 
sd-hwdb: fix off_t vs. size_t confusion in cast

> on 32bit, size_t is 32bit, but .st_size is off_t hence 64bit

5 years agosystemctl: show SuccessExitStatus= and friends
Yu Watanabe [Sat, 2 Mar 2019 15:33:28 +0000 (00:33 +0900)] 
systemctl: show SuccessExitStatus= and friends

5 years agosystemctl: use streq() if arguments must be non-NULL
Yu Watanabe [Sat, 2 Mar 2019 14:50:59 +0000 (23:50 +0900)] 
systemctl: use streq() if arguments must be non-NULL

5 years agosystemctl: do not show negative values in {Success,Failure}ActionExitStatus=
Yu Watanabe [Sat, 2 Mar 2019 14:36:51 +0000 (23:36 +0900)] 
systemctl: do not show negative values in {Success,Failure}ActionExitStatus=

5 years agobus-util: drop unnecessary re-formatting
Yu Watanabe [Sat, 2 Mar 2019 14:35:26 +0000 (23:35 +0900)] 
bus-util: drop unnecessary re-formatting

5 years agosystemctl: show SELinuxContext=, AppArmorProfile= and SmackProcessLabel=
INSUN PYO [Thu, 17 Jan 2019 06:53:13 +0000 (15:53 +0900)] 
systemctl: show SELinuxContext=, AppArmorProfile= and SmackProcessLabel=

Run: systemctl show -a dbus.service | grep -E "SELinuxContext|AppArmorProfile|SmackProcessLabel"

Before patch:
  SELinuxContext=[unprintable]
  AppArmorProfile=[unprintable]
  SmackProcessLabel=[unprintable]

After patch:
  SELinuxContext=[""|"value of context"]
  AppArmorProfile=[""|"value of context"]
  SmackProcessLabel=[""|"value of context"]

5 years agosemaphoreci: caching and more robust creation of container image
Martin Pitt [Sun, 3 Mar 2019 21:19:16 +0000 (22:19 +0100)] 
semaphoreci: caching and more robust creation of container image

lxc-create in semaphore sometimes fails with

    ERROR: Unable to fetch GPG key from keyserver

Which often happens behind proxies. As the default key server is a load
balancer, retry a few times.

Also, cache the container image between runs, and only recreate it when
it is older than a week.

5 years agotest: do not assume test-chown-rec is running as root
Davide Cavalca [Tue, 26 Feb 2019 23:11:02 +0000 (18:11 -0500)] 
test: do not assume test-chown-rec is running as root

5 years agoRemove now-unused refcnt.h
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 11:42:31 +0000 (12:42 +0100)] 
Remove now-unused refcnt.h

5 years agosd-netlink: do not use atomic reference counters
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 17:31:45 +0000 (18:31 +0100)] 
sd-netlink: do not use atomic reference counters

Same as with the other users, any non-trivial use of the objects requires
use from a single thread only or external locking. Using atomic operations
just for reference counts is not useful.

5 years agosd-hwdb: some minor logging and style updates
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 17:14:32 +0000 (18:14 +0100)] 
sd-hwdb: some minor logging and style updates

5 years agosd-hwdb: use non-atomic reference counters
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 17:04:58 +0000 (18:04 +0100)] 
sd-hwdb: use non-atomic reference counters

The sd-hwdb objects cannot be used concurrently from two threads in any
meaningful way, because query and iteration operations modify the object.
Thus atomic reference counts are pointless.

5 years agobus: make reference counting non-atomic
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 11:43:12 +0000 (12:43 +0100)] 
bus: make reference counting non-atomic

We had atomic counters, but all other operations were non-serialized. This
means that concurrent access to the bus object was only safe if _all_ threads
were doing read-only access. Even sending of messages from threads would not be
possible, because after sending of the message we usually want to remove it
from the send queue in the bus object, which would race. Let's just kill this.

5 years agotests: use the test helpers in more places
Zbigniew Jędrzejewski-Szmek [Sun, 20 Jan 2019 17:21:09 +0000 (18:21 +0100)] 
tests: use the test helpers in more places

This is mostly cosmetic. It makes those test binaries support SYSTEMD_LOG_*
environment variables.

5 years agoMerge pull request #11820 from dm0-/chase
Lennart Poettering [Mon, 4 Mar 2019 12:04:45 +0000 (13:04 +0100)] 
Merge pull request #11820 from dm0-/chase

Allow tmpfiles to create files in a root under an unprivileged directory

5 years agoMerge pull request #11770 from yuwata/fix-9955
Lennart Poettering [Mon, 4 Mar 2019 11:11:07 +0000 (12:11 +0100)] 
Merge pull request #11770 from yuwata/fix-9955

network: rework address pool

5 years agologin: HyperV requires master-of-seat to be set
Mike Lothian [Tue, 26 Feb 2019 21:24:43 +0000 (21:24 +0000)] 
login: HyperV requires master-of-seat to be set

v2: Update comment provided by Lennart

Fixes: https://github.com/systemd/systemd/issues/11299
5 years agofuzz-dhcp6-client: avoid assertion failure on samples which dont fit in pipe
Yu Watanabe [Sat, 2 Mar 2019 11:29:07 +0000 (20:29 +0900)] 
fuzz-dhcp6-client: avoid assertion failure on samples which dont fit in pipe

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=11584.

5 years agoMerge pull request #11882 from yuwata/fix-log-syntax
Lennart Poettering [Mon, 4 Mar 2019 10:03:36 +0000 (11:03 +0100)] 
Merge pull request #11882 from yuwata/fix-log-syntax

Fix log_syntax()

5 years agotest: add tests for log_syntax() 11882/head
Yu Watanabe [Mon, 4 Mar 2019 06:28:32 +0000 (15:28 +0900)] 
test: add tests for log_syntax()

5 years agolog: make log_syntax() assign correct errno and show valid error cause
Yu Watanabe [Mon, 4 Mar 2019 06:18:06 +0000 (15:18 +0900)] 
log: make log_syntax() assign correct errno and show valid error cause

5 years agoxbootldr: multiple spaces between keys and values (#11872)
Ben Iofel [Sun, 3 Mar 2019 21:51:22 +0000 (16:51 -0500)] 
xbootldr: multiple spaces between keys and values (#11872)

The example below the changed line has multiple spaces between e.g. `title` and `Fedora`

5 years agoman: flush-caches and reset-server-features are commands for resolvectl (#11877)
Yu, Li-Yu [Sun, 3 Mar 2019 21:50:22 +0000 (05:50 +0800)] 
man: flush-caches and reset-server-features are commands for resolvectl (#11877)

5 years agoMerge pull request #11472 from poettering/sd-bus-ref-tweak
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 16:52:57 +0000 (17:52 +0100)] 
Merge pull request #11472 from poettering/sd-bus-ref-tweak

try harder to detect when a bus and its queued messages are fully unreffed and free everything then

5 years agoMerge pull request #11863 from poettering/subvol-no-submount
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 15:44:40 +0000 (16:44 +0100)] 
Merge pull request #11863 from poettering/subvol-no-submount

nspawn: don't descend into subvols on --ephemeral

5 years agoman: document that --ephemeral and --template= don't cover submounts 11863/head
Lennart Poettering [Fri, 1 Mar 2019 14:14:36 +0000 (15:14 +0100)] 
man: document that --ephemeral and --template= don't cover submounts

We never made this clear, let's fix that.

5 years agobtrfs: when falling back to plain copy when snapshoting exclude submounts
Lennart Poettering [Fri, 1 Mar 2019 14:13:12 +0000 (15:13 +0100)] 
btrfs: when falling back to plain copy when snapshoting exclude submounts

The subvol snapshot logic doesn't cover sub-mounts either, and it really
shouldn't in the general case, hence let's simply stop at submounts in
all cases, both in the main and in the fall-back codepath.

As discussed here:

https://github.com/systemd/systemd/pull/11243#pullrequestreview-209477230

5 years agoMerge pull request #11243 from poettering/nspawn-root-overlay
Zbigniew Jędrzejewski-Szmek [Fri, 1 Mar 2019 15:08:55 +0000 (16:08 +0100)] 
Merge pull request #11243 from poettering/nspawn-root-overlay

add systemd-nspawn --volatile=overlay support, as well as the same for host systems

5 years agotest: add test for new sd-bus refcnt logic 11472/head
Lennart Poettering [Thu, 17 Jan 2019 18:45:12 +0000 (19:45 +0100)] 
test: add test for new sd-bus refcnt logic

5 years agosd-bus: use "queue" message references for managing r/w message queues in connection...
Lennart Poettering [Thu, 17 Jan 2019 17:31:59 +0000 (18:31 +0100)] 
sd-bus: use "queue" message references for managing r/w message queues in connection objects

Let's make use of the new concept the previous commit added.

See: #4846

5 years agobus-message: introduce two kinds of references to bus messages
Lennart Poettering [Thu, 17 Jan 2019 17:18:54 +0000 (18:18 +0100)] 
bus-message: introduce two kinds of references to bus messages

Before this commit bus messages had a single reference count: when it
reached zero the message would be freed. This simple approach meant a
cyclic dependency was typically seen: a message that was enqueued in a
bus connection object would reference the bus connection object but also
itself be referenced by the bus connection object. So far out strategy
to avoid cases like this was: make sure to process the bus connection
regularly so that messages don#t stay queued, and at exit flush/close
the connection so that the message queued would be emptied, and thus the
cyclic dependencies resolved. Im many cases this isn't done properly
however.

With this change, let's address the issue more systematically: let's
break the reference cycle. Specifically, there are now two types of
references to a bus message:

1. A regular one, which keeps both the message and the bus object it is
   associated with pinned.

2. A "queue" reference, which is weaker: it pins the message, but not
   the bus object it is associated with.

The idea is then that regular user handling uses regular references, but
when a message is enqueued on its connection, then this takes a "queue"
reference instead. This then means that a queued message doesn't imply
the connection itself remains pinned, only regular references to the
connection or a message associated with it do. Thus, if we end up in the
situation where a user allocates a bus and a message and enqueues the
latter in the former and drops all refs to both, then this will detect
this case and free both.

Note that this scheme isn't perfect, it only covers references between
messages and the busses they are associated with. If OTOH a bus message
is enqueued on a different bus than it is associated with cyclic deps
cannot be recognized with this simple algorithm, and thus if you enqueue
a message associated with a bus A on a bus B, and another message
associated with bus B on a bus A, a cyclic ref will be in effect and not
be discovered. However, given that this is an exotic case (though one
that happens, consider systemd-bus-stdio-bridge), it should be OK not to
cover with this, and people have to explicit flush all queues on exit in
that case.

Note that this commit only establishes the separate reference counters
per message. A follow-up commit will start making use of this from the
bus connection object.

5 years agosd-bus: always go through sd_bus_unref() to free messages
Lennart Poettering [Thu, 17 Jan 2019 20:07:42 +0000 (21:07 +0100)] 
sd-bus: always go through sd_bus_unref() to free messages

Don't try to be smart, don't bypass the ref counting logic if there's no
real reason to.

This matters if we want to tweak the ref counting logic later.

5 years agosd-bus: drop two inappropriate empty lines
Lennart Poettering [Thu, 17 Jan 2019 17:18:18 +0000 (18:18 +0100)] 
sd-bus: drop two inappropriate empty lines

5 years agosd-bus: make sure dispatch_rqueue() initializes return parameter on all types of...
Lennart Poettering [Thu, 17 Jan 2019 17:15:37 +0000 (18:15 +0100)] 
sd-bus: make sure dispatch_rqueue() initializes return parameter on all types of success

Let's make sure our own code follows coding style and initializes all
return values on all types of success (and leaves it uninitialized in
all types of failure).

5 years agosd-bus: reorder bus ref and bus message ref handling
Lennart Poettering [Thu, 17 Jan 2019 17:14:17 +0000 (18:14 +0100)] 
sd-bus: reorder bus ref and bus message ref handling

Let's always place handling of these references together, so that all
reference counting during allocation is at a single place.