Commit graph

32618 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 48af1eb6ee Merge pull request #8086 from hdante/sdboot-setmode-v2 2018-03-07 10:41:44 +01:00
Zbigniew Jędrzejewski-Szmek 595ced4d81
Merge pull request #7817 from medhefgo/systemd-boot
systemd-boot improvements
2018-03-07 10:14:41 +01:00
Zbigniew Jędrzejewski-Szmek 70756b3b4d systemd-boot: fix off-by-one buffer overrun
We'd allocate a buffer of some size and then write zero to the byte one after.
2018-03-07 09:03:23 +01:00
Zbigniew Jędrzejewski-Szmek 12643e7c43 systemd-boot: reduce indentation in config_entry_add_linux()
No functional change.
2018-03-07 09:03:18 +01:00
Jan Janssen 4c8c9f9f8a systemd-boot: Try harder not to add ourselves to the list
We don't need to check if we are adding ourselves to the list
if we know that it's the windows or EFI shell loaders.

If we are adding the EFI default loader, additionally try to
see if we can find the systemd-boot magic string and skip
this entry if we do.
2018-03-07 09:03:18 +01:00
Zbigniew Jędrzejewski-Szmek f6a8265b9a core: drop unnecessary __useless_struct_to_allow_trailing_semicolon__
ISO C does not allow empty statements outside of functions, and gcc
will warn the trailing semicolons when compiling with -pedantic:

  warning: ISO C does not allow extra ‘;’ outside of a function [-Wpedantic]

But our code cannot compile with -pedantic anyway, at least because

  warning: ISO C does not support ‘__PRETTY_FUNCTION__’ predefined identifier [-Wpedantic]

Without -pedatnic, clang and even old gcc (3.4) generate no warnings about
those semicolons, so let's just drop __useless_struct_to_allow_trailing_semicolon__.
2018-03-06 10:41:41 +01:00
Zbigniew Jędrzejewski-Szmek eef03d70c1 basic/cgroup-util: remove unused variable 2018-03-06 10:41:41 +01:00
Tomasz Torcz 07a35e846b NEWS: fix typos in v238 section (#8369) 2018-03-06 17:35:47 +09:00
Yu Watanabe 694d57655c rpm: add missing '-p <lua>' in trigger script (#8367)
Follow-up for 32a00a9c09 (#8090).
2018-03-06 08:02:44 +01:00
Evegeny Vereshchagin 9a92e25545 tests: close a leftover file descriptor in test-fileio
This should make it a bit easier to search for real file descriptor leaks.

```
$ valgrind --leak-check=full --track-fds=yes ./build/test-fileio
...
==29457==
==29457== FILE DESCRIPTORS: 4 open at exit.
==29457== Open file descriptor 3: /tmp/test-systemd_writing_tmpfile.lyV5Rc
==29457==    at 0x4B9AD9E: open (open.c:43)
==29457==    by 0x4B19B24: __gen_tempname (tempname.c:261)
==29457==    by 0x4BA5CC3: mkostemp64 (mkostemp64.c:32)
==29457==    by 0x48F739B: mkostemp_safe (fileio.c:1206)
==29457==    by 0x10D968: test_writing_tmpfile (test-fileio.c:620)
==29457==    by 0x10E930: main (test-fileio.c:767)
==29457==
```
2018-03-05 22:17:23 +00:00
Zbigniew Jędrzejewski-Szmek 738ab7502a
Merge pull request #8362 from keszybz/release-238
Release 238
2018-03-05 23:16:37 +01:00
Zbigniew Jędrzejewski-Szmek e6131c6ea6
Merge pull request #8358 from fbuihuu/tmpfiles-dont-resolve-pathnames-when-traversing-recursively
Tmpfiles dont resolve pathnames when traversing recursively
2018-03-05 23:15:56 +01:00
Evegeny Vereshchagin 362973902c tests: stop using freopen in test-fileio
This helps get around a bug confusing `glibc` and making the test bail
out with the following error under `asan` on `x86`:

Fatal error: glibc detected an invalid stdio handle
Aborted (core dumped)

The bug has been reported in https://github.com/google/sanitizers/issues/778,
but it is unlikely to be fixed anytime soon.
2018-03-05 21:57:14 +00:00
Franck Bui e04fc13f5f test: add tests for systemd-tmpfiles 2018-03-05 21:49:11 +01:00
Franck Bui caced73270 test: fix setup_suse() to make it work with an already populated root 2018-03-05 19:24:23 +01:00
Franck Bui 936f6bdb80 tmpfiles: don't resolve pathnames when traversing recursively through directory trees
Otherwise we can be fooled if one path component is replaced underneath us.

The patch achieves that by always operating at file descriptor level (by using
*at() helpers) and by making sure we do not any path resolution when traversing
direcotry trees.

However this is not always possible, for instance when listing the content of a
directory or some operations don't provide the *at() helpers or others (such as
fchmodat()) don't have the AT_EMPTY_PATH flag. In such cases we operate on
/proc/self/fd/%i pseudo-symlink instead, which works the same for all kinds of
objects and requires no checking of type beforehand.

Also O_PATH flag is used when opening file objects in order to prevent
undesired behaviors: device nodes from reacting, automounts from
triggering, etc...

Fixes: #7986
Fixes: CVE-2018-6954
2018-03-05 19:00:11 +01:00
Franck Bui 56114d45d0 tmpfiles: fstat() works with fd opened with O_PATH since Linux 3.6 2018-03-05 19:00:11 +01:00
Franck Bui 774f79b570 tmpfiles: make hardlink_vulnerable() argument constant 2018-03-05 19:00:11 +01:00
Zbigniew Jędrzejewski-Szmek de5fbba9e2
Merge pull request #8341 from yuwata/test-execute-ambient
test-execute: check capabilities before runnig tests
2018-03-05 17:45:28 +01:00
Zbigniew Jędrzejewski-Szmek c657bff1d5 NEWS: bump version and add contributors 2018-03-05 17:22:09 +01:00
Zbigniew Jędrzejewski-Szmek ad6a085310 meson: bump so revision and systemd version in preparation for v238 2018-03-05 17:21:09 +01:00
Zbigniew Jędrzejewski-Szmek 72dea211d4 mailmap: one more person 2018-03-05 17:21:09 +01:00
Zbigniew Jędrzejewski-Szmek 8c6414be15
Merge pull request #8345 from sourcejedi/logind_restart_is_sorely_lacking_in_testing
login: fix for #8343
2018-03-05 17:18:47 +01:00
Zbigniew Jędrzejewski-Szmek b719b66b0a
Merge pull request #8354 from keszybz/new-NEWS
NEWS for v238
2018-03-05 17:16:04 +01:00
Filipe Brandenburger 2ea09665e2 mkosi: use locale that supports UTF-8, detect one that is available (#8340)
Using C.UTF-8 (as was done before #7244) breaks Arch Linux, but using
en_US.UTF-8 (after #7244) breaks Debian in our .mkosi/mkosi.debian.

So try to detect which one is available and works, first checking
whether we're already running under a valid UTF-8 locale, then trying
C.UTF-8 and finally en_US.UTF-8.

If we fail to find a valid UTF-8 locale, then fail early, instead of
letting the whole build complete only for Mesos to fail midway through
the `ninja test` step.

Tested on all of mkosi.fedora, mkosi.debian and mkosi.arch.

Fixes: #7238
2018-03-05 17:03:52 +01:00
Marco Gulino 81818edc7a Add accel matrix for iOTA 360 (#8342) 2018-03-05 16:47:28 +01:00
Zbigniew Jędrzejewski-Szmek 313c32c3a4 NEWS: update for v238 2018-03-05 16:42:04 +01:00
Zbigniew Jędrzejewski-Szmek c8fad2e7db man: just use unicode for an mdash 2018-03-05 09:31:17 +01:00
Zbigniew Jędrzejewski-Szmek 46dcfbbdb6 basic/glob-util: do not use names with "_" prefix
Names starting with _ or __ are reserved by the standard, better to
avoid them.
2018-03-05 09:04:39 +01:00
Yu Watanabe e8fb0238cd coredump: do not leak memory (#8352)
Fixes #8351.
2018-03-05 08:39:52 +01:00
Yu Watanabe e5ba1d324d test-execute: use CAP_CHOWN instead of CAP_NET_ADMIN
CAP_NET_ADMIN is somtrimes dropped by container runtime.
This changes to use CAP_CHOWN instead of CAP_NET_ADMIN, as it is
less likely to be dropped.
2018-03-05 00:02:22 +09:00
Yu Watanabe b7856f9218 test-execute: check capabilities before running tests
Fixes #8193.
2018-03-05 00:00:35 +09:00
Andika Triwidada a8170f9a3f po: Updated Indonesian translation (#8348) 2018-03-04 21:15:21 +09:00
SjonHortensius fe4a1d0f0d fixed 3 occurences of 'Failed top open' (#8349) 2018-03-04 21:12:45 +09:00
Yu Watanabe 5cd33ccc2c test-execute: change log level from error to notice
Skipping some tests due to the missing e.g., capsh binary
or kernel support, are not error.
This changes the log level for such messages.
2018-03-04 16:53:50 +09:00
Yu Watanabe b6dc25eebc test-execute: rename tests for AmbientCapabilities=
The unit files for test-execute are named like
`exec-(setting-name-in-lower-character)-(optional-text).service`.
However, test units for AmbientCapabilities= are not following this.
So, let's rename them for the consistency.
This does not change anything in the functionality of the test.
2018-03-04 16:37:58 +09:00
snorreflorre d5339ab123 hwdb: add axis range corrections for the Lenovo ThinkPad Edge 13 (02173BG) (#8253) 2018-03-04 08:18:46 +01:00
Alan Jenkins f8f9419e87 login: remember that fds received from PID1 need to be removed eventually
Remember to set sd->pushed_fd when we receive an fd from PID1 on startup,
the same as we set it when we send an fd to PID1.
2018-03-03 20:51:45 +00:00
Alan Jenkins b5cdfa40ca login: fix FDNAME in call to sd_pid_notify_with_fds()
$ git grep FDNAME
logind-session-device.c: ... "FDNAME=session-", sd->session->id);
logind-session-device.c: ... "FDNAME=session", sd->session->id);

Oops.

Fixes #8343.  Or at least a more minimal reproducer.  Xorg still
dies when logind is restarted, but the Xorg message says this
is entirely deliberate.

(This could also be the reason I hit #8035, instead of the race
condition I originally suggested).
2018-03-03 20:50:18 +00:00
Lennart Poettering cb77e12288 update TODO 2018-03-02 16:26:03 +01:00
Lennart Poettering 2eee2088d2 man: briefly document the resolvconf(8) compatibility interface 2018-03-02 15:48:46 +01:00
Lennart Poettering 088c136384 resolve-tool: provide resolvconf(8) compatibility
This turns resolve-tool into a multi-call binary. When invoked as
"resolvconf" it provides minimal compatibility with the resolvconf(8)
tool of various distributions (and FreeBSD as it appears).

This new interface understands to varying degrees features of the two
major implementations of resolvconf(8): Debian's original one and
"openresolv". Specifically:

Fully supported:

        -a -d (supported by all implementations)
        -f    (introduced by openresolv)

Somewhat supported:

        -x    (introduced by openresolv, mapped to a '~.' domain entry)

Unsupported and ignored:

        -m -p (introduced by openresolv, not really necessary for us)

Unsupported and resulting in failure:
        -u    (supported by all other implementations)
        -I -i -l -R -r -v -V
              (all introduced by openresolv)
        --enable-updates --disable-updates --updates-are-enabled
              (specific to Debian's implementation)

Of course, resolvconf(8) is a tool with multiple backends, in our
implementation systemd-resolved is the only backend.

Fixes: #7202
2018-03-02 15:48:46 +01:00
Lennart Poettering 6cc7e918ff
Merge pull request #8314 from poettering/rearrange-stdio
refactor how we rearrange fds for stdin/stdout/stderr
2018-03-02 15:42:03 +01:00
Lennart Poettering 7ddcdb6072
units: use SuccessAction=reboot where appropriate (#8335)
We should really use our own native concepts for rebooting.
2018-03-02 15:41:36 +01:00
Lennart Poettering 650f401123
Merge pull request #8336 from poettering/coccinelle-reallocarray
reallocarray() coccinellization
2018-03-02 15:40:52 +01:00
Lennart Poettering 774a928abf
Merge pull request #8333 from keszybz/hwdb-update
Hwdb update
2018-03-02 15:40:21 +01:00
Zbigniew Jędrzejewski-Szmek a478fb9229
Merge pull request #8337 from poettering/resolve-fixes
various resolve-tool fixes
2018-03-02 13:33:54 +01:00
Lennart Poettering f7a4bd9527 man: there's no point in referenceing systemd.unit(5) from itself (#8338) 2018-03-02 13:33:29 +01:00
Zbigniew Jędrzejewski-Szmek 3cca71c456
Merge pull request #8323 from xyproto/ok_color
Make the color of the status OK configurable at build-time
2018-03-02 13:00:07 +01:00
Michael Vogt 1825c909ff sysusers: support u username -:300 style syntax (#8325)
This PR implements the first part of RFE #8046. I.e. this allows to
write:
```
u username -:300
```
Where the uid is chosen automatically but the gid is fixed.
2018-03-02 12:56:44 +01:00