1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 03:25:31 +03:00
Commit Graph

38235 Commits

Author SHA1 Message Date
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
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
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
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
Yu Watanabe
68d838f71d man: fix volume num of journalctl 2019-02-01 12:30:36 +01:00
Lennart Poettering
118dccc948 pager: improve english a bit 2019-01-31 13:37:58 +01:00
govwin
913b9ba957 Add Lenovo Yoga 500-14IBD, 80N4 GlidePoint Touchpad (#11606)
Touchpad size as listed by kernel was 102x28mm. Update changes it to 106x71mm.
User measured (actual size): 108x72mm.
2019-01-31 14:43:14 +10:00
Lennart Poettering
ba7a6b8c09 More NEWS prep for v241 2019-01-30 19:26:40 +01:00
Susant Sahani
7bea7f9b57 test-network: skip erspan test if not available 2019-01-30 14:30:59 +01:00
Evgeny Vereshchagin
3fb1ea3bb4
Merge pull request #11592 from evverx/ignore-memory-leaks-in-dbus
tests: ignore memory leaks in dbus-daemon and also crash PID1 if UBSan is unhappy
2019-01-30 16:24:18 +03:00
Ronnie P. Thomas
7f700b8a27 Fixed minor typo in man/tmpfiles.d.xml 2019-01-30 07:30:27 +01:00
Evgeny Vereshchagin
a19f909b5b tests: crash PID1 if UBSan is unhappy
Now that https://github.com/systemd/systemd/issues/10332 is unlikely to happen
it should be totally fine to try to crash PID1 :-)
2019-01-30 03:16:14 +01:00
Evgeny Vereshchagin
d56db495de tests: ignore memory leaks in dbus-daemon
Otherwise, the test fails on Fedora 28 with
```
Jan 30 01:42:35 systemd-testsuite dbus-daemon[61]: [system] Successfully activated service 'org.freedesktop.systemd1'
Jan 30 01:42:35 systemd-testsuite systemd[61]: dbus.service: Kernel keyring access prohibited, ignoring.
Jan 30 01:42:35 systemd-testsuite systemd[61]: dbus.service: Executing: /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: =================================================================
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: ==61==ERROR: LeakSanitizer: detected memory leaks
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: Direct leak of 72 byte(s) in 1 object(s) allocated from:
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]:     #0 0x7f21f9e29088 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef088)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]:     #1 0x7f21f9b1b23c  (/lib64/libdbus-1.so.3+0x3323c)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]:     #2 0x240000001b  (<unknown module>)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: Direct leak of 16 byte(s) in 1 object(s) allocated from:
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]:     #0 0x7f21f9e29088 in __interceptor_realloc (/usr/lib64/libasan.so.5+0xef088)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]:     #1 0x7f21f9b1b23c  (/lib64/libdbus-1.so.3+0x3323c)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]:     #2 0x7ffffffff  (<unknown module>)
Jan 30 01:42:50 systemd-testsuite dbus-daemon[61]: SUMMARY: AddressSanitizer: 88 byte(s) leaked in 2 allocation(s).
```

The leaks were reported and fixed in https://bugs.freedesktop.org/show_bug.cgi?id=107320.
2019-01-30 02:28:40 +01:00
Evgeny Vereshchagin
8605a4b9eb travis: switch to the "official" systemd-ci repository
Now that add-apt-repository hasn't failed for almost two days on Semaphore
it should be safe to assume that the key has been propagated properly
and the repository is ready to be used on Travis CI.
2019-01-29 11:51:20 +01:00