Commit Graph

34849 Commits

Author SHA1 Message Date
Lennart Poettering 713998cfc8 tmpfiles: reindent one comment less weirdly 2018-08-08 11:59:39 +02:00
Lennart Poettering a5df05ff20 tmpfiles: use correct error variable 2018-08-08 11:59:39 +02:00
Lennart Poettering 15b45fac87 tmpfiles: clarify that we ignore file attribute setting errors 2018-08-08 11:59:39 +02:00
Lennart Poettering 09f12798c9 tmpfiles: add log message where we previously failed silently 2018-08-08 11:59:39 +02:00
Lennart Poettering 9d874aec45 tmpfiles: use fd_get_path() less excessively
fd_get_path() is an ugly API, as it creates ambiguities related to the
" (deleted)" suffix /proc/$PID/fd/$FD shows. Let's use it a bit less
excessively, and whenever we have a good valid path already, let's
simply pass that along, instead of forgetting it in one stackframe and
reacquiring it in the next.
2018-08-08 11:59:39 +02:00
Yu Watanabe a5ee33b951 syslog: fix segfault in syslog_parse_priority() 2018-08-08 18:27:15 +09:00
Marc-Antoine Perennou 8e7ab35744 kernel-install: don't try to run depmod when kernel doesn't support modules
Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-08-08 10:42:04 +02:00
Yu Watanabe b9b8874f8f journal: fix size of buffer 2018-08-08 17:17:23 +09:00
Yu Watanabe 1f66559ca2 resolve: use memcmp_safe() and memcpy_safe()
As the length of salt in NSEC3 may be zero.

Fixes #9757.
2018-08-08 17:11:56 +09:00
Yu Watanabe f30faf854b util: introduce memcmp_safe() 2018-08-08 17:11:50 +09:00
Yu Watanabe 7e8d494b33 core: use memcpy_safe()
Fixes #9738.
2018-08-08 17:11:43 +09:00
Yu Watanabe a6aadf4ae0 journal: fix syslog_parse_identifier()
Fixes #9829.
2018-08-08 17:10:56 +09:00
Yu Watanabe 75f8d86eea journal: do not use newa() or strjoina() for message
Fixes another issue reported in #9795.
2018-08-08 17:10:21 +09:00
Yu Watanabe 7289c769fb journal: do not hide options in help message
Even if built without gcrypt, show the relevant options in help message.
Otherwise, the help message diverges from the man page or suggestions
by the shell completion.
2018-08-08 15:29:18 +09:00
Yu Watanabe 652e39a378 bash-completion: journalctl: add --grep and --case-sensitive 2018-08-08 15:26:38 +09:00
Yu Watanabe 57019d5f75 journal: do not pass a negative value to memcpy()
The message may contains only whitespaces.

Fixes #9795.
2018-08-08 12:40:47 +09:00
Yu Watanabe 8fa266c2a4 man: mention that DUIDType=link-layer-time or link-layer uses MAC address 2018-08-08 10:15:00 +09:00
Yu Watanabe 0cf7c3fd21 network: accept additional time-value after ':' when DUIDType=link-layer-time 2018-08-08 10:15:00 +09:00
Yu Watanabe 7e90a499ab sd-dhcp: make time value for DUID-LLT configurable 2018-08-08 10:15:00 +09:00
Yu Watanabe 335f80a612 sd-dhcp: use MAC address when DUIDType=link-layer-time or link-layer but DUIDRawData= is not set 2018-08-08 10:15:00 +09:00
Yu Watanabe f7708f3ffd sd-dhcp: adjust log message 2018-08-08 10:15:00 +09:00
Yu Watanabe 9d7b8c66f5 sd-dhcp: adjust type of elements in duid
These values should be stored in network byte order.
2018-08-08 10:15:00 +09:00
Yu Watanabe 319b94bca7 man: mention that DUIDType=uuid uses the product UUID or machine-ID 2018-08-08 10:15:00 +09:00
Yu Watanabe 27dfc98275 network: request product UUID when DUIDType=uuid but DUIDRawData= is not set
Closes #9228.
2018-08-08 10:15:00 +09:00
Yu Watanabe fff1f40c9b network: introduce dhcp4_set_client_identifier() to unify duplicated codes 2018-08-08 10:15:00 +09:00
Yu Watanabe f24648a66c network: move and rename link_duid() 2018-08-08 10:15:00 +09:00
Yu Watanabe 27eba50e76 sd-dhcp: use application specific machine ID when DUIDType=uuid but DUIDRawData= is not set 2018-08-08 10:15:00 +09:00
Yu Watanabe 21e627daa5 hostname: expose product UUID on bus 2018-08-08 10:15:00 +09:00
Thomas Haller cc2ff878fa link: fix type for link-config's "features" array of tristates
The "features" fields is parsed as a tristate value. The values
are thus not of type NetDevFeature enum but int. The NetDevFeature
enum is instead the index for the features array.

Adjust the type. In practice, this had no impact because NetDevFeature
enum commonly has size of int.

Also, don't use memset() 0xFF to initilize the int with -1. While
it works correctly in practice, it feels ugly.
2018-08-07 15:40:39 +02:00
Yu Watanabe ef6e83f02b test: cast values in proper type to suppress warnings
Follow-up for #9789.
2018-08-07 15:40:16 +02:00
Lennart Poettering 91f4424012
Merge pull request #9817 from yuwata/shorten-error-logging
tree-wide: Shorten error logging and several code cleanups
2018-08-07 10:44:44 +02:00
Lennart Poettering 6f663594bc
Merge pull request #9744 from yuwata/fix-9737
Make RootImage= work with PrivateDevices=
2018-08-07 09:55:07 +02:00
Michael 'pbone' Pobega fc0bb34db3 hwdb: redefine Lenovo ThinkPad X140e touchpad dimensions (#9818)
The default setup for the Lenovo ThinkPad X140e is 104x104mm, and the kernel
claims that it's 64x21. The default 104x104mm dimensions causes the vertical
axis to act oddly, causing random vertical jitters and higher vertical
sensitivity.

Measuring it showed that it was 74x32, and these touchpad dimensions provide
a better (if a little bit slower) experience but a consistent sensitivity
in all directions.

These values were obtained using the `touchpad-edge-detector` tool.
2018-08-07 17:41:49 +10:00
Lennart Poettering 2ed7449fcb
Merge pull request #9789 from filbranden/cmp1
Add new CMP(a, b) macro
2018-08-07 09:39:26 +02:00
Filipe Brandenburger adb6cd9be2 systemctl: add support for --wait to is-system-running
This makes it possible to wait until boot is finished without having to poll
for this command repeatedly, instead using the syntax:

  $ systemctl is-system-running --wait

Waiting is implemented by waiting for the StartupFinished signal to be posted
on the bus.

Register the matcher before checking for the property to avoid race conditions.

Tested by artificially delaying startup with a oneshot service and calling this
command, checked that it emitted `running` and exited with a 0 return code as
soon as the delay service completed startup.

Also tested that booting to degraded state unblocks the command.

Inserted a delay between getting the property and waiting for the signal and
confirmed this seems to work free of race conditions.

Updated the --help text (under --wait) and the man page to document the new
feature.
2018-08-07 09:33:25 +02:00
Yu Watanabe fc95c359f6 tree-wide: use returned value from log_*_errno() 2018-08-07 15:48:37 +09:00
Filipe Brandenburger b994fe95a1 dns-domain: use CMP() in dns_name_compare_func 2018-08-06 19:26:44 -07:00
Filipe Brandenburger 53c5797fbd resolve: use CMP() in dns_resource_record_compare_func
This function doesn't really implement ordering, but CMP() is still fine to use
there. Keep the comment in place, just update it slightly to indicate that.
2018-08-06 19:26:44 -07:00
Filipe Brandenburger a0edd02e43 tree-wide: Convert compare_func's to use CMP() macro wherever possible.
Looked for definitions of functions using the *_compare_func() suffix.

Tested:
- Unit tests passed (ninja -C build/ test)
- Installed this build and booted with it.
2018-08-06 19:26:35 -07:00
Filipe Brandenburger 26cdf3e50b network: Use CMP() macro for comparison.
Follow up for PRs #9764 and #9760.
2018-08-06 19:19:12 -07:00
Filipe Brandenburger 84fb2131d0 macros: add CMP(a, b) macro.
Macro returns -1, 0, 1 depending on whether a < b, a == b or a > b.

It's safe to use on unsigned types.

Add tests to confirm corner cases are properly covered.
2018-08-06 19:19:05 -07:00
Filipe Brandenburger 117efe065a macro: drop __extension__, reformat and reindent
Drop __extension__, since we don't use gcc -Wpedantic or -ansi.

Reformat code for spacing. Add spaces after commas almost everywhere.
Reindent code blocks in macro definitions, for consistency.
2018-08-06 19:15:02 -07:00
Yu Watanabe 4ae25393f3 tree-wide: shorten error logging a bit
Continuation of 4027f96aa0.
2018-08-07 10:14:33 +09:00
Yu Watanabe 906119c046 resolve: use _cleanup_ attribute 2018-08-07 10:13:44 +09:00
Yu Watanabe 354f62cf3c machine: use free_and_replace() and TAKE_PTR() 2018-08-07 10:11:56 +09:00
Yu Watanabe fb2367edd9 login: use free_and_replace() and TAKE_PTR() 2018-08-07 10:10:12 +09:00
Yu Watanabe 73e47c42ab initctl: do not ignore errors in function 2018-08-07 10:06:49 +09:00
Lennart Poettering 4027f96aa0 machinectl: shorten error logging a bit 2018-08-07 08:58:36 +09:00
Shawn Landden 6a5558491b sd-bus: fix test cases on host handling 2018-08-06 14:30:53 -07:00
Zbigniew Jędrzejewski-Szmek 8a0c1913e0 test-bus-address: a simple test for address parsing 2018-08-06 14:30:53 -07:00