Commit graph

39809 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 6695c200bd shared/utmp-wtmp: silence gcc warning about strncpy truncation
Unfortunately the warning must be known, or otherwise the pragma generates a
warning or an error. So let's do a meson check for it.

Is it worth doing this to silence the warning? I think so, because apparently
the warning was already emitted by gcc-8.1, and with the recent push in gcc to
catch more such cases, we'll most likely only get more of those.
2019-05-07 21:05:26 +02:00
Zbigniew Jędrzejewski-Szmek 881a62debb scsi_serial: replace &foo[n] by foo+n 2019-05-07 15:07:43 +02:00
Zbigniew Jędrzejewski-Szmek f1d553e9df shared/utmp-wtmp: avoid gcc warning about strncpy truncation
The fact that strncpy does the truncation is the whole point here, and gcc
shouldn't warn about this. We can avoid the warning and simplify the
whole procedure by directly copying the interesting part.
2019-05-07 14:15:46 +02:00
Zbigniew Jędrzejewski-Szmek c98b354500 network: remove redunant link name in message
Fixes #12454.

gcc was complaining that the link->ifname argument is NULL. Adding
assert(link->ifname) right before the call has no effect. It seems that
gcc is confused by the fact that log_link_warning_errno() internally
calls log_object(), with link->ifname passed as the object. log_object()
is also a macro and is does a check whether the passed object is NULL.
So we have a check if something is NULL right next an unconditional use
of it where it cannot be NULL. I think it's a bug in gcc.

Anyway, we don't need to use link->ifname here. log_object() already prepends
the object name to the message.
2019-05-07 13:46:55 +02:00
Yu Watanabe b30160ff7f
Merge pull request #12478 from yuwata/wireguard-fwmark
network: rename WireGuard.FwMark -> FirewallMark
2019-05-07 05:16:34 +02:00
Yu Watanabe c2d6b5ac9d
Merge pull request #12487 from mschiu77/acer-series-hwdb
Acer series hwdb
2019-05-07 04:33:49 +02:00
Zbigniew Jędrzejewski-Szmek 3759c0bdd3
Merge pull request #12440 from poettering/realloc-again
another shot at the malloc_usable_size() thing
2019-05-06 17:17:22 +02:00
Mike Gilbert 5797a12223 basic/mountpoint-util: whitelist 'exfat' in fstype_can_uid_gid 2019-05-06 16:43:22 +02:00
Susant Sahani 946f8e14d5 networkd: stop clients when networkd shuts down (#12463)
We not stopping the clients when networkd stops. They
should shut down cleanly and then we need to clean the DS.

One of requirements to implement
https://github.com/systemd/systemd/issues/10820.

```
^CBus bus-api-network: changing state RUNNING → CLOSED
DHCP SERVER: UNREF
DHCP SERVER: STOPPED
DHCP CLIENT (0x60943df0): STOPPED
veth-test: DHCP lease lost
veth-test: Removing address 192.168.5.31
NDISC: Stopping IPv6 Router Solicitation client
DHCP CLIENT (0x0): FREE
==24308==
==24308== HEAP SUMMARY:
==24308==     in use at exit: 8,192 bytes in 2 blocks
==24308==   total heap usage: 4,230 allocs, 4,228 frees, 1,209,732 bytes allocated
==24308==
==24308== LEAK SUMMARY:
==24308==    definitely lost: 0 bytes in 0 blocks
==24308==    indirectly lost: 0 bytes in 0 blocks
==24308==      possibly lost: 0 bytes in 0 blocks
==24308==    still reachable: 8,192 bytes in 2 blocks
==24308==         suppressed: 0 bytes in 0 blocks
==24308== Rerun with --leak-check=full to see details of leaked memory
==24308==
==24308== For lists of detected and suppressed errors, rerun with: -s
==24308== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
==24308== could not unlink /tmp/vgdb-pipe-from-vgdb-to-24308-by-sus-on-Zeus
==24308== could not unlink /tmp/vgdb-pipe-to-vgdb-from-24308-by-sus-on-Zeus
==24308== could not unlink /tmp/vgdb-pipe-shared-mem-vgdb-24308-by-sus-on-Zeus

```
2019-05-06 16:06:50 +02:00
pEJipE deff4b87aa hwdb: update the Chuwi HI13 pattern (#12469)
Correct the searching pattern for Chuwi Hi13. Follow-up for
c70b51a7b9.
2019-05-06 15:55:22 +02:00
Rafael Fontenelle 637c80bc73 Update Brazilian Portuguese translation 2019-05-06 15:29:31 +02:00
Daniele Medri 9028b8babb Systemd Catalog, Italian translation: minor updates (#12483) 2019-05-06 15:27:21 +02:00
mpe85 448cd0f3ee hwdb: add Medion Akoya E3222 MD62450 to 60-sensor.hwdb (#12485) 2019-05-06 15:18:26 +02:00
Frantisek Sumsal 6ab668337e test: return a non-zero return code when 'nobody' user doesn't exist
Lookup of a non-existing user using getpwnam() is not considered
an error, thus the `errno` is not set appropriately, causing
unexpected fails on systems, where 'nobody' user doesn't exist by
default
2019-05-06 15:13:07 +02:00
Chris Chiu 82b941cb5d hwdb: Align airplane mode toggle key mapping for all Acer series
Packard Bell and Gateway are different marketing names from Acer.
The same scan code E0 86 is fired for the airplane mode toggle key.
It was verified in commit d8d51328fe.

Signed-off-by: Chris Chiu <chiu@endlessm.com>
2019-05-06 14:27:37 +08:00
Chris Chiu 3429cc4f58 Revert "hwdb: Apply Acer mappings to all Gateway and Packard Bell models"
This reverts commit e09dba97b9.

It's reported that the same rules for Acer cause false match and
unexpected response from certain keys on an old PackardBell laptop.

Bug: https://github.com/systemd/systemd/issues/12178
2019-05-06 14:27:23 +08:00
Yu Watanabe 1c30b174ed network: rename WireGuard.FwMark -> FirewallMark
For the consistency with FirewallMark= in [RoutingPolicyRule] section.
2019-05-04 17:20:23 +02:00
Yu Watanabe c26f3b1c86
Merge pull request #12429 from ssahani/link-local-fallback
networkd: Option to use LinkLocalAddressing only when DHCP fails
2019-05-04 16:52:07 +02:00
Yu Watanabe 63c598ede3 test-network: add a test for LinkLocalAddressing=fallback 2019-05-04 16:46:03 +02:00
Yu Watanabe 810ae0dc95 network: warn about Network.IPv4LL= is deprecated 2019-05-04 16:46:02 +02:00
Yu Watanabe 29e81083bd network: disable fallback IPv4ll address assignment when DHCPv4 is disabled 2019-05-04 16:46:02 +02:00
Yu Watanabe e800fd24a1 network: use DEFINE_STRING_TABLE_LOOKUP() macro for AddressFamilyBoolean 2019-05-04 16:46:02 +02:00
Yu Watanabe 6c0c041a8e network: make link_check_ready() handle LinkLocalAddressing=fallback 2019-05-04 16:46:02 +02:00
Yu Watanabe 552081a499 network: rewrite condition about DHCP in link_check_ready() 2019-05-04 16:46:02 +02:00
Susant Sahani 8bc17bb3f7 networkd: Option to use LinkLocalAddressing only when DHCP fails
When LinkLocalAddressing=fallback or LinkLocalAddressing=ipv4-fallback
then IPv4LL will be started only when DHCP fails.

Closes #9648.
2019-05-04 16:45:57 +02:00
Chris Down 6450ee3f8c
Merge pull request #12466 from yuwata/network-fix-issue-12452
network: fix assertion when link get carrier
2019-05-03 23:01:28 -04:00
Chris Down b6adba159c
Merge pull request #12441 from ssahani/bridge-fdb
networkd: add support for bridge fdb destination address.
2019-05-03 09:50:47 -04:00
Wieland Hoffmann 8a7033ac2f fstab-generator: Prevent double free of reused FILE*
When the .automount unit file already existed for any reason in the
`normal-dir` passed to `systemd-fstab-generator`, but the normal .mount unit
file did not, `f` was closed (but _not_ set to NULL). The call to
`generator_open_unit_file(..., automount_name, &f)` then failed because the
.mount unit file already existed. Now `f` did not point to an open FILE and the
later cleanup from the `_cleanup_fclose_` attribute failed with a double free.
Reset `f` to NULL before reusing it.
2019-05-03 13:22:36 +02:00
Yu Watanabe 1c862fe05a test-network: add tests for BridgeFDB.Destination= 2019-05-03 06:12:04 +02:00
Susant Sahani c2c2793f39 networkd: Add support to configure destination address for bridge FDB
Closes #5145.

Example conf:
```
[Match]
Name=vxlan1309

[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.2

[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.4

[BridgeFDB]
MACAddress=00:00:00:00:00:00
Destination=10.0.0.5
```
2019-05-03 06:11:52 +02:00
Yu Watanabe b9ea3d2e47 network: fix assertion when link get carrier
This fixes a bug introduced by bd08ce5615.
When link is in LINK_STATE_INITIALIZED, `Link::network` may not be
set yet.

Fixes #12452.
2019-05-03 01:14:36 +02:00
Lennart Poettering 4136447576 test-alloc-util: let's test a few more things around GREEDY_REALLOC() 2019-05-02 14:53:40 +02:00
Lennart Poettering e59054270c alloc-util: reintroduce malloc_usable_size() into greedy_realloc()
This is another attempt at d4b604baea and #12438

Instead of blindly using the extra allocated space, let's do so only
after telling libc about it, via a second realloc(). The second
realloc() should be quick, since it never has to copy memory around.
2019-05-02 14:53:40 +02:00
Zbigniew Jędrzejewski-Szmek 64538af89b udev/cdrom_id: drop unneeded parentheses 2019-05-01 11:46:42 +02:00
Lennart Poettering adb7b782f8
Merge pull request #12218 from keszybz/use-libmount-more
Use libmount more
2019-04-30 19:44:17 +02:00
Franck Bui 9f3f596477 meson: make source files including nspawn-settings.h depend on libseccomp
Since nspawn-settings.h includes seccomp.h, any file that includes
nspawn-settings.h should depend on libseccomp so the correct header path where
seccomp.h lives is added to the header search paths.

It's especially important for distros such as openSUSE where seccomp.h is not
shipped in /usr/include but /usr/include/libseccomp.

This patch is similar to 8238423095.
2019-04-30 19:31:22 +02:00
Yu Watanabe 8b803ad634 udev: drop unnecessary brackets
Follow-up for ed0cb34682.
2019-04-30 19:10:35 +02:00
Lennart Poettering 0892f3f999
Merge pull request #12420 from mrc0mmand/coccinelle-tweaks
Coccinelle improvements
2019-04-30 11:37:19 +02:00
Lennart Poettering 8d76f2905d
Merge pull request #12439 from poettering/simplify-umask-util
simplify RUN_WITH_UMASK()
2019-04-30 11:36:55 +02:00
Lennart Poettering 043d453c40 tests: add test for umask-util.h 2019-04-30 09:53:09 +02:00
Lennart Poettering 650c7a2e8b umask-util: simplify RUN_WITH_UMASK()
Why have a struct to store the iteration bit if we actually have plenty
place in mode_t?
2019-04-30 09:52:35 +02:00
Frantisek Sumsal ccd52940d0 coccinelle: further restrict certain transformations
Some transformations generate results we don't want to keep, so
let's disable such transformations for specific files.

Also, disable const-strlen.cocci everywhere, as the STRLEN macro has a
pretty limited scope, so the transformation generates false positives in
most cases.
2019-04-30 09:39:13 +02:00
Frantisek Sumsal 1f72479037 coccinelle: exclude JsonVariant* from the IN_SET transformation
JsonVariant* doesn't work with the current IN_SET implementation, so
let's exclude it from the transformation altogether
2019-04-30 09:39:13 +02:00
Frantisek Sumsal ed0cb34682 tree-wide: code improvements suggested by Coccinelle 2019-04-30 09:39:07 +02:00
Susant Sahani f143c650a3 netword: fdb fix coding style 2019-04-30 13:06:10 +05:30
Zbigniew Jędrzejewski-Szmek cb9ff7532b
Merge pull request #12434 from poettering/rm-rf-children-take-ptr
minor rm_rf_children() modernizations
2019-04-30 08:23:13 +02:00
Aaron Barany fcc72fd0f1 alloc-util: don't use malloc_usable_size() to determine allocated size
This reverts commit d4b604baea.

When realloc() is called, the extra memory between the originally
requested size and the end of malloc_usable_size() isn't copied. (at
least with the version of glibc that currently ships on Arch Linux)
As a result, some elements get lost and use uninitialized memory, most
commonly 0, and can lead to crashes.

fixes #12384
2019-04-30 08:20:59 +02:00
Lennart Poettering b9de47b97b
Merge pull request #12428 from jwrdegoede/hwdb-logitech-kbds
Hwdb: Add key-mappings for various wireless Logitech keyboards
2019-04-29 21:34:42 +02:00
Yuri Chornoivan 95a37f5979 Update Ukrainian translation 2019-04-29 21:26:39 +02:00
Lennart Poettering 987719d37d
Merge pull request #12414 from keszybz/detect-podman
Detect podman as separate container type
2019-04-29 19:07:24 +02:00