Commit graph

38303 commits

Author SHA1 Message Date
Yu Watanabe 64242fd307 core/dbus-service: empty assignment to PIDFile= resets the value
Follow-up for a9353a5c5b.
2019-02-06 17:58:52 +01:00
Yu Watanabe c79d66fc7e core/dbus-service: write PIDFile= setting to transient unit file
Follow-up for a9353a5c5b.
2019-02-06 17:58:40 +01:00
Yu Watanabe b8055c05e2 core/load-fragment: empty assignment to PIDFile= resets the value
Follow-up for a9353a5c5b.
2019-02-06 17:58:24 +01:00
Yu Watanabe 67577508d8 curl-util: fix use after free
This fixes a bug introduced by c3e658004a.
2019-02-06 16:19:02 +01:00
Yu Watanabe 9b5b4bed17 pull: fix invalid error check
This fixes a bug introduced by 0d94088e4e.
2019-02-06 16:18:01 +01:00
Yu Watanabe e327272d79 test-network: ignore tunnel devices automatically added by kernel
Fixes #10934.
2019-02-06 22:04:32 +09:00
Susant Sahani 93b4dab57e networkd: Allow to retain configs even if carrier is lost
When there is bad link in the network the carrier goes up/down.
This makes networkd stops all the clients and drop config.
But if the remote router/dhcpserver running a prevention
of DHCP Starvation attack or DHCP Flood attack it does not allow
networkd to take a DHCP lease resulting failure in configuration.
This patch allows to keep the client running and keep the conf
also for this scenario.

Closes #9111
2019-02-06 13:35:11 +01:00
Yu Watanabe 23bedfbc32 bash-completion: busctl: add 'emit' command support 2019-02-06 13:30:53 +01:00
Yu Watanabe 0747cde76c busctl: shorten code a bit by using SYNTHETIC_ERRNO() 2019-02-06 13:30:53 +01:00
Yu Watanabe 143aea3813 busctl: introduce 'emit' command to emit a signal
Closes #11622.
2019-02-06 13:30:48 +01:00
Yu Watanabe 9ecb11f55d busctl: re-indent help message
Preparation for the next commit.
2019-02-06 13:29:11 +01:00
Frantisek Sumsal 2b3943a02b
Merge pull request #11656 from yuwata/test-network-routing-policy-rule-check-kernel
test-network: check port range and ipproto attributs are supported by kernel and ip command
2019-02-06 11:14:11 +01:00
Yu Watanabe d586a2c30c test-network: check port range and ipproto attributes are supported by kernel and ip command 2019-02-06 10:18:23 +01:00
Yu Watanabe 9ffb90964f test: add a test case for issue #11652 2019-02-06 08:43:34 +01:00
Yu Watanabe 5ce41697bd sd-device: fix device_copy_properties()
This fixes a bug introduced by a3ce813697.

Fixes #11652.
2019-02-06 08:36:52 +01:00
Zbigniew Jędrzejewski-Szmek 23cfbcc35e test-sizeof: print the alignments too 2019-02-05 18:56:41 +01:00
Zbigniew Jędrzejewski-Szmek 3c7dddaccf efivars: remove direct access to unaligned structure members
Most of the accesses *were* aligned. The only one that definetely wasn't was to
drive_path->part_start and drive_path->part_size, because those both expect
8 byte alignment, and are at offsets 4 and 12 in the packed structure.

Because of the way that device_path structure is defined and used, we expect
that device_path.length is always two-byte aligned.

This adds asserts in various places to ensure the proper alignment, and uses
memcpy in other places where the alignment might be off.
2019-02-05 18:15:00 +01:00
Zbigniew Jędrzejewski-Szmek f7cb1c7900 efivars: make sure that _packed_ structure members are actually aligned as expected
When looking for the terminating double-NUL, don't just read the memory
until the terminator is found, but use the information we got about the
buffer size.

The length parameter passed to utf16_to_utf8() would include the terminator, so
the converted string would end up with two terminators (the original one
converted to "utf8", still 0, and then the one that was always added anyway).
Instead let's pass just the length of the actual data to utf16_to_utf8().
2019-02-05 17:25:08 +01:00
Mantas Mikulėnas 6d6308f677 udevadm info: "-a" should enumerate sysfs attributes, not envs (#11642)
This fixes a bug introduced by 13aca84769.
2019-02-05 06:30:49 +02:00
Zbigniew Jędrzejewski-Szmek c92ab239a0 test-resolve: increase timeout to 120s
The test queries some domain names. If the DNS servers are unreachable,
e.g. in a rawhide container I get the total runtime of 24.5s usually, but
sometimes slightly longer, enough to reach the default timeout of 30s.
2019-02-04 20:32:44 +01:00
Zbigniew Jędrzejewski-Szmek 62353f69cc journal: drop _packed_ attribute in a few places
The justification is the safe as for the grandparent commit.
2019-02-04 20:32:44 +01:00
Zbigniew Jędrzejewski-Szmek 6b68c26824 test-util: drop _packed_ attribute
gcc-9 warns:
../src/test/test-util.c:147:19: note: in expansion of macro ‘container_of’
  147 |         assert_se(container_of(&myval.v1, struct mytype, v1) == &myval);
      |                   ^~~~~~~~~~~~

I don't think packing matters here for the test of container_of(), so let's
just remove it.
2019-02-04 20:32:44 +01:00
Zbigniew Jędrzejewski-Szmek e27b9aba30 libsystemd-network: remove _packed_ attribute to appease the compiler
gcc-9 warns whenever the elements of a structure defined with _packed_ are used:

../src/network/networkd-dhcp6.c: In function ‘dhcp6_pd_prefix_assign’:
../src/network/networkd-dhcp6.c:92:53: warning: taking address of packed member of ‘struct <anonymous>’ may result in an unaligned pointer value [-Waddress-of-packed-member]
   92 |         r = manager_dhcp6_prefix_add(link->manager, &p->opt.in6_addr, link);
      |                                                     ^~~~~~~~~~~~~~~~

And the compiler is right, because in principle the alignment could be wrong.
In this particular case it is not, because the structure is carefully defined
not to have holes. Let's remove _packed_ and use compile-time asserts to verify
that the offsets are not changed.
2019-02-04 20:32:44 +01:00
Yu Watanabe 95832a0f8c analyze security: fix recursive call of syscall_names_in_filter()
When `syscall_names_in_filter()` is called in itself, it is already
examined with `whitelist`. Or, in other words, `syscall_names_in_filter()`
returns bad or good in boolean. So, the returned value should not be
compared with `whitelist` again.

This replaces #11302.
2019-02-04 16:01:38 +01:00
Дамјан Георгиевски 6f61b14d53 portable: document /etc/machine-id and /etc/resolv.conf
… requirement for portable service images.

systemd will mount the host machine-id and resolv.conf at these
locations, so for read-only images these must exist in the image,
because they can't be created.
2019-02-04 15:59:41 +01:00
Jonathan McDowell 16a81874e0 hwdb: Add support for Gemini NC14 keyboard 2019-02-04 11:04:34 +01:00
Yu Watanabe 19df01f529 machinectl: fix argument index in error log
Fixes #11628.
2019-02-04 11:03:58 +01:00
Lennart Poettering b858d7d9d2
Merge pull request #11641 from ffontaine/master
fix build without BRIDGE_VLAN_INFO_RANGE_END or IFA_F_NOPREFIXROUTE
2019-02-04 11:02:54 +01:00
Lennart Poettering c38dbeaad2
Merge pull request #11621 from yuwata/man-ref-systemd-system-conf
man: add and fix references
2019-02-04 10:46:45 +01:00
Christian Hesse a579d42a24 NEWS fix boolean value for meson options
Valid boolean values for meson are 'true' and 'false',
not 'yes' and 'no'.
2019-02-04 10:43:04 +01:00
Thomas Haller 51c682df38 hashmap: always set key output argument of internal_hashmap_first_key_and_value()
internal_hashmap_first_key_and_value() returns the first value, or %NULL
if the hashmap is empty.

However, hashmaps may contain %NULL values. That means, a caller getting
%NULL doesn't know whether the hashmap is empty or whether the first
value is %NULL.

For example, a caller may be tempted to do something like:

    if ((val = hashmap_steal_first_key_and_value (h, (void **) key))) {
         // process first entry.
    }

But this is only correct if the caller made sure that the hash is either
not empty or contains no NULL values.

Anyway, since a %NULL return value can signal an empty hash or a %NULL
value, it seems error prone to leave the key output argument
uninitialized in situations that the caller cannot clearly distinguish
(without making additional assumptions).
2019-02-04 09:47:00 +01:00
Thomas Haller ca3237150e hashmap: avoid uninitialized variable warning in internal_hashmap_clear()
GCC 8.2 with LTO and -O2 emits a false warning:

    src/basic/hashmap.c: In function 'internal_hashmap_free.constprop':
    src/basic/hashmap.c:898:33: error: 'k' may be used uninitialized in this function [-Werror=maybe-uninitialized]
                      free_key(k);
                      ^

Avoid it by initializing the variable.
2019-02-04 09:36:08 +01:00
Hans de Goede b8cd434d20 hwdb: Add key-mapping for GPIO-keys on HP stream 7 tablet (#11631)
The HP stream 7 ACPI tables contains a gpio-keys entry for a non connected
GPIO causing spurious events, this commit maps this key to unknown to
disable it.

BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=202279
2019-02-04 08:58:39 +10:00
Claudius Ellsel a2ca57521b Add another entry for MX Master to 70-mouse.hwdb (#11633) 2019-02-04 08:39:34 +10:00
Fabrice Fontaine aeed8332af networkd-dhcp6.c: fix build without IFA_F_NOPREFIXROUTE
systemd fails to build on kernel without IFA_F_NOPREFIXROUTE
since 9714c02

So put include missing_network.h

Fixes:
 - http://autobuild.buildroot.org/results/970b09e1d49b53dff12a07ca4ad424ef9dd29a69

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-02-03 18:38:47 +01:00
Fabrice Fontaine 081aea2502 networkd-address.c: fix build without IFA_F_NOPREFIXROUTE
systemd fails to build on kernel without IFA_F_NOPREFIXROUTE
since 9714c02

So put include missing_network.h

Fixes:
 - http://autobuild.buildroot.org/results/970b09e1d49b53dff12a07ca4ad424ef9dd29a69

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-02-03 18:34:36 +01:00
Fabrice Fontaine d909e4af6a networkd-ndisc.c: fix build without IFA_F_NOPREFIXROUTE
systemd fails to build on kernel without IFA_F_NOPREFIXROUTE
since 9714c02

So put include missing_network.h

Fixes:
 - http://autobuild.buildroot.org/results/970b09e1d49b53dff12a07ca4ad424ef9dd29a69

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-02-03 18:30:38 +01:00
Fabrice Fontaine 7bd188b1e6 networkd-brvlan.c: fix build without BRIDGE_VLAN_INFO_RANGE_END
systemd fails to build on kernel without BRIDGE_VLAN_INFO_RANGE_END
since 9714c02

So put include missing_if_bridge.h

Fixes:
 - http://autobuild.buildroot.org/results/970b09e1d49b53dff12a07ca4ad424ef9dd29a69

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2019-02-03 17:34:53 +01:00
Frantisek Sumsal 9d8c69c7d9
Merge pull request #11637 from yuwata/fix-test-network
test-network: fix test_dhcp_server() and test_ipv6_prefix_delegation()
2019-02-03 13:33:47 +01:00
Evgeny Vereshchagin e298df69a2 travis: stop using the official upstream-systemd-ci repository
Turns out the key for the repository hasn't been propagated properly
so let's restore the kludge that was removed in https://github.com/systemd/systemd/pull/11582.
Of course it's ugly but at least it works.

The issue was kind of reported to the maintainers of the repository
in https://github.com/systemd/systemd/pull/11531#issuecomment-460023474.
2019-02-03 08:51:21 +03:00
Yu Watanabe f5d191a9e7 test-network: add or drop whitespace 2019-02-03 05:27:15 +01:00
Yu Watanabe 3e9d555241 test-network: fix test_dhcp_server() and test_ipv6_prefix_delegation()
The tests have been broken since 30d3b54eba.
2019-02-03 04:40:05 +01:00
Topi Miettinen a21760454d Detect file truncation earlier in a few places
Users of read_one_line_file() for APIVFS entries are ignored as they are
assumed to never get truncated.
2019-02-02 16:25:32 +02:00
Topi Miettinen cbed254f96 backlight: handle loading truncated file
I had accidentally filled my /var partition. This caused backlight to fail to
start even with disk space, because the brightness files were truncated to zero
size:

systemd-backlight[624]: acpi_video0: Failed to parse brightness "": Invalid argument
systemd-backlight[624]: acpi_video0: Failed to write system 'brightness' attribute: No such device or address
systemd[1]: systemd-backlight@backlight:acpi_video0.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: systemd-backlight@backlight:acpi_video0.service: Failed with result 'exit-code'.
systemd[1]: Failed to start Load/Save Screen Backlight Brightness of backlight:acpi_video0.

Handle a truncated file like non-existent file.
2019-02-02 16:25:32 +02:00
YmrDtnJu f2ea9cc746 shared: Revert commit 49fe5c099 in parts for function parse_acl.
Too much code has been removed while replacing startswith with STARTSWITH_SET
so that every ACL specified e.g. in tmpfiles.d was parsed as a default ACL.
2019-02-02 12:46:32 +01:00
Taro Yamada 19632f6dbb test: (ArchLinux) Replace initramfs-linux.img with initramfs-linux-fallback.img.
Currently /boot/initramfs-linux.img is used as the default initrd for ArchLinux.
Although, since the kernel modules that are not necessary for the host  environment are removed from
initramfs-linux.img by mkinitcpio 's autodetect hook, the kernel modules necessary for qemu may be missing.
(ata_piix, ext4, and so on in my case.)
As a result, the test environment may not be built properly and the test will be failed.

initramfs-linux-fallback.img will skip this autodetect hook, so the test will run successfully in more
environments.

Both initramfs-linux.img and initramfs-linux-fallback.img are generated by default.
2019-02-02 12:45:51 +01:00
Topi Miettinen d6062e3b4f basic: change read_one_line_file() to return number of bytes read
Change detect_vm_xen_dom0() to match new usage.
2019-02-02 00:25:57 +02:00
Yu Watanabe 3285320786 test-execute: unset $HOME before testing
Otherwise, test for %h specifier may fail.

Fixes #11609.
2019-02-01 18:43:14 +01:00
Yu Watanabe d1698b82e6 man: add referecne to systemd-system.conf 2019-02-01 12:31:51 +01:00
Yu Watanabe 7e68a33b46 man: clarify the source of DefaultTimeoutStartSec= 2019-02-01 12:31:35 +01:00