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

37952 Commits

Author SHA1 Message Date
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
YunQiang Su
f5855697aa Pass separate dev_t var to device_path_parse_major_minor
MIPS/O32's st_rdev member of struct stat is unsigned long, which
is 32bit, while dev_t is defined as 64bit, which make some problems
in device_path_parse_major_minor.

Don't pass st.st_rdev, st_mode to device_path_parse_major_minor,
while pass 2 seperate variables. The result of stat is alos copied
out into these 2 variables. Fixes: #11247
2019-01-03 15:04:08 +01:00
Zbigniew Jędrzejewski-Szmek
7dcec38542
Merge pull request #11273 from pseyfert/zsh-debugger-completion
zsh/coredumpctl: additional completions
2019-01-03 15:00:26 +01:00
howl
9387953c9a hwdb: Add Lenovo IdeaPad D330 accel mount matrix
I have the fhd screen with pentium without lte model. Don't know if other models could differ in the accelerometer.
2019-01-03 14:58:37 +01:00
Daniele Medri
7eca55075f po: update Italian translation 2019-01-03 14:44:55 +01:00
Yu Watanabe
d25e127dbe sleep: install default sleep.conf
Closes #11310.
2019-01-03 14:43:15 +01:00
Zbigniew Jędrzejewski-Szmek
aa70783f55 test-json: check absolute and relative difference in floating point test
The test fails under valgrind, so there was an exception for valgrind.
Unfortunately that check only works when valgrind-devel headers are
available during build. But it is possible to have just valgrind installed,
or simply install it after the build, and then "valgrind test-json" would
fail.

It also seems that even without valgrind, this fails on some arm32 CPUs.
Let's do the usual-style test for absolute and relative differences.
2019-01-03 21:35:04 +09:00
Yu Watanabe
a92f2af28a
Merge pull request #11230 from keszybz/version-string-alt
Generate version string from git describe (alternative approach)
2019-01-03 21:33:55 +09:00
Yu Watanabe
8a6d06cbaa man: update color of journal logs in DEBUG level
Fixes #11303.
2019-01-02 20:34:24 -08:00
Chris Down
4e1dfa45e9 cgroup: s/cgroups? ?v?([0-9])/cgroup v\1/gI
Nitpicky, but we've used a lot of random spacings and names in the past,
but we're trying to be completely consistent on "cgroup vN" now.

Generated by `fd -0 | xargs -0 -n1 sed -ri --follow-symlinks 's/cgroups?  ?v?([0-9])/cgroup v\1/gI'`.

I manually ignored places where it's not appropriate to replace (eg.
"cgroup2" fstype and in src/shared/linux).
2019-01-03 11:32:40 +09:00
Yu Watanabe
788291d3b4
Merge pull request #11274 from yuwata/fix-11272
network: set link state configuring before setting addresses
2019-01-03 08:29:26 +09:00
Filipe Brandenburger
357211a426 docs: generate index.md in Jekyll
This uses a {% for %} loop in Jekyll to render the page, from the "title"
information in the Front Matter of the actual page files.

This also makes `make-index-md` build rule unnecessary, since generation is
done by the template engine itself.

Tested this by running Jekyll locally.
2019-01-02 14:23:18 -08:00
Filipe Brandenburger
c3e270f4ee docs: add a "front matter" snippet to our markdown pages
It turns out Jekyll (the engine behind GitHub Pages) requires that pages
include a "Front Matter" snippet of YAML at the top for proper rendering.

Omitting it will still render the pages, but including it opens up new
possibilities, such as using a {% for %} loop to generate index.md instead of
requiring a separate script.

I'm hoping this will also fix the issue with some of the pages (notably
CODE_OF_CONDUCT.html) not being available under systemd.io

Tested locally by rendering the website with Jekyll. Before this change, the
*.md files were kept unchanged (so not sure how that even works?!), after this
commit, proper *.html files were generated from it.
2019-01-02 14:16:34 -08:00
Alex Mayer
8d7fac92f0 Docs: Add Missing Space Between Words 2019-01-03 03:07:50 +09:00
Yu Watanabe
6f783ce5f5 test-network: disable DNS function of dnsmasq 2019-01-02 18:37:10 +09:00
Yu Watanabe
0532bd0883 test-network: drop unused variable 2019-01-02 18:37:10 +09:00
Yu Watanabe
094b54790f test: fix neighbor address 2019-01-02 18:37:10 +09:00
Yu Watanabe
2428613f85 network: set *_configured flags to false before requesting addresses or freinds
Fixes #11272.
2019-01-02 18:37:10 +09:00
Yu Watanabe
47079967e6 network: rename link_set_routing_policy_rule() to link_request_set_routing_policy_rule()
For consistency to other functions.
2019-01-02 18:37:10 +09:00
Yu Watanabe
f3ef324dfa network: do not ignore errors on link_request_set_neighbors() and link_set_routing_policy() 2019-01-02 18:37:10 +09:00
Zbigniew Jędrzejewski-Szmek
48020979d6 udevadm: add a workaround for dracut
Also add a comment, so we don't fall into the same trap again.
2019-01-02 10:26:16 +01:00
Zbigniew Jędrzejewski-Szmek
f41c6dba15
Merge pull request #11291 from yuwata/fix-11259
meson: check whether C.UTF-8 exists or not and use it if exists
2019-01-02 09:36:01 +01:00
Burt P
6012eaef6e hwdb/sdio.ids: add BCM43438 + minor rewording of class name
* BCM43438 is used in the Raspberry Pi 3 B and B+
  https://www.raspberrypi.org/products/raspberry-pi-3-model-b/
  "BCM43438 wireless LAN and Bluetooth Low Energy (BLE) on board"
* With this minor change to "C 00", each class name could be prefixed
  with "Is a" and still make sense.

Signed-off-by: Burt P <pburt0@gmail.com>
2019-01-02 08:21:54 +01:00
Zbigniew Jędrzejewski-Szmek
339725910a
Merge pull request #11297 from yuwata/fix-11295
ask-password: fix assertion
2019-01-02 08:19:27 +01:00
Yu Watanabe
4fe0caadc8 test: add test for sending/receiving an invalid device 2019-01-02 04:01:07 +09:00
Yu Watanabe
ff86c92e30 Revert "udevd: configure a child process name for worker processes"
This reverts commit 49f3ee7e74.
2019-01-02 04:01:07 +09:00
Yu Watanabe
b261494128 Revert "sd-device: ignore bind/unbind events for now"
This reverts commit 56c886dc7e.

Fixes #11277 and #11299.
2019-01-02 04:00:14 +09:00
Yu Watanabe
03475e2232 meson: check whether C.UTF-8 exists or not and use it if exists
If C.UTF-8 does not exist, then fallback to en_US.UTF-8 or C.
2019-01-02 03:41:36 +09:00
Paul Seyfert
0e9ab1af64 zsh/coredumpctl: don't print warnings from completion function 2018-12-31 21:27:09 +01:00
Yu Watanabe
18fee12a2d sd-device: fix segfault when error occurs in device_new_from_{nulstr,strv}()
As devpath may not be set yet.

When debug logging is enabled, log_device_*() calls
sd_device_get_sysname(). So, we should not assume that devpath is always
set.

Fixes #11258.
2018-12-30 22:47:20 +09:00
Yu Watanabe
1f00998c87 ask-password-api: do not call ask_password_keyring() if keyname == NULL
Fixes #11295.
2018-12-30 21:13:47 +09:00
Yu Watanabe
8a111277c4 ask-password: make ask_password_keyring() static 2018-12-30 21:09:41 +09:00
ikelos
04ca4d191b Improve kernel-install support for initrd files. (#11281)
The current support in kernel-install for initrd images doesn't copy
over the initrd file or allow a means for it to be specified (it
requires a specific filename in a particular directory).

This patchset adds support for (optionally) providing the name of
initial ramdisk file to copied over and used by kernel-install.
2018-12-30 04:01:10 +09:00
Evgeny Vereshchagin
0d6e61d6a1 tests: introduce check_asan_reports and use it in check_result_{qemu|nspawn} 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
ed4f303f39 tests: look for ASan+UBSan reports in the journal 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
9688fccc27 tests: double DefaultTimeoutStartSec when systemd is run under ASan+UBSan 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
71cf890bcc travis: also run TEST-01-BASIC with QEMU to cover udevd and so on 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
c47bfb198a travis: pass $TRAVIS when running the tests so that they can be skipped properly 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
8934737154 travis: merge RUN_CLANG into RUN
They are basically the same except that a couple of environment variables
have to be passed for building systemd with clang.
2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
082bcdca2c tests: overwrite a hard-coded timeout in systemd-hwdb-update.service 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
ef30f7cac1 journal: rely on _cleanup_free_ to free a temporary string used in client_context_read_cgroup
Closes https://github.com/systemd/systemd/issues/11253.
2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
998445fd8a tests: fail if asan has found issues in journald 2018-12-29 19:14:35 +01:00
Evgeny Vereshchagin
7e11a95e41 tests: reproduce https://github.com/systemd/systemd/issues/11251 2018-12-29 19:14:28 +01:00
Dave Reisner
8ca9e92c74 Make default locale a compile time option
Default to a locale that's guaranteed to exist everywhere, but let
distros override this with something more exotic if they choose to.

Closes #11259.
2018-12-29 21:43:04 +09:00