1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-27 01:55:32 +03:00
Commit Graph

37774 Commits

Author SHA1 Message Date
Filipe Brandenburger
fc833520e4 Revert "lldp: add test coverage for sd_lldp_get_neighbors() with multiple neighbors"
This reverts commit dd102e4d0c.

That test case exposed a memory leak and breaks CI, so let's revert it until
the original issue is fixed, to prevent disruption of automated testing.
2018-12-15 20:58:39 +03:00
Filipe Brandenburger
2e14ea7d78
Merge pull request #11137 from poettering/bogus-id128
hostnamed: let's filter out some obviously bogus product UUIDs
2018-12-15 09:27:14 -08:00
Susant Sahani
6d4efac2d9 networkd: Bond - AllSlavesActive fix parser
Bond.AllSlavesActive use parser type bool
2018-12-15 18:17:02 +05:30
Susant Sahani
fde60a424e netdev bond: add support to configure tlb_dynamic_lb
Closes https://github.com/systemd/systemd/issues/11135

Add test for bond : tlb_dynamic_lb
2018-12-15 18:15:16 +05:30
Lennart Poettering
ffd79164aa
Merge pull request #11140 from filbranden/lldpcmp1
Use ?: to chain comparison functions (for now, in lldp only)
2018-12-15 12:12:06 +01:00
Lennart Poettering
460ec54908 core: flush nscd's caches whenever we allocate/release a dynamic user
This should make dynamic users and nscd work together better.

Fixes: #10740
2018-12-15 12:10:19 +01:00
Lennart Poettering
7782e0a0ea hostnamed: always flush nscd cache when changing hostname
This way we know that nss-myhostname always serves the correct answer.
2018-12-15 12:10:19 +01:00
Lennart Poettering
9fdcbae5e2 machined: flush nscd caches whenever a machine comes/goes
This way, nss-mymachines should always serve authoritative data.
2018-12-15 12:10:19 +01:00
Lennart Poettering
5be61bead5 machined: fix memory corruption
Let's make sure the first hashmap we destroy also frees all machines,
because otherwise when freeing the other hashmaps we'll try to
deregister the contained machines from the hashmaps already destroyed.
2018-12-15 12:10:19 +01:00
Lennart Poettering
f079c3727c shared: add helper for flushing nscd caches
Apparently, people do use nscd, hence play somewhat nice with it, and
let's explicitly flush nscd caches whenever we register a new
user/group.

This patch only adds the actual refresh request invocation. Later
commits then issue this call at appropriate moments.

Note that the nscd protocol is not officially documented though very
simple. This code is written very defensively so that incompatibilities
don't affect us much.

Given that glibc really has a duty to maintain compat between
differently compiled programs and their system nscd they can't break API
and thus it should be safe for us to implement an alternative,
minimalistic client.

Ideally this kind of explicit, global cache flushing would not be necessary.
However nscd currently has no cache coherency protocol, hence we can't
really implement this better. The only concept it knows is a TTL for
positive hosts lookups. Hoewver for negative lookups or any of the other
tables nothing is available.
2018-12-15 12:10:19 +01:00
Lennart Poettering
6839aa567c hostnamed: filter out all-zero and all-0xFF DMI ProductUUIDs
These UUIDs are considered as wildcard value for "unset" UUIDs
typically, and this even makes sense. Let's suppress them hence.
2018-12-15 12:06:44 +01:00
Lennart Poettering
670814387b sd-id128: add helpers to check fo all-0xFF ids 2018-12-15 12:06:44 +01:00
Lennart Poettering
463adf5710 sd-id128: slightly reorder function prototypes
Let's place the three calls for acquiring the IDs together, and the
calls for getting the app-specific ones separate from them.
2018-12-15 12:06:44 +01:00
Lennart Poettering
4783e5ad3d sd-128: base SD_ID128_MAKE() macro on existing SD_ID128_ARRAY() macro 2018-12-15 12:06:44 +01:00
Lennart Poettering
549b47247d fstab-generator: remove spurious newline 2018-12-15 12:06:44 +01:00
Alexey Bogdanenko
d3e5af0440 mkosi: update libqrencode in Debian config
In Debian unstable package libqrencode-dev is version 4.0.2-1, and the
corresponding runtime library is provided by package libqrencode4.

This change fixes the following error when running journalctl:

    root@image:~# journalctl
    journalctl: error while loading shared libraries: libqrencode.so.4: cannot
    open shared object file: No such file or directory

This change also fixes the following boot failures in
systemd-journal-flush.service and systemd-journal-catalog-update.service:

    [FAILED] Failed to start Flush Journal to Persistent Storage.
    [FAILED] Failed to start Rebuild Journal Catalog.

See also #4949
2018-12-15 10:55:10 +01:00
Filipe Brandenburger
dc6bf94d68 lldp: simplify compare_func, using ?: to chain comparisons
The ?: operator is very useful for chaining comparison functions
(strcmp, memcmp, CMP), since its behavior is to return the result
of the comparison function call if non-zero, or continue evaluating
the chain of comparison functions.

This simplifies the code in that using a temporary `r` variable
to store the function results is no longer necessary and the checks
for non-zero to return are no longer needed either, resulting in a
typical three-fold reduction to the number of lines in the code.

Introduce a new memcmp_nn() to compare two memory buffers in
lexicographic order, taking length in consideration.

Tested: $ ninja -C build/ test

All test cases pass. In particular, test_multiple_neighbors_sorted()
in test-lldp would catch regressions introduced by this commit.
2018-12-14 09:18:42 -08:00
Filipe Brandenburger
dd102e4d0c lldp: add test coverage for sd_lldp_get_neighbors() with multiple neighbors
In particular, check that the order of the results is consistent.

This test coverage will be useful in order to refactor the compare_func
used while sorting the results.

Tested: ninja -C build/ test
2018-12-14 09:18:01 -08:00
Chris Down
09818a8893
Merge pull request #11160 from poettering/read-line-more-tests
some tests for read_line() EOL markers that coincide with EOF
2018-12-14 13:00:28 +00:00
Lennart Poettering
6baac700a8 tests: add a test that checks read_line() properly handles line endings at EOF
As requested here: https://github.com/systemd/systemd/pull/11129#discussion_r241588835
2018-12-14 12:57:32 +01:00
Lennart Poettering
31fd02f009 fileio: fail early if we can't return the number of bytes we read anymore in an int
This is mostly paranoia, but let's better be safer than sorry. This of
course means there's always an implicit limit to how much we can read at
a time of 2G. But that should be ample.
2018-12-14 12:56:12 +01:00
Zbigniew Jędrzejewski-Szmek
58d9d89b4b pid1: fix free of uninitialized pointer in unit_fail_if_noncanonical()
https://bugzilla.redhat.com/show_bug.cgi?id=1653068
2018-12-14 11:21:16 +01:00
Zbigniew Jędrzejewski-Szmek
0b57803630 man: add note about systemd-vconsole-setup.service and tty as input/output
Closes #10019.
2018-12-14 11:18:32 +01:00
Zbigniew Jędrzejewski-Szmek
3f9a0a522f tree-wide: s/time-out/timeout/g
From WordNet (r) 3.0 (2006) [wn]:

  time-out
      n 1: a brief suspension of play; "each team has two time-outs left"

From The Free On-line Dictionary of Computing (18 March 2015) [foldoc]:

  timeout

     A period of time after which an error condition is raised if
     some event has not occured.  A common example is sending a
     message.  If the receiver does not acknowledge the message
     within some preset timeout period, a transmission error is
     assumed to have occured.
2018-12-14 11:17:52 +01:00
Thomas Haller
1a35985264 in-addr-util: fix undefined result for in4_addr_netmask_to_prefixlen(<0.0.0.0>)
u32ctz() was undefined for zero due to __builtin_ctz() [1].
Explicitly check for zero to make the behavior defined.

Note that this issue only affected in4_addr_netmask_to_prefixlen()
which is the only caller.

It may seem slightly odd, to return 32 (bits) for utz(0). But that
is what in4_addr_netmask_to_prefixlen() needs, and it probably makes
the most sense here.

[1] https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html

Fixes: ba91431154
2018-12-14 11:15:36 +01:00
Zbigniew Jędrzejewski-Szmek
1d79128121 udev: make udev_rules_new() return a proper error code 2018-12-14 10:20:43 +01:00
Bruce Zhang
0b1093018b add device hwdb for IdeaPad Miix510-12ISK
add ACCEL_MOUNT_MATRIX for IdeaPad Miix510-12ISK

multiple match expressions for Miix510 series

extend comments for miix510 series

Signed-off-by: Bruce Zhang <zttt183525594@gmail.com>

add device hwdb for IdeaPad Miix510-12ISK

Signed-off-by: Bruce Zhang <zttt183525594@gmail.com>
2018-12-14 09:16:36 +01:00
Lennart Poettering
838894b0c6 fileio: make read_line() handle various line endings correctly
This adds support for windows line endings.

More importantly though with this change a newline followed by EOF is
considered a single line end.
2018-12-14 09:12:17 +01:00
Zbigniew Jędrzejewski-Szmek
57db447ebf
Merge pull request #11147 from yuwata/bash-completion-machinectl
bash-completion: adds import-fs for machinectl and suggest more
2018-12-14 08:57:03 +01:00
Yu Watanabe
f675a1f005 bash-completion: busctl: support --json and -j option 2018-12-14 08:55:38 +01:00
Zbigniew Jędrzejewski-Szmek
58493c6671
Merge pull request #11145 from yuwata/bash-completion-bootctl
bash-completion: bootctl: support set-default and set-oneshot
2018-12-14 08:54:44 +01:00
Yu Watanabe
5cd6711621 sd-netlink: set destroy_callback only if asynchronous call succeeds 2018-12-14 08:50:51 +01:00
Zbigniew Jędrzejewski-Szmek
40d70ca07c
Merge pull request #11152 from keszybz/meson-user-unit-symlinks
Fix future installation of user unit symlinks by meson
2018-12-14 08:31:50 +01:00
Lennart Poettering
9a6f746fb6 locale-util: prefix special glyph enum values with SPECIAL_GLYPH_
This has been irritating me for quite a while: let's prefix these enum
values with a common prefix, like we do for almost all other enums.

No change in behaviour, just some renaming.
2018-12-14 08:22:54 +01:00
Yu Watanabe
903893237a sd-device: do not change buffer size if the socket is already bound
From the results of CIs in #11076, changing buffer size may cause
issue #10754. So, let's prohibit to change the size if it is already
bound.

This also reverts commit 986ab0d2dc.
2018-12-14 09:33:06 +09:00
Yu Watanabe
c821e84ac7 sd-device: do not modify socket option(s) if socket is passed by PID1
If the socket fd is passed by PID1, then it is created by .socket unit
and we have already set sufficient option(s) for the socket.
So, let's not touch the passed socket.
2018-12-14 09:28:33 +09:00
Yu Watanabe
a153a1de75 Revert "sd-device: do not call device_monitor_enable_receiving() for passed fd from pid1"
This reverts commit 916707cca5.

As the CI results on #11076, #10754 is not fixed by the commit,
but by 986ab0d2dc. So, let's revert the
commit.
2018-12-14 09:24:31 +09:00
Lennart Poettering
fd0ec39d38
Merge pull request #11046 from keszybz/generator-mains
Macroify generators a bit more
2018-12-13 22:39:23 +01:00
Lennart Poettering
ffd1a3f688 man: substantially update the docs regarding hooking sd-bus objects up with external event loops
Prompted by https://lists.freedesktop.org/archives/systemd-devel/2018-December/041817.html

This also drops all references to select() from our manpages. It's 2018
after all, people should use poll(), or ppoll() or epoll().
2018-12-13 22:33:47 +01:00
Michael Scherer
41fc3fab1c man: Use the proper option name in documentation 2018-12-13 20:30:58 +01:00
Zbigniew Jędrzejewski-Szmek
634cc94f47 units: replace symlinks in units/user/ by real files
We already *install* those as real files since de78fa9ba0.
Meson will start to copy symlinks as-is, so we would get dangling symlinks in
/usr/lib/systemd/user/.

I considered the layout in our sources to match the layout in the installation
filesystem (i.e. creating units/system/ and moving all files from units/ to
units/system/), but that seems overkill. By using normal files for both we get
some duplication, but those files change rarely, so it's not a big downside in
practice.

Fixes #9906.
2018-12-13 20:23:43 +01:00
Zbigniew Jędrzejewski-Szmek
df13444339 units: drop units/user/busnames.target
It seems this was missed in 0ba8987337.
2018-12-13 20:23:43 +01:00
Yu Watanabe
ff1cf894d2 bash-completion: nspawn: support recently added options 2018-12-14 03:18:33 +09:00
Yu Watanabe
223f58ba8d bash-completion: run: support recently added options 2018-12-14 03:18:33 +09:00
Yu Watanabe
2e68a49dc8 bash-completion: systemctl: use --output=help to show suggestions 2018-12-14 02:33:21 +09:00
Yu Watanabe
fdc33681ae bash-completion: journalctl: use --output=help to show suggestions 2018-12-14 02:33:21 +09:00
Yu Watanabe
d104486ab6 bash-completion: journalctl: drop deprecated --new-id128 option 2018-12-14 02:33:21 +09:00
Yu Watanabe
3b59e2cbed bash-completion: loginctl: suggest argument for --machine option 2018-12-14 02:22:40 +09:00
Yu Watanabe
dfeebf55d9 bash-completion: loginctl: suggest argument for --output option 2018-12-14 02:18:35 +09:00
Yu Watanabe
fad73e9deb bash-completion: machinectl: suggest arguments for --verify and --format
This also changes to use '--output=help' for suggesting arguments of
--output option.
2018-12-14 02:18:24 +09:00