Commit graph

32920 commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek 2230a2908b man: add a note about $XDG_SEAT and $XDG_VTNR to pam_systemd(8)
Issue #6499 requests that a mention that those varibles can be set in the
environment is added. But the man page already says that. There isn't much
detail, but a man page does not need to and in this case should not include
all the details. Instead a note is added that those vars can be derived from
$DISPLAY.

Closes #6499.
2018-03-24 14:16:31 +01:00
Zbigniew Jędrzejewski-Szmek 8d5a4f27f5 man: add link and list of known attrs to systemd-gpt-auto-generator(8)
Fixes #7859.
2018-03-24 14:16:27 +01:00
Zbigniew Jędrzejewski-Szmek 0760dfc62f man: add missing headers to glib-event-glue.c 2018-03-24 14:15:48 +01:00
Zbigniew Jędrzejewski-Szmek 1027e0dc4d man: fix compilation of journal-iterate-poll.c
Our examples should compile...
2018-03-24 14:15:48 +01:00
Zbigniew Jędrzejewski-Szmek c0be035da7 man: drop license header in glib-event-glue.c
We're moving towards just SPDX license identifiers, and the boilerplate
is especially annoying in a man page. Also adjust to the smaller indentation
to make the code fit better on a page.
2018-03-24 14:15:48 +01:00
Zbigniew Jędrzejewski-Szmek 929f52632b man: move examples out of sd_journal_get_fd into separate files
man/.dir-locals is to keep indentation under control.

This makes it much easier to compile and run those examples, c.f. #7578.

v2:
- copy more of .dir-locals.el from the root to man/.dir-locals.el
  (I though emacs would inherit from the one in the parent dir, but
   it seems it just uses its own broken defaults, including
   indent-tabs-mode by default.)
2018-03-24 14:14:12 +01:00
Yu Watanabe 2892077c93 resolve: actually shows information about all specified interfaces 2018-03-24 17:53:16 +09:00
Zbigniew Jędrzejewski-Szmek 1238250f1d
Merge pull request #8565 from poettering/cocci-again
run all coccinelle again
2018-03-23 19:22:24 +01:00
Zbigniew Jędrzejewski-Szmek 1b25e0351a
Merge pull request #8559 from poettering/integration-test-fixes
make integration tests pass again
2018-03-23 19:21:25 +01:00
Lennart Poettering be6bca47ec coccinelle: run no-if-assignments.cocci again 2018-03-23 16:33:38 +01:00
Lennart Poettering f5c4b520ba coccinelle: run safe_fclose.cocci again 2018-03-23 16:32:48 +01:00
Lennart Poettering d2f646828e coccinelle: run while-true.cocci again 2018-03-23 16:32:26 +01:00
James Cowgill 303d6b4ca6 Partially revert "seccomp: add mmap and address family restrictions for MIPS" (#8563)
This reverts the mmap parts of f5aeac1439,
but keeps the part which restricts address families which works
correctly.

Unfortunately the MIPS toolchains still do not implement PT_GNU_STACK.
This means that while the commit to restrict mmap on MIPS was "correct",
it had the side effect of causing pthread_create to fail because glibc tries
to allocate an executable stack for new threads in the absense of
PT_GNU_STACK. We should wait until PT_GNU_STACK is implemented in all
the relevant parts of the toolchain (at least gcc and glibc) before
enabling this again.
2018-03-23 16:04:16 +01:00
Lennart Poettering 849b610489 run-coccinelle.sh: use set -x for showing command line of "spatch"
Let's make sure run-coccinelle.sh generates similar output as
run-integration-tests.sh, hence use the same "set -x" logic.
2018-03-23 15:46:12 +01:00
Lennart Poettering 34d267776a coccinelle: run const-strlen.cocci again 2018-03-23 15:46:12 +01:00
Lennart Poettering 967bae687c run-integration-tests: show number of tests run 2018-03-23 15:46:11 +01:00
Lennart Poettering ce6b7858ca run-integration-tests: show make command line executed
That makes it much easier to figure out what to type to just run one
specific test for debugging.
2018-03-23 15:45:47 +01:00
Lennart Poettering 67321fdf3e test: bypass selinux integration test if selinux policy devel package is not installed
With this "sudo ./run-integration-tests.sh" should work fully without
exception, even on systems lacking SELinux (in which case that test will
just be skipped)
2018-03-23 15:29:35 +01:00
Lennart Poettering 29f74559d4 stat-util: fix fd_is_network_ns()
This was broken in 77f9fa3b8e. My fault.

Fixes: #8543
2018-03-23 15:29:35 +01:00
Michal Sekletar 19496554e2 core: delay adding target dependencies until all units are loaded and aliases resolved (#8381)
Currently we add target dependencies while we are loading units. This
can create ordering loops even if configuration doesn't contain any
loop. Take for example following configuration,

$ systemctl get-default
multi-user.target

$ cat /etc/systemd/system/test.service
[Unit]
After=default.target

[Service]
ExecStart=/bin/true

[Install]
WantedBy=multi-user.target

If we encounter such unit file early during manager start-up (e.g. load
queue is dispatched while enumerating devices due to SYSTEMD_WANTS in
udev rules) we would add stub unit default.target and we order it Before
test.service. At the same time we add implicit Before to
multi-user.target. Later we merge two units and we create ordering cycle
in the process.

To fix the issue we will now never add any target dependencies until we
loaded all the unit files and resolved all the aliases.
2018-03-23 15:28:06 +01:00
Lennart Poettering 959071cac2
Merge pull request #8552 from keszybz/test-improvements
Test and diagnostics improvements
2018-03-23 15:26:54 +01:00
Lennart Poettering 2f5fa62bf7 tree-wide: tabs suck (#8527) 2018-03-23 15:21:35 +01:00
Lennart Poettering 3e44d24d3b backlight: minor modernizations (#8528)
Use strjoina() and STR_IN_SET()
2018-03-23 15:20:34 +01:00
Zbigniew Jędrzejewski-Szmek 4ddc526ce8
Merge pull request #8529 from poettering/logind-fixlets
three trivial logind improvements
2018-03-23 15:19:32 +01:00
Peter Hutterer 0cd6767cf0 udev: don't label high-button mice as joysticks (#8493)
If a device exposes more than 16 mouse buttons, we run into the BTN_JOYSTICK
range, also labelling it as joystick. And since 774ff9b this results in only
ID_INPUT_JOYSTICK but no ID_INPUT_MOUSE.

Fixes #8460
2018-03-23 15:15:41 +01:00
Zbigniew Jędrzejewski-Szmek fbbffb8c09
Merge pull request #8530 from poettering/include-is-obsolete
actively say that .include is obsolete
2018-03-23 15:13:02 +01:00
Zbigniew Jędrzejewski-Szmek f01eca96d0
Merge pull request #8533 from poettering/bootup-shutdown-phase2
extend docs on second phase of shutdown and watchdog handling
2018-03-23 15:11:46 +01:00
Zbigniew Jędrzejewski-Szmek ee5a59d144
Merge pull request #8534 from poettering/safe-atoi-full
some improvements to safe_atou() to allow specification of arbitrary bases
2018-03-23 12:30:12 +01:00
Zbigniew Jędrzejewski-Szmek 37c1d5e97d tree-wide: warn when a directory path already exists but has bad mode/owner/type
When we are attempting to create directory somewhere in the bowels of /var/lib
and get an error that it already exists, it can be quite hard to diagnose what
is wrong (especially for a user who is not aware that the directory must have
the specified owner, and permissions not looser than what was requested). Let's
print a warning in most cases. A warning is appropriate, because such state is
usually a sign of borked installation and needs to be resolved by the adminstrator.

$ build/test-fs-util

Path "/tmp/test-readlink_and_make_absolute" already exists and is not a directory, refusing.
   (or)
Directory "/tmp/test-readlink_and_make_absolute" already exists, but has mode 0775 that is too permissive (0755 was requested), refusing.
   (or)
Directory "/tmp/test-readlink_and_make_absolute" already exists, but is owned by 1001:1000 (1000:1000 was requested), refusing.

Assertion 'mkdir_safe(tempdir, 0755, getuid(), getgid(), MKDIR_WARN_MODE) >= 0' failed at ../src/test/test-fs-util.c:320, function test_readlink_and_make_absolute(). Aborting.

No functional change except for the new log lines.
2018-03-23 10:26:38 +01:00
Alan Jenkins 97a33b126c
Merge pull request #8553 from poettering/take-take
introduce TAKE_FD() and TAKE_PTR() macros
2018-03-22 22:33:38 +00:00
Lennart Poettering c5beecca19 units: document why systemd-time-wait-sync.service conditions on CAP_SYS_TIME (#8555)
As requested by @evverx in https://github.com/systemd/systemd/pull/8537#issuecomment-375122615
2018-03-22 23:41:54 +03:00
Lennart Poettering b53f3386e5 vconsole: minor modernizations 2018-03-22 20:30:40 +01:00
Lennart Poettering 16dbd110a7 vconsole-setup: don't concat strv if we don't need to (i.e. not in debug log mode) 2018-03-22 20:30:40 +01:00
Lennart Poettering c10d6bdb89 macro: introduce new TAKE_FD() macro
This is similar to TAKE_PTR() but operates on file descriptors, and thus
assigns -1 to the fd parameter after returning it.

Removes 60 lines from our codebase. Pretty good too I think.
2018-03-22 20:30:40 +01:00
Lennart Poettering 2f4cefe6ce sleep-config: replace USE() macro with TAKE_PTR() usage
let's use the new generic macor instead of the locally defined, specific
one.
2018-03-22 20:21:42 +01:00
Lennart Poettering ae2a15bc14 macro: introduce TAKE_PTR() macro
This macro will read a pointer of any type, return it, and set the
pointer to NULL. This is useful as an explicit concept of passing
ownership of a memory area between pointers.

This takes inspiration from Rust:

https://doc.rust-lang.org/std/option/enum.Option.html#method.take

and was suggested by Alan Jenkins (@sourcejedi).

It drops ~160 lines of code from our codebase, which makes me like it.
Also, I think it clarifies passing of ownership, and thus helps
readability a bit (at least for the initiated who know the new macro)
2018-03-22 20:21:42 +01:00
Lennart Poettering d89e0dc81a sd-device: make use of the fact that log_debug_errno() returns the error passed in 2018-03-22 19:59:49 +01:00
Lennart Poettering 62570f6f03 fs-util: add new CHASE_TRAIL_SLASH flag for chase_symlinks()
This rearranges chase_symlinks() a bit: if no special flags are
specified it will now revert to behaviour before
b12d25a8d6. However, if the new
CHASE_TRAIL_SLASH flag is specified it will follow the behaviour
introduced by that commit.

I wasn't sure which one to make the beaviour that requires specification
of a flag to enable. I opted to make the "append trailing slash"
behaviour the one to enable by a flag, following the thinking that the
function should primarily be used to generate a normalized path, and I
am pretty sure a path without trailing slash is the more "normalized"
one, as the trailing slash is not really a part of it, but merely a
"decorator" that tells various system calls to generate ENOTDIR if the
path doesn't refer to a path.

Or to say this differently: if the slash was part of normalization then
we really should add it in all cases when the final path is a directory,
not just when the user originally specified it.

Fixes: #8544
Replaces: #8545
2018-03-22 19:54:24 +01:00
Jan Synacek 1147eef0b6 man/udevadm: remove superfluous --version from subcommands (#8549)
There's need to show the program specific --version for each subcommand.
2018-03-22 19:24:37 +01:00
Zbigniew Jędrzejewski-Szmek bc96c63c05 man: add a note that nspawn gives access to network by default
Fixes #6546.
2018-03-22 16:56:22 +01:00
Zbigniew Jędrzejewski-Szmek d50b5839b0 basic/mkdir: convert bool flag to enum
In preparation for subsequent changes...
2018-03-22 15:57:56 +01:00
Zbigniew Jędrzejewski-Szmek a5935c6601 test-execute: skip exec-specifier-interpolation if perl is missing 2018-03-22 15:57:56 +01:00
Zbigniew Jędrzejewski-Szmek 6b08180ca6 test-execute: allow sit0@ to exist in private network namespace
It's always visible:

$ sudo modprobe sit
$ sudo unshare -n ip l
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    ...
2: sit0@NONE: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    ...
2018-03-22 15:57:56 +01:00
Zbigniew Jędrzejewski-Szmek c725631f4b test-execute: simplify checks if grep output is empty
grep already indicates if it matched anything by return value.
Additional advantage is then that if the test fails, the unexpected
matching lines are visible in the log output.
2018-03-22 15:57:56 +01:00
Zbigniew Jędrzejewski-Szmek b1ffacb631 tests: skip udev-test when perl is not installed 2018-03-22 15:57:56 +01:00
James Cowgill f5aeac1439 seccomp: add mmap and address family restrictions for MIPS (#8547) 2018-03-22 15:40:44 +01:00
Lennart Poettering 7f19eb3592
Merge pull request #8531 from poettering/dhcp-server-mini-fixes
some minor tweaks to sd-dhcp-server
2018-03-22 15:36:48 +01:00
Lennart Poettering c8475a8f8e
HACKING: small umask tweak for the rootpw (#8541) 2018-03-22 15:36:01 +01:00
Peter A. Bigot 1d0b60c481 units: disable systemd-time-sync-wait inside containers (#8537)
Fixes #8535
2018-03-22 05:27:27 +03:00
Peter A. Bigot e9cbef7dc9 doc/HACKING: show command to set root password in image (#8540)
Fixes #8538
2018-03-21 23:56:33 +01:00