1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00
Commit Graph

37895 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
1b2a7d92af Fix a few comments 2019-01-08 23:11:26 +01:00
Zbigniew Jędrzejewski-Szmek
2cfb197890 sd-device: modernize code a bit
Empty line between setting the output parameter and return is removed. I like
to think about both steps as part of returning from the function, and there's
no need to separate them.

Similarly, if we need to unset a pointer after successfully passing ownership,
use TAKE_PTR and do it immediately after the ownership change, without an empty
line inbetween.
2019-01-08 22:14:06 +01:00
Yu Watanabe
82d9ac23fd udev-node: make link_find_prioritized() return negative value when nothing found
Fixes a bug introduced by a2554acec6.

Fixes RHBZ#1662303.
2019-01-08 19:21:44 +01:00
dana
c501ecd70c zsh completion: Prevent functions from clobbering each other, &c.
- Don't redefine helpers on every call
- Prefix helper names with main function name
- Adjust some helper names for consistency and convention adherance
2019-01-08 15:23:37 +01:00
marvelousblack
f047466041 Add Teclast X80 PLUS (H5C5) accel mount matrix 2019-01-08 15:09:08 +01:00
Zbigniew Jędrzejewski-Szmek
f0560c7453
Merge pull request #11355 from yuwata/rfe-11343
conf-parse: accept whitespaces before comments
2019-01-08 15:07:33 +01:00
Lennart Poettering
3f1af087a9
Merge pull request #11352 from yuwata/rfe-11348
core/socket: logs address or path which fails to be initialized
2019-01-08 11:43:35 +01:00
Claudius Ellsel
0919362b31 Unchain not related mice in 70-mouse.hwdb 2019-01-08 10:40:09 +01:00
Michael Sloan
a08c3e8f25 cat: add --stderr-priority option 2019-01-08 10:37:20 +01:00
Zbigniew Jędrzejewski-Szmek
c64715b5cb
Merge pull request #11344 from poettering/various-fixes
multiple trivial fixlets, across the tree
2019-01-08 10:33:09 +01:00
Yu Watanabe
c494b739a4 udevadm: refuse to run trigger, control, settle and monitor commands in chroot
Closes #11333.
2019-01-08 10:31:19 +01:00
Yu Watanabe
787a133f2d NEWS: also mention that clock file for timesyncd may need to move
Follow-up for aa2437e2ae.

Closes #11329.
2019-01-08 10:20:33 +01:00
Yu Watanabe
ff650ffe34 test: add testcases for the lines prefixed with whitespaces 2019-01-08 14:12:22 +09:00
Yu Watanabe
b41dd0d2db conf-parser: accept whitespaces before comments
Closes #11343.
2019-01-08 14:05:15 +09:00
Yu Watanabe
71b21730d4 conf-parser: mention that unknown lvalue is ignored 2019-01-08 12:50:58 +09:00
Yu Watanabe
bca3222cd6
Merge pull request #11351 from yuwata/ethtool-port-table
ethtool: cleanups for port_table
2019-01-08 12:23:11 +09:00
Yu Watanabe
c226800996
Merge pull request #11232 from yuwata/fix-9130-alternative
network: always check link is ready when address is updated
2019-01-08 12:22:21 +09:00
Yu Watanabe
ae05e1b658 core/socket: logs address or path which fails to be initialized
Closes #11348.
2019-01-08 04:40:46 +09:00
Yu Watanabe
e541734528 core/socket: use _cleanup_ attribute for closing fds on error 2019-01-08 04:11:59 +09:00
Yu Watanabe
fc2d74ab05 core/socket: use log_unit_*() 2019-01-08 04:11:45 +09:00
Yu Watanabe
44909f1c9f ethtool: minimize the size of port_table
Note that `_NET_DEV_PORT_MAX` is 0x100.
2019-01-08 03:30:15 +09:00
Yu Watanabe
1637c3575b ethtool: use kernel defined values for NET_DEV_PORT_* 2019-01-08 03:28:47 +09:00
Zbigniew Jędrzejewski-Szmek
a75211421f udev: rework how we handle the return value from spawned programs
When running PROGRAM="...", we would log
systemd-udevd[447]: Failed to wait spawned command '...': Input/output error
no matter why the program actually failed, at error level.

The code wouldn't distinguish between an internal failure and a failure in the
program being called and run sd_event_exit(..., -EIO) on any kind of error. EIO
is rather misleading here, becuase it suggests a serious error.

on_spawn_sigchld is updated to set the return code to distinguish failure to
spawn, including the program being killed by a signal (a negative return value),
and the program failing (positive return value).

The logging levels are adjusted, so that for PROGRAM= calls, which are
essentially "if" statements, we only log at debug level (unless we get a
timeout or segfault or another unexpected error).
2019-01-07 18:36:04 +01:00
Lennart Poettering
be0b7a1a66 tree-wide: always declare bitflag enums the same way
let's always use the 1 << x syntax. No change of behaviour or even of
the compiled binary.
2019-01-07 17:50:39 +01:00
Lennart Poettering
f8c186c9ec json: handle NULL explicitly in json_variant_has_type() 2019-01-07 17:50:39 +01:00
Lennart Poettering
6af022fedd json: fix typo 2019-01-07 17:50:39 +01:00
Lennart Poettering
fc0f6fbffc json: teach json_log() the new SYNTHETIC_ERRNO() logic 2019-01-07 17:50:39 +01:00
Lennart Poettering
16420be1fd loop-util: tweak codepath when a loopback file is "created" from an existing block device
Be more careful with initialized of the 'relinquished' boolean field,
and let's return the fd, like we do for the regular codepath, too.
2019-01-07 17:50:39 +01:00
Lennart Poettering
26c1be0fdc loop-util: minor simplification 2019-01-07 17:50:39 +01:00
Lennart Poettering
cbf13087cc fsck: use symbolic names where we have them 2019-01-07 17:50:39 +01:00
Lennart Poettering
aebfc8f090 stat-util: remove spurious newline 2019-01-07 17:50:39 +01:00
Lennart Poettering
6eab5f0656 env-util: normalize one more flags enum 2019-01-07 17:50:39 +01:00
Lennart Poettering
f2e28b5a0d
Merge pull request #11327 from keszybz/revert-dbus-address
Revert "pam_systemd: drop setting DBUS_SESSION_BUS_ADDRESS"
2019-01-07 16:14:07 +01:00
Frantisek Sumsal
4a2c3dc318
Merge pull request #11252 from evverx/use-asan-wrapper-on-travis-ci
travis: run PID1, journald and everything else under ASan+UBsan
2019-01-06 18:48:38 +01:00
Lennart Poettering
5f99550afe
Merge pull request #11241 from bengal/lldp-802-3-subtypes
lldp: add 802.3 OUI subtype definitions
2019-01-06 18:15:51 +01:00
Zbigniew Jędrzejewski-Szmek
69bd76f2b9 pam_systemd: set $DBUS_SESSION_BUS_ADDRESS unconditionally
There's very little lost if the variable is set for a socket that isn't
connectible, but a lot lost (races, ...) if it's not set but the socket exists.

Also, drop the FIXME note, since we don't plan to revert this revert any time
soon.
2019-01-06 17:37:00 +01:00
Lennart Poettering
7b77689c30
Merge pull request #11328 from keszybz/static-array-size-declarations
Use a c99 feature for additional code analysis
2019-01-06 14:06:59 +01:00
Lucas Werkmeister
4fa226ff3b man: systemctl: document effect of --all on journal output
Based on the journalctl documentation of this option added in 23ad99b519
(#10527), but with the first reference to “fields” replaced by “journal
messages”, since I think it’s less common to show other fields with
`systemctl status` (though it’s possible with the `-o` option).
2019-01-06 14:03:16 +01:00
Zbigniew Jędrzejewski-Szmek
f1028f5766 Print the systemd version in a format that dracut likes
- systemd 240-63-g4199f68+
+ systemd 240 (240-63-g4199f68+)

Sad, but easy.

Fixes #11330.
2019-01-06 13:57:31 +01:00
Lennart Poettering
2004fce186
Merge pull request #11337 from keszybz/build-version-h
meson: declare version.h as dep for libbasic
2019-01-06 13:55:10 +01:00
James Hilliard
50f2fc77d7 Disable tools/choose-default-locale.sh when cross compiling 2019-01-06 13:51:18 +01:00
Zbigniew Jędrzejewski-Szmek
63058f432b Revert "meson: declare version.h as dep for fuzzers"
This reverts commit 0c2e93b863.

This should not be necessary anymore after previous commit.
I don't quite remember what sequence of steps was failing, but right now
"meson build -Dslow-tests=true && ninja -C build fuzzers" work fine.
2019-01-05 13:30:24 +01:00
Zbigniew Jędrzejewski-Szmek
df93e8ef05 meson: declare version.h as dep for libbasic
"meson build && ninja -C build systemd-cat" would fail on missing version.h.

Fixes #11335.
2019-01-05 13:30:23 +01:00
Zbigniew Jędrzejewski-Szmek
4199f6896a Use c99 static array size declarations in exported functions too
It seems quite useful to provide this additional information in public exported
functions.

This is a c99 feature, not supported in C++. Without the check in _sd-common.h:
FAILED: test-bus-vtable-cc@exe/src_libsystemd_sd-bus_test-bus-vtable-cc.cc.o
...
In file included from ../src/libsystemd/sd-bus/test-bus-vtable-cc.cc:9:
In file included from ../src/systemd/sd-bus-vtable.h:26:
In file included from ../src/systemd/sd-bus.h:26:
../src/systemd/sd-id128.h:38:47: error: static array size is a C99 feature, not permitted in C++
char *sd_id128_to_string(sd_id128_t id, char s[static SD_ID128_STRING_MAX]);
                                              ^

In .c files, I opted to use the define for consistency, even though we don't support
compilation with a C++ compiler, so the unconditional keyword would work too.
2019-01-04 12:37:25 +01:00
Zbigniew Jędrzejewski-Szmek
3042bbebdd tree-wide: use c99 static for array size declarations
https://hamberg.no/erlend/posts/2013-02-18-static-array-indices.html

This only works with clang, unfortunately gcc doesn't seem to implement the check
(tested with gcc-8.2.1-5.fc29.x86_64).

Simulated error:
[2/3] Compiling C object 'systemd-nspawn@exe/src_nspawn_nspawn.c.o'.
../src/nspawn/nspawn.c:3179:45: warning: array argument is too small; contains 15 elements, callee requires at least 16 [-Warray-bounds]
                        candidate = (uid_t) siphash24(arg_machine, strlen(arg_machine), hash_key);
                                            ^                                           ~~~~~~~~
../src/basic/siphash24.h:24:64: note: callee declares array parameter as static here
uint64_t siphash24(const void *in, size_t inlen, const uint8_t k[static 16]);
                                                               ^~~~~~~~~~~~
2019-01-04 12:37:25 +01:00
Zbigniew Jędrzejewski-Szmek
00efd4988b Revert "pam_systemd: drop setting DBUS_SESSION_BUS_ADDRESS"
This reverts commit 2b2b7228bf.

Fixes #11293.

Removing the environment variable causes problems, e.g. Xfce and Chromium and
... don't communicate with the running dbus instance. If they attempt to start their
own instance, things become even more confusing. Those packages could be fixed
one by one, but removing the variable right now is causing too many problems.
2019-01-04 11:19:10 +01:00
Zbigniew Jędrzejewski-Szmek
d27d60b3bc
Merge pull request #11317 from filbranden/docs1
Improvements to systemd.io generation
2019-01-03 18:38:57 +01:00
Zbigniew Jędrzejewski-Szmek
88514e7bae
Merge pull request #11244 from yuwata/revert-udev-changes
udev: revert bind/unbind patch and one more
2019-01-03 16:28:30 +01:00
Zbigniew Jędrzejewski-Szmek
9ef36967c8
Merge pull request #11250 from yuwata/dhcp-coding-style-fixes
dhcp,network: trivial coding style fixes
2019-01-03 15:12:12 +01:00
Yu Watanabe
577ab71c58 libudev-util: make util_replace_whitespace() read only len characters
This effectively reverts df8ba4fa0e.

Fixes #11264.
2019-01-03 15:10:57 +01:00