Zbigniew Jędrzejewski-Szmek
b921fcb2ac
networkd: fix memleak of Rules
...
This was the issue mentioned in 93f9da6e0a .
2017-11-28 21:34:50 +01:00
Zbigniew Jędrzejewski-Szmek
f916819053
journal: use new helpers with journal_file_close
...
journal_file_close_set() is not necessary anymore.
2017-11-28 21:34:50 +01:00
Zbigniew Jędrzejewski-Szmek
1599f593d6
journal-remote: add helper function and use hashmap_free_with_destructor
2017-11-28 21:34:46 +01:00
Zbigniew Jędrzejewski-Szmek
6dd1c36839
cryptsetup-generator: add helper function and use hashmap_free_with_destructor
2017-11-28 21:34:41 +01:00
Zbigniew Jędrzejewski-Szmek
39ab16e397
coredump: fix typo and use hashmap_free_with_destructor
2017-11-28 21:34:34 +01:00
Zbigniew Jędrzejewski-Szmek
e85b096b43
machine-image: convert image_hashmap_free() to an static inline helper
2017-11-28 21:30:43 +01:00
Zbigniew Jędrzejewski-Szmek
224b0e7ad0
Add set/hashmap helpers for non-trivial freeing and use where straighforward
...
A macro is needed because otherwise we couldn't ensure type safety.
Some simple tests are included.
No functional change intended.
2017-11-28 21:30:30 +01:00
Zbigniew Jędrzejewski-Szmek
ec1d290903
Use hashmap_free_free where appropriate
2017-11-28 21:26:37 +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