Commit graph

30916 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 9a8e64b0e9 meson: emit a warning if rootprefix is set
It's printed at the end because it's the easiest to spot there.

When meson is upgraded to 0.43.1, we'll be able to use warning() instead.
2017-11-29 13:29:59 +01:00
Zbigniew Jędrzejewski-Szmek 74344a1702 Revert "meson: drop rootprefix option"
This reverts commit ee4bfa21f6.

Also add comment so that this doesn't get deleted again by mistake.

Replaces #7461.
2017-11-28 20:02:53 +01:00
Susant Sahani fbdb6605b5 networkd: Add comment for setting_mtu #7460 (#7489)
Follow up #7460
2017-11-28 17:24:52 +01:00
Lennart Poettering 4de8d3f59e
Merge pull request #7486 from keszybz/coverity-fixes
Fixes for issues spotted by coverity (and some cleanups)
2017-11-28 15:04:11 +01:00
Lennart Poettering b39367a1a7
Merge pull request #7398 from keszybz/udev-list
udev: use list.h instead of udev_list_node
2017-11-28 11:35:02 +01:00
Lennart Poettering c9f034a10a
Merge pull request #7484 from poettering/sd-resolve-timeout
timeout sd-resolve tests
2017-11-28 11:33:38 +01:00
Zbigniew Jędrzejewski-Szmek ba77dac291 pid1: improve syntax in error message 2017-11-28 09:26:14 +01:00
Zbigniew Jędrzejewski-Szmek d387cfdddd pid1: clarify that min_max is always initialized
read_one_line_file() always returns <= 0, so the code was OK, but let's write
the check a bit differently to make it obvious that min_max is always set.
2017-11-28 09:26:14 +01:00
Zbigniew Jędrzejewski-Szmek 7beb3baf16 test-hostname-util: add assert_se's to make coverity happy 2017-11-28 09:26:14 +01:00
Zbigniew Jędrzejewski-Szmek c47a9f909a test-process-util: add (void) cast to make coverity happy
The intent is for the call to succeed only when privileged, so make
that clear.
2017-11-28 09:25:39 +01:00
Zbigniew Jędrzejewski-Szmek ca9b2b4dc1 test-fd-util: add assert_se to make coverity happy 2017-11-28 09:25:39 +01:00
Zbigniew Jędrzejewski-Szmek b0fe73d740 udevadm-monitor: add some assert_se's to make coverity happy
We do that elsewhere and it's nice to be consistent.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 595c66a3db core/umount: use _cleanup_ in one more place 2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 1a96c8e1cc sd-resolve: check that name fits in the specified packet length
Coverity complained that we didn't check if the data is long enough.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 8d44f5a637 shim: fix logically dead code
The alternate verification path could never be taken.

Found by coverity.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 1e40b7490a networkd: remove dead code
Found by coverity.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek ef51180b62 test-ndisc-ra: add assert_se() to make coverity happy 2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 10a6e01eaa boot/shim: fix char ** vs char * mismatch
This code cannot have ever worked ;(

Found by coverity, obvious when the type is not obfuscated to void*.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek bceda88b52 boot/efi: fix NULL dereference
The comment above makes the intent of the code pretty clear:
"use security2_protocol == NULL as indicator".
So revert the condition in the check and fix the logic in the comment while
at it.

The question is how this could have ever worked: if BS->LocateProtocol
(which is supposedly optional) ever failed, we'd crash here. Strange.

Found by coverity.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek bdd73ac5c2 dissect-image: simplify check for passphrase presence
m->encrypted is set when fstype=="crypto_LUKS", but this is not obvious when
reading decrypt_partition(). Just check if passphrase is set before using
it.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek bbd1590085 networkd: fix reversed arguments
Found by coverity.

Also drop unused return value while at it.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 93f9da6e0a networkd: plug some memleaks in rule serialization/deserialization
This fixes the (mostly theoretical, since we're only parsing data that we write
ourselves) memleak when iif or oif is deserialized multiple times. Unfortunately
it does not fix the memleak when rule is freed, but that'll require a bigger
effort.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 9491f55f74 networkd: fix serialization of {Incoming,Outgoing}Interface
Let's just say that the code wasn't fully functional ;(

Since we only had the parser for serialization, and not the writer, we are
free to change the format. So while at it, let's use shorter names in the
serialization format that match the surrounding style.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 7379f3de7f Add test-routing-policy-rule 2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 6f349a4f9c test-network: use automatic cleanup 2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek e4aca57df8 networkd: parse the rvalue, not the option name
:(
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek 458d8ae302 networkd: move rule loading to a separate function
No functional change.
2017-11-28 09:25:38 +01:00
Zbigniew Jędrzejewski-Szmek edb5318cbc
Merge pull request #7316 from poettering/fd-store-remove
add new FDSTOREREMOVE=1 sd_notify() message
2017-11-28 09:15:00 +01:00
Ari 05608fcd38 Added Logitech MX Master 2s (#7487) 2017-11-28 12:30:31 +10:00
Lennart Poettering 5bf5510b8f test-resolve: make sure we don't hang forever
If test-resolve is running in some CI environment that doesn't have
reliably working DNS, it's a good idea not to hang forever, let's
time-out after 20s
2017-11-27 17:08:34 +01:00
Lennart Poettering 971fea3203 sd-resolve: propagate timeouts in sd_resolve_wait() the same way as in sd_bus_wait(): ETIMEDOUT
Thankfully this is an internal API still, so we can mkae changes like
this.
2017-11-27 17:08:34 +01:00
Lennart Poettering f3b900311f service: shortcut operations if the MAINPID= doesn't actually cause a change 2017-11-27 17:04:57 +01:00
Lennart Poettering 2fa40742a4 service: use parse_errno() for parsing error numbers
Let's always use the same logic when parsing error numbers, i.e. use
parse_errno() here too, to unify some code, and tighten the checks a
bit.

This also allows clients to pass errors as symbolic names. Probably
nothing we want to advertise too eagerly (since new daemons generating
this on old service managers won't understand), but still pretty
useful I think, in particular in scripting languages and such, where the
numeric error numbers might not be readily available.
2017-11-27 17:04:57 +01:00
Lennart Poettering 67ca6412ab update TODO 2017-11-27 17:04:04 +01:00
Lennart Poettering 4050e47976 logind: use the new FDSTOREREMOVE=1 sd_notify() message
Let's explicitly tell PID 1 that we don't need an fd anymore, instead of
relying exclusively on POLLERR/POLLHUP for it to be removed.

Fixes: #6908
2017-11-27 17:04:04 +01:00
Lennart Poettering e78ee06de1 core: add a new sd_notify() message for removing fds from the FD store again
Currenly the only way to remove fds from the fdstore is to fully
stop the service, or to somehow trigger POLLERR/POLLHUP on the fd, in
which case systemd will remove the fd automatically.

Let's add another way: a new message that can be sent to remove fds
explicitly, given their name.
2017-11-27 17:04:04 +01:00
Lennart Poettering 8d1ab18a46 man: slightly improve the sd_notify() documentation regarding READY=1
READY=1 may be used to signal when a service finished startup, but also
when it finished reloading. Say so.
2017-11-27 17:01:09 +01:00
Lennart Poettering cc2b7b11b4 core: only process one of READY=1, STOPPING=1 or RELOADING=1 in sd_notify() handling
Of course, it's not really a valid sd_notify() message if multiple of
these fields are used in one, but let's handle this somewhat gracefully,
by only processing one of them, and ignoring the rest.
2017-11-27 17:01:00 +01:00
Lennart Poettering c45d11cb30 service: reorder sd_notify() handling a bit
Let's keep handling of WATCHDOG= and WATCHDOG_USEC= together. No
functional changes.
2017-11-27 16:59:52 +01:00
Lennart Poettering e328523777 service: split out sd_notify() message authorization code into a function of its own
Let's shorten service_notify_message() a bit, and do the authentication
outside of the main function body.

No functional changes.
2017-11-27 16:59:52 +01:00
Lennart Poettering 9711848ff1 core: only log about sd_notify() message contents, when debug logging is on
Let's optimize things a bit for the non-debug case. No change in
behaviour.

Main reason to do this is not so much the speed benefit though, but
merely to isolate the code from its surroundings more.
2017-11-27 16:39:43 +01:00
Vladislav Vishnyakov 534ab2ea1a Corrected Chuwi HiBook entry (#7483) 2017-11-27 16:32:07 +01:00
Patrik Flykt a86d329f22 networkd: Free Prefix in case allocation fails (#7480)
Set the code to call _cleanup_prefix_free_ in case the next allocation
fails so that Prefix does not leak memory.

Reported by evverx.
2017-11-27 13:07:22 +01:00
Zbigniew Jędrzejewski-Szmek cfc4529b01 networkd: unbork rule serialization
We'd write something like

RULE=from=250.250.240.0/24 to=(null)/0 tos=0 fwmark=0/0 table=12
RULE=from=250.250.250.0/24 to=(null)/0 tos=0 fwmark=0/0 table=11
2017-11-27 10:06:55 +00:00
Lennart Poettering 401e33ed56 logind: make sure we don't acces m->action_what if it's not initialized (#7475)
Fixes: #7466
2017-11-27 08:15:07 +01:00
Lennart Poettering c8ace1bf5d
Merge pull request #7472 from keszybz/tests-on-a-slow-disk
Tests on a slow disk
2017-11-26 18:37:00 +01:00
Susant Sahani 97e7fb39a8 networkd: DHCP client do not get into a loop while setting MTU (#7460)
Some devices get reset itself while setting the MTU. we get in to a LOOP .
Once the MTU changed then the DHCP client talking with DHCP server never stops.
networkd gets into a loop and generates endless DHCP requests.

fixes #6593
fixes #7380
2017-11-26 15:21:45 +01:00
Zbigniew Jędrzejewski-Szmek 3113b5aca0 test: increase the timeout for hwdb-test
This test does a lot of mmap/madvise/unmmap, which is slow under address sanitizer.
Just increase the timeout to avoid spurious failure.
2017-11-26 15:07:53 +01:00
Zbigniew Jędrzejewski-Szmek 76b38997c9 test: increase timeout for test-journal-enum
This reads the journal from the host system, and in case of a slow
disk, the 30s default can be easily exceeded.
2017-11-26 15:07:53 +01:00
Evgeny Vereshchagin 3f19974091 exec-util: initialize new before using it (#7471)
CID #1383004
2017-11-26 12:46:56 +01:00