]> git.ipfire.org Git - thirdparty/systemd.git/log
thirdparty/systemd.git
6 years agonetworkd: bridge allow AgeingTimeSec to be set 0 (#7021)
Susant Sahani [Wed, 11 Oct 2017 07:08:05 +0000 (12:38 +0530)] 
networkd: bridge allow AgeingTimeSec to be set 0 (#7021)

Closes #7019.

6 years agoMerge pull request #7058 from yuwata/fix-7055
Vito Caputo [Wed, 11 Oct 2017 04:05:00 +0000 (21:05 -0700)] 
Merge pull request #7058 from yuwata/fix-7055

core: fix segfault in compile_bind_mounts() when BindPaths= or BindReadOnlyPaths= is set

6 years agocore: fix segfault in compile_bind_mounts() when BindPaths= or BindReadOnlyPaths... 7058/head
Yu Watanabe [Wed, 11 Oct 2017 03:27:13 +0000 (12:27 +0900)] 
core: fix segfault in compile_bind_mounts() when BindPaths= or BindReadOnlyPaths= is set

This fixes a bug introduced by 6c47cd7d3bf35c8158a0737f34fe2c5dc95e72d6.

Fixes #7055.

6 years agoman: fix typos (#7029)
Jakub Wilk [Tue, 10 Oct 2017 19:59:03 +0000 (21:59 +0200)] 
man: fix typos (#7029)

6 years agoMerge pull request #7044 from poettering/minidocfixes
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2017 19:57:39 +0000 (21:57 +0200)] 
Merge pull request #7044 from poettering/minidocfixes

tiny doc fixes

6 years agol10n: update Czech Translation (#7049)
AsciiWolf [Tue, 10 Oct 2017 19:52:52 +0000 (21:52 +0200)] 
l10n: update Czech Translation (#7049)

6 years agoMerge pull request #7045 from poettering/namespace-casing
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2017 19:50:17 +0000 (21:50 +0200)] 
Merge pull request #7045 from poettering/namespace-casing

some super-trivial fixes to namespace.c

6 years agotests: skip tests when cg_pid_get_path fails (#7033)
Zbigniew Jędrzejewski-Szmek [Tue, 10 Oct 2017 18:55:20 +0000 (20:55 +0200)] 
tests: skip tests when cg_pid_get_path fails (#7033)

v2:
- cast the fstype_t type to ull, because it varies between arches.
  Making it long long should be on the safe side.

6 years agoMerge pull request #7003 from yuwata/enable-dynamic-user
Lennart Poettering [Tue, 10 Oct 2017 08:05:43 +0000 (10:05 +0200)] 
Merge pull request #7003 from yuwata/enable-dynamic-user

timesyncd, journal-upload: Enable DynamicUser=

6 years agorules: Add MODEL_ID for NVMe device (#7037)
gwendalcr [Tue, 10 Oct 2017 08:03:38 +0000 (01:03 -0700)] 
rules: Add MODEL_ID for NVMe device (#7037)

To mimic MODEL_ID variable built for ATA and SCSI devices, add rules
to add MODEL_ID variable for NVMe devices.

TEST: Check on a system with NVMe device that MODEL_ID variable is
present:
 udevadm info --query=all -n /dev/nvme0n1p1 | grep ID_MODEL
and
 udevadm info --query=all -n /dev/nvme0n1p1 | grep ID_MODEL
return:
E: ID_MODEL=SAMSUNG...

6 years agonamespace: make ns_type_supported() a tiny bit shorter 7045/head
Lennart Poettering [Tue, 10 Oct 2017 07:50:23 +0000 (09:50 +0200)] 
namespace: make ns_type_supported() a tiny bit shorter

namespace_type_to_string() already validates the type paramater, we can
use that, and shorten the function a bit.

6 years agonamespace: change NameSpace → Namespace
Lennart Poettering [Tue, 10 Oct 2017 07:49:20 +0000 (09:49 +0200)] 
namespace: change NameSpace → Namespace

We generally use the casing "Namespace" for the word, and that's visible
in a number of user-facing interfaces, including "RestrictNamespace=" or
"JoinsNamespaceOf=". Let's make sure to use the same casing internally
too.

As discussed in #7024

6 years agonamespace: fall back gracefully when kernel doesn't support network namespaces (...
Michal Sekletar [Tue, 10 Oct 2017 07:46:13 +0000 (09:46 +0200)] 
namespace: fall back gracefully when kernel doesn't support network namespaces (#7024)

6 years agocatalog,po: update Russian translation (#7041)
Sergey Ptashnick [Tue, 10 Oct 2017 07:44:52 +0000 (10:44 +0300)] 
catalog,po: update Russian translation (#7041)

6 years agoman: fix link to documentation of slice concept 7044/head
Lennart Poettering [Tue, 10 Oct 2017 07:43:37 +0000 (09:43 +0200)] 
man: fix link to documentation of slice concept

6 years agoman: symlinks are made onto "unit files", not "units"
Lennart Poettering [Tue, 10 Oct 2017 07:41:17 +0000 (09:41 +0200)] 
man: symlinks are made onto "unit files", not "units"

We should be careful when talking about "units" and "unit files". The
latter should be the concept on disk, and the former, the loaded version
of it. However, as a single unit file can result in multiple loaded
units (think templates), and a units can also exist with no unit file at
all (think .device units), we should be precise.

As symlinks are created on unit files rather than units (as symlinks are
an fs object, and unit files are too, but units are not), let's say so
here.

6 years agoUpdated Turkish translation (#7017)
Muhammet Kara [Mon, 9 Oct 2017 13:39:19 +0000 (15:39 +0200)] 
Updated Turkish translation (#7017)

6 years agoMerge pull request #7034 from keszybz/modules-load-downgrade-errors
Lennart Poettering [Mon, 9 Oct 2017 13:38:30 +0000 (15:38 +0200)] 
Merge pull request #7034 from keszybz/modules-load-downgrade-errors

Downgrade errors resulting from user configuration in modules-load

6 years agoupdate TODO
Lennart Poettering [Mon, 9 Oct 2017 13:22:22 +0000 (15:22 +0200)] 
update TODO

6 years agomodules-load: downgrade error on ENODEV/ENOENT 7034/head
Zbigniew Jędrzejewski-Szmek [Sun, 8 Oct 2017 14:21:06 +0000 (16:21 +0200)] 
modules-load: downgrade error on ENODEV/ENOENT

Some kernel modules may be loaded if the hardware does not exist
(usually when the hardware is hot-pluggable), while others fail with
ENODEV. Let's make those two cases more similar, and simply log
modules which cannot be loaded because of missing hardware without
failing systemd-modules-load.service.

For modules which don't exist, let's warn, but not fail the whole
service. I think a warning is appropriate because it's likely that
a typo was made.

6 years agokmod_module_probe_insert_module returns 0 on success, != 0 on failure
Zbigniew Jędrzejewski-Szmek [Sun, 8 Oct 2017 14:18:57 +0000 (16:18 +0200)] 
kmod_module_probe_insert_module returns 0 on success, != 0 on failure

More specifically, it should return > 0 only for conditions specified in
probe_flags. We only set KMOD_PROBE_APPLY_BLACKLIST in probe_flags, so the
code was correct, but add an assert to clarify this.

6 years agotest: skip hwdb and sysv-generator if the features are disabled (#7026)
Mike Gilbert [Sun, 8 Oct 2017 20:14:45 +0000 (16:14 -0400)] 
test: skip hwdb and sysv-generator if the features are disabled (#7026)

6 years agoutil-lib: introdude _cleanup_ macros for kmod objects
Zbigniew Jędrzejewski-Szmek [Sun, 8 Oct 2017 13:55:24 +0000 (15:55 +0200)] 
util-lib: introdude _cleanup_ macros for kmod objects

6 years agoman: fix typo for !! in systemd.service (#7031)
bleep_blop [Sun, 8 Oct 2017 20:01:08 +0000 (01:31 +0530)] 
man: fix typo for !! in systemd.service (#7031)

!! must be very similar to !, not itself.

6 years agopo: update Polish translation (#7015)
Piotr Drąg [Fri, 6 Oct 2017 14:10:33 +0000 (16:10 +0200)] 
po: update Polish translation (#7015)

6 years agoNEWS: patch in today's date for the 235 release v235
Lennart Poettering [Fri, 6 Oct 2017 08:18:04 +0000 (10:18 +0200)] 
NEWS: patch in today's date for the 235 release

6 years agoman: explain precedence for options which take a list (#7010)
Zbigniew Jędrzejewski-Szmek [Fri, 6 Oct 2017 08:04:49 +0000 (10:04 +0200)] 
man: explain precedence for options which take a list (#7010)

Hopefully finally fixes #6639.

6 years agomeson: fix feature list (#7011)
Yu Watanabe [Fri, 6 Oct 2017 07:33:21 +0000 (16:33 +0900)] 
meson: fix feature list (#7011)

6 years agosysusers: do not create unneeded users 7003/head
Yu Watanabe [Thu, 5 Oct 2017 01:21:50 +0000 (10:21 +0900)] 
sysusers: do not create unneeded users

6 years agounit: enable DynamicUser= for journal-upload
Yu Watanabe [Fri, 6 Oct 2017 07:06:21 +0000 (16:06 +0900)] 
unit: enable DynamicUser= for journal-upload

6 years agotimesyncd: enable DynamicUser=
Yu Watanabe [Fri, 6 Oct 2017 07:05:20 +0000 (16:05 +0900)] 
timesyncd: enable DynamicUser=

6 years agomkdir: introduce follow_symlink flag to mkdir_safe{,_label}()
Yu Watanabe [Fri, 6 Oct 2017 07:03:33 +0000 (16:03 +0900)] 
mkdir: introduce follow_symlink flag to mkdir_safe{,_label}()

6 years agotmpfiles: remove old ICE and X11 sockets at boot (#6979)
Frederic Crozat [Thu, 5 Oct 2017 23:28:19 +0000 (01:28 +0200)] 
tmpfiles: remove old ICE and X11 sockets at boot (#6979)

tmpfiles: remove old ICE and X11 sockets at boot

When not using tmpfs based /tmp, leftover sockets
might prevent X startup. Ensure directory is clean at boot time.

6 years agopass currently completed word to systemctl list-unit-files/list-units (#6927)
g0tar [Thu, 5 Oct 2017 20:17:51 +0000 (22:17 +0200)] 
pass currently completed word to systemctl list-unit-files/list-units (#6927)

This change noticeably increases completion performance at the expense
of preventing possible _correct, _approximate or any matcher-list rules.
Still, responsiveness increase so huge seems to make it worth the price.

6 years agoMerge pull request #6999 from poettering/seccomp-newgroups
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 20:06:39 +0000 (22:06 +0200)] 
Merge pull request #6999 from poettering/seccomp-newgroups

add three new syscall groups, and port @privileged to make use of more existing ones

6 years agoMerge pull request #7008 from poettering/sorevision235
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 19:51:13 +0000 (21:51 +0200)] 
Merge pull request #7008 from poettering/sorevision235

bump so revision for 235 and mailmap updates

6 years agoMerge pull request #6949 from poettering/restart-servers
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 19:24:36 +0000 (21:24 +0200)] 
Merge pull request #6949 from poettering/restart-servers

Automatically forget learnt DNS server information when network config changes

6 years agoMerge pull request #6909 from sourcejedi/units
Lennart Poettering [Thu, 5 Oct 2017 16:26:02 +0000 (18:26 +0200)] 
Merge pull request #6909 from sourcejedi/units

Unit dependency fixes (and cleanups)

6 years agoupdate .mailmap a bit more 7008/head
Lennart Poettering [Thu, 5 Oct 2017 15:38:40 +0000 (17:38 +0200)] 
update .mailmap a bit more

6 years agoNEWS: one more addition
Lennart Poettering [Thu, 5 Oct 2017 15:23:17 +0000 (17:23 +0200)] 
NEWS: one more addition

6 years agobuild-sys: bump so revisions for prepation of 235
Lennart Poettering [Thu, 5 Oct 2017 15:14:04 +0000 (17:14 +0200)] 
build-sys: bump so revisions for prepation of 235

6 years agoresolved: include DNS server feature level info in SIGUSR1 status dump 6949/head
Lennart Poettering [Thu, 5 Oct 2017 14:53:32 +0000 (16:53 +0200)] 
resolved: include DNS server feature level info in SIGUSR1 status dump

let's make the status dump more useful for tracking down server issues.

6 years agoresolved: add support for explicitly forgetting everything we learnt about DNS server...
Lennart Poettering [Fri, 29 Sep 2017 19:19:54 +0000 (21:19 +0200)] 
resolved: add support for explicitly forgetting everything we learnt about DNS server feature levels

This adds "systemd-resolve --reset-server-features" for explicitly
forgetting what we learnt. This might be useful for debugging
purposes, and to force systemd-resolved to restart its learning logic
for all DNS servers.

6 years agoresolved: automatically forget all learnt DNS server information when the network...
Lennart Poettering [Fri, 29 Sep 2017 19:18:29 +0000 (21:18 +0200)] 
resolved: automatically forget all learnt DNS server information when the network configuration changes

When the network configuration changes we should relearn everything
there is to know about the configured DNS servers, because we might talk
to the same addresses, but there might be different servers behind them.

6 years agoseccomp: port @privileged to use @reboot + @swap 6999/head
Lennart Poettering [Mon, 2 Oct 2017 07:16:50 +0000 (09:16 +0200)] 
seccomp: port @privileged to use @reboot + @swap

Let's reuse two groups we already defined to make @privileged a bit
shorter.

6 years agoseccomp: there is no "kexec" syscall
Lennart Poettering [Wed, 4 Oct 2017 19:09:52 +0000 (21:09 +0200)] 
seccomp: there is no "kexec" syscall

it's called "kexec_load".

6 years agoseccomp: add three more seccomp groups
Lennart Poettering [Sat, 30 Sep 2017 12:34:50 +0000 (14:34 +0200)] 
seccomp: add three more seccomp groups

@aio → asynchronous IO calls
@sync → msync/fsync/... and friends
@chown → changing file ownership

(Also, change @privileged to reference @chown now, instead of the
individual syscalls it contains)

6 years agoUpdate mailmap and contributor list (#7006)
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 13:41:33 +0000 (15:41 +0200)] 
Update mailmap and contributor list (#7006)

Also fix typo (by using a word that is a better git anyway.)

6 years agounits: restore User=systemd-journal-gateway in systemd-journal-gatewayd.service ...
Lennart Poettering [Thu, 5 Oct 2017 13:05:02 +0000 (15:05 +0200)] 
units: restore User=systemd-journal-gateway in systemd-journal-gatewayd.service (#7005)

After the discussions around #7003 I think we should restore the
User=systemd-journal-gateway line for systemd-journal-gatewayd.service,
too, so that we continue to use the state user if it exists, and create
it as dynamic user only when it does not.

Note that undoes part of a change made after 234, i.e. a never released
change.

6 years agocore: make gc_marker unsigned (#7004)
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 13:04:19 +0000 (15:04 +0200)] 
core: make gc_marker unsigned (#7004)

This matches the definition in unit.h.

6 years agoseccomp: remove 'gettid' syscall from '@process' syscall set (#6989)
Djalal Harouni [Thu, 5 Oct 2017 12:46:41 +0000 (14:46 +0200)] 
seccomp: remove 'gettid' syscall from '@process' syscall set (#6989)

The gettid syscall is one of the most basic syscalls, it never fails and
it operates on current thread. Most applications are not suposed to use
it, however even if it is used there is no much justification on blocking
it. This patch removes it from '@process' set so if users blacklist this
set to block setns or clone syscalls, the gettid syscall will still be
available. Of course they can always block gettid explicitly.

Note that the gettid is already in the '@default' set.

6 years agoMerge pull request #6931 from poettering/job-timeout-sec
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 12:42:29 +0000 (14:42 +0200)] 
Merge pull request #6931 from poettering/job-timeout-sec

6 years agoNEWS: some nitpicking and bike-shedding
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 11:16:31 +0000 (13:16 +0200)] 
NEWS: some nitpicking and bike-shedding

6 years agoMerge pull request #6952 from poettering/seccomp-getrlimit
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 11:22:03 +0000 (13:22 +0200)] 
Merge pull request #6952 from poettering/seccomp-getrlimit

a seccomp fix regarding ugetrlimit/prlimit64

6 years agogenerator: when we insert a '\n', actually place a proper newline, too 6931/head
Lennart Poettering [Wed, 27 Sep 2017 15:33:09 +0000 (17:33 +0200)] 
generator: when we insert a '\n', actually place a proper newline, too

6 years agounit: when JobTimeoutSec= is turned off, implicitly turn off JobRunningTimeoutSec...
Lennart Poettering [Wed, 27 Sep 2017 15:30:50 +0000 (17:30 +0200)] 
unit: when JobTimeoutSec= is turned off, implicitly turn off JobRunningTimeoutSec= too

We added JobRunningTimeoutSec= late, and Dracut configured only
JobTimeoutSec= to turn of root device timeouts before. With this change
we'll propagate a reset of JobTimeoutSec= into JobRunningTimeoutSec=,
but only if the latter wasn't set explicitly.

This should restore compatibility with older systemd versions.

Fixes: #6402
6 years agoRevert "networkd: change UseMTU default to true. (#6837)" (#6950)
Andrew Jeddeloh [Thu, 5 Oct 2017 10:58:02 +0000 (03:58 -0700)] 
Revert "networkd: change UseMTU default to true. (#6837)" (#6950)

This reverts commit 22043e4317ecd2bc7834b48a6d364de76bb26d91.
UseMTU is broken on real hardware and should not be enabled by default.

6 years agoMerge pull request #6988 from poettering/dns-stub-truncate
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 10:35:24 +0000 (12:35 +0200)] 
Merge pull request #6988 from poettering/dns-stub-truncate

rework how resolved's dns stub deals with truncation

6 years agoresolved: rework how we handle truncation in the stub resolver 6988/head
Lennart Poettering [Wed, 4 Oct 2017 10:35:48 +0000 (12:35 +0200)] 
resolved: rework how we handle truncation in the stub resolver

When we a reply message gets longer than the client supports we need to
truncate the response and set the TC bit, and we already do that.
However, we are not supposed to send incomplete RRs in that case, but
instead truncate right at a record boundary. Do that.

This fixes the "Message parser reports malformed message packet."
warning the venerable "host" tool outputs when a very large response is
requested.

See: #6520

6 years agoresolved: take benefit of log_xyz_errno() returning the negative error code
Lennart Poettering [Wed, 4 Oct 2017 09:57:10 +0000 (11:57 +0200)] 
resolved: take benefit of log_xyz_errno() returning the negative error code

Just some modernizations.

6 years agoseccomp: ignore (and debug log) errors by all invocations of seccomp_rule_add_exact() 6952/head
Lennart Poettering [Thu, 5 Oct 2017 09:26:09 +0000 (11:26 +0200)] 
seccomp: ignore (and debug log) errors by all invocations of seccomp_rule_add_exact()

System calls might exist on some archs but not on others, or might be
multiplexed but not on others. Ignore such errors when putting together
a filter at this location like we already do it on all others.

6 years agoseccomp: always handle seccomp_load() failing the same way
Lennart Poettering [Thu, 5 Oct 2017 09:24:51 +0000 (11:24 +0200)] 
seccomp: always handle seccomp_load() failing the same way

Unfortunately libseccomp doesn't return (nor document) clean error
codes, hence until then only check for specific error codes that we
propagate, but ignore (but debug log) all others. Do this at one more
place, we are already doing that at all others.

6 years agoseccomp: react gracefully if we can't translate a syscall name
Lennart Poettering [Thu, 5 Oct 2017 09:23:07 +0000 (11:23 +0200)] 
seccomp: react gracefully if we can't translate a syscall name

When a libseccomp implementation doesn't know a syscall yet, that's no
reason for us to fail completely. Instead, debug log, and proceed.

This hopefully fixes the preadv2/pwritev2 issues pointed out here:

https://github.com/systemd/systemd/pull/6952#issuecomment-334302923

6 years agoseccomp: include prlimit64 and ugetrlimit in @default
Lennart Poettering [Sat, 30 Sep 2017 12:08:26 +0000 (14:08 +0200)] 
seccomp: include prlimit64 and ugetrlimit in @default

Also, move prlimit64() out of @resources.

prlimit64() may be used both for getting and setting resource limits, and
is implicitly called by glibc at various places, on some archs, the same
was as getrlimit(). SImilar, igetrlimit() is an arch-specific
replacement for getrlimit(), and hence should be whitelisted at the same
place as getrlimit() and prlimit64().

Also see: https://lists.freedesktop.org/archives/systemd-devel/2017-September/039543.html

6 years agoMerge pull request #6944 from poettering/suspend-fix
Zbigniew Jędrzejewski-Szmek [Thu, 5 Oct 2017 09:26:44 +0000 (11:26 +0200)] 
Merge pull request #6944 from poettering/suspend-fix

systemctl reboot/suspend tweaks

6 years agohwdb: Add accelerometer orientation entry for Chuwi Hi8 Pro tablet (#6998)
Hans de Goede [Wed, 4 Oct 2017 23:06:55 +0000 (01:06 +0200)] 
hwdb: Add accelerometer orientation entry for Chuwi Hi8 Pro tablet (#6998)

Add an accelerometer orientation entry for the Chuwi Hi8 Pro tablet.

6 years agotmpfiles: change btmp mode 0600 → 0660 (#6997)
Lennart Poettering [Wed, 4 Oct 2017 19:44:29 +0000 (21:44 +0200)] 
tmpfiles: change btmp mode 0600 → 0660 (#6997)

As discussed in #6994.

Fixes: #6994
6 years agodynamic-user: don't use a UID that currently owns IPC objects (#6962)
Lennart Poettering [Wed, 4 Oct 2017 19:40:01 +0000 (21:40 +0200)] 
dynamic-user: don't use a UID that currently owns IPC objects (#6962)

This fixes a mostly theoretical potential security hole: if for some
reason we failed to remove IPC objects created for a dynamic user (maybe
because a MAC/SElinux erronously prohibited), then we should not hand
out the same UID again until they are successfully removed.

With this commit we'll enumerate the IPC objects currently existing, and
step away from using a UID for the dynamic UID logic if there are any
matching it.

6 years agoMerge pull request #6975 from sourcejedi/logind_pid_0_v2
Zbigniew Jędrzejewski-Szmek [Wed, 4 Oct 2017 19:33:52 +0000 (21:33 +0200)] 
Merge pull request #6975 from sourcejedi/logind_pid_0_v2

Selectively revert "tree-wide: use pid_is_valid() at more places"

6 years agoNEWS: add comment about change sync/async behaviour for shutdown commands 6944/head
Lennart Poettering [Mon, 2 Oct 2017 14:30:01 +0000 (16:30 +0200)] 
NEWS: add comment about change sync/async behaviour for shutdown commands

6 years agoman: document which special "systemctl" commands are synchronous and which asynchronous.
Lennart Poettering [Fri, 29 Sep 2017 14:10:27 +0000 (16:10 +0200)] 
man: document which special "systemctl" commands are synchronous and which asynchronous.

This documents the status quo, clarifying when we are synchronous and
when asynchronous by default and when --no-block is support to force
asynchronous operation.

See: #6479

6 years agologind: don's change dry-run boolean before we actually enqueue the operation
Lennart Poettering [Mon, 2 Oct 2017 14:09:24 +0000 (16:09 +0200)] 
logind: don's change dry-run boolean before we actually enqueue the operation

Let's not affect change before the PK check.

6 years agologind: reorder things a bit
Lennart Poettering [Mon, 2 Oct 2017 14:08:49 +0000 (16:08 +0200)] 
logind: reorder things a bit

Let's keep the three sleep method implementations close to each other.

6 years agosystemctl: make sure "reboot", "suspend" and friends are always asynchronous
Lennart Poettering [Fri, 29 Sep 2017 14:07:11 +0000 (16:07 +0200)] 
systemctl: make sure "reboot", "suspend" and friends are always asynchronous

Currently, "systemctl reboot" behaves differently in setups with and
without logind. If logind is used (which is probably the more common
case) the operation is asynchronous, and otherwise synchronous (though
subject to --no-block in this case). Let's clean this up, and always
expose the same behaviour, regardless if logind is used or not: let's
always make it asynchronous.

It might make sense to add a "--block" mode in a future PR that makes
these operations synchronous, but this requires non-trivial work in
logind, and is outside of the scope of this change.

See: #6479

6 years agologind: add Halt() and CanHalt() APIs
Lennart Poettering [Mon, 2 Oct 2017 14:03:55 +0000 (16:03 +0200)] 
logind: add Halt() and CanHalt() APIs

This adds new method calls Halt() and CanHalt() to the logind bus APIs.
They aren't overly useful (as the whole concept of halting isn't really
too useful), however they clean up one major asymmetry: currently, using
the "shutdown" legacy commands it is possibly to enqueue a "halt"
operation through logind, while logind officially doesn't actually
support this. Moreover, the path through "shutdown" currently ultimately
fails, since the referenced "halt" action isn't actually defined in
PolicyKit.

Finally, the current logic results in an unexpected asymmetry in
systemctl: "systemctl poweroff", "systemctl reboot" are currently
asynchronous (due to the logind involvement) while "systemctl halt"
isnt. Let's clean this up, and make all three APIs implemented by
logind natively, and all three hence asynchronous in "systemctl".

Moreover, let's add the missing PK action.

Fixes: #6957
6 years agoMerge pull request #6992 from keszybz/fix-test-copy
Lennart Poettering [Wed, 4 Oct 2017 18:00:14 +0000 (20:00 +0200)] 
Merge pull request #6992 from keszybz/fix-test-copy

test-copy: fix operation when test-copy is too small

6 years agohwdb: switch meson to use ids_parser.py (#6964)
Zbigniew Jędrzejewski-Szmek [Wed, 4 Oct 2017 17:32:59 +0000 (19:32 +0200)] 
hwdb: switch meson to use ids_parser.py (#6964)

Also drop the now-unused perl implementation (that doesn't do sorting),
so it's incompatible anyway.

6 years agoudevadm,basic: replace nulstr_contains with STR_IN_SET (#6965)
Zbigniew Jędrzejewski-Szmek [Wed, 4 Oct 2017 17:32:12 +0000 (19:32 +0200)] 
udevadm,basic: replace nulstr_contains with STR_IN_SET (#6965)

STR_IN_SET is a newer approach which is easier to write and read, and which
seems to result in space savings too:

before:
4949848 build/src/shared/libsystemd-shared-234.so
 350704 build/systemctl
4967184 build/systemd
 826216 build/udevadm

after:
4949848 build/src/shared/libsystemd-shared-234.so
 350704 build/systemctl
4966888 build/systemd
 826168 build/udevadm

6 years agonss-systemd: if cannot open bus, then try to read user info directly (#6971)
Yu Watanabe [Wed, 4 Oct 2017 17:29:36 +0000 (02:29 +0900)] 
nss-systemd: if cannot open bus, then try to read user info directly (#6971)

If sd_bus_open_system() fail, then try to read information about
dynamic users from /run/systemd/dynamic-uid.
This makes services can successfully call getpwuid() or their friends
even if dbus.service is not started yet.

Fixes #6967.

6 years agoMerge pull request #6974 from keszybz/clean-up-defines
Lennart Poettering [Wed, 4 Oct 2017 17:25:30 +0000 (19:25 +0200)] 
Merge pull request #6974 from keszybz/clean-up-defines

Clean up define definitions

6 years agoMerge pull request #6985 from yuwata/empty
Lennart Poettering [Wed, 4 Oct 2017 15:54:35 +0000 (17:54 +0200)] 
Merge pull request #6985 from yuwata/empty

load-fragment: do not create empty array

6 years agologind: use pid_is_valid() where appropriate 6975/head
Alan Jenkins [Tue, 3 Oct 2017 11:26:02 +0000 (12:26 +0100)] 
logind: use pid_is_valid() where appropriate

These two sites _do_ match the definition of pid_is_valid(); they don't
provide any special handling for the invalid PID value 0.  (They're used
by dbus methods, so the PID value 0 is handled with reference to the dbus
client creds, outside of these functions).

6 years agosystemctl: use pid_is_valid() where appropriate
Alan Jenkins [Tue, 3 Oct 2017 11:13:06 +0000 (12:13 +0100)] 
systemctl: use pid_is_valid() where appropriate

This was the one valid site in commit
ee043777be58251e7441b4f04594e9e3792d7fb2.

The second part of this hunk, avoiding using `%m`
when we didn't actually have `errno` set, seems
like a nice enough cleanup to be worthwhile on
it's own.

Also use PID_FMT to improve the error message we print
(pid_t is signed).

6 years agotree-wide: use IN_SET macro (#6977)
Yu Watanabe [Wed, 4 Oct 2017 14:01:32 +0000 (23:01 +0900)] 
tree-wide: use IN_SET macro (#6977)

6 years agotest-sizeof: add pid_t and gid_t 6992/head
Zbigniew Jędrzejewski-Szmek [Wed, 4 Oct 2017 13:22:07 +0000 (15:22 +0200)] 
test-sizeof: add pid_t and gid_t

C.f. #6975.

6 years agotest-copy: fix operation when test-copy is too small
Zbigniew Jędrzejewski-Szmek [Wed, 4 Oct 2017 13:17:09 +0000 (15:17 +0200)] 
test-copy: fix operation when test-copy is too small

Fixes #6981.

6 years agoMerge pull request #6986 from OpenDZ/tixxdz/seccomp-more-default-syscalls-v1
Djalal Harouni [Wed, 4 Oct 2017 13:01:21 +0000 (15:01 +0200)] 
Merge pull request #6986 from OpenDZ/tixxdz/seccomp-more-default-syscalls-v1

seccomp: add sched_yield syscall to the @default syscall set

6 years agoman: fix that the same option is listed twice (#6991)
Yu Watanabe [Wed, 4 Oct 2017 12:43:00 +0000 (21:43 +0900)] 
man: fix that the same option is listed twice (#6991)

6 years agounits: prohibit all IP traffic on all our long-running services (#6921)
Lennart Poettering [Wed, 4 Oct 2017 12:16:28 +0000 (14:16 +0200)] 
units: prohibit all IP traffic on all our long-running services (#6921)

Let's lock things down further.

6 years agomeson: generate ENABLE_* names automatically 6974/head
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 11:15:27 +0000 (13:15 +0200)] 
meson: generate ENABLE_* names automatically

After previous changes, the naming of configuration options and internal
defines is consistent.

6 years agobuild-sys: s/ENABLE_RESOLVED/ENABLE_RESOLVE/
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 11:12:29 +0000 (13:12 +0200)] 
build-sys: s/ENABLE_RESOLVED/ENABLE_RESOLVE/

The configuration option was called -Dresolve, but the internal define
was …RESOLVED. This options governs more than just resolved itself, so
let's settle on the version without "d".

6 years agobuild-sys: s/HAVE_MYHOSTNAME/ENABLE_MYHOSTNAME/
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 10:23:55 +0000 (12:23 +0200)] 
build-sys: s/HAVE_MYHOSTNAME/ENABLE_MYHOSTNAME/

Same justification as for HAVE_UTMP. HAVE_MYHOSTNAME was used before mysthostname
was merged into systemd.

6 years agobuild-sys: s/HAVE_SMACK/ENABLE_SMACK/
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 10:22:40 +0000 (12:22 +0200)] 
build-sys: s/HAVE_SMACK/ENABLE_SMACK/

Same justification as for HAVE_UTMP.

6 years agobuild-sys: s/HAVE_IMA/ENABLE_IMA/
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 10:20:49 +0000 (12:20 +0200)] 
build-sys: s/HAVE_IMA/ENABLE_IMA/

Same justification as for HAVE_UTMP.

6 years agobuild-sys: s/HAVE_UTMP/ENABLE_UTMP/
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 10:19:30 +0000 (12:19 +0200)] 
build-sys: s/HAVE_UTMP/ENABLE_UTMP/

"Have" should be about the external environment and dependencies. Anything
which is a pure yes/no choice should be "enable".

6 years agobuild-sys: require all defines under #if to be present
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 10:11:49 +0000 (12:11 +0200)] 
build-sys: require all defines under #if to be present

This should help to catch any errors with typos and HAVE/ENABLE mismatches.

6 years agotest-nss: fix names of two defines
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 10:10:57 +0000 (12:10 +0200)] 
test-nss: fix names of two defines

That's another bug fixed (sys/auxv.h was the first).

6 years agobuild-sys: use #if Y instead of #ifdef Y everywhere
Zbigniew Jędrzejewski-Szmek [Tue, 3 Oct 2017 08:41:51 +0000 (10:41 +0200)] 
build-sys: use #if Y instead of #ifdef Y everywhere

The advantage is that is the name is mispellt, cpp will warn us.

$ git grep -Ee "conf.set\('(HAVE|ENABLE)_" -l|xargs sed -r -i "s/conf.set\('(HAVE|ENABLE)_/conf.set10('\1_/"
$ git grep -Ee '#ifn?def (HAVE|ENABLE)' -l|xargs sed -r -i 's/#ifdef (HAVE|ENABLE)/#if \1/; s/#ifndef (HAVE|ENABLE)/#if ! \1/;'
$ git grep -Ee 'if.*defined\(HAVE' -l|xargs sed -i -r 's/defined\((HAVE_[A-Z0-9_]*)\)/\1/g'
$ git grep -Ee 'if.*defined\(ENABLE' -l|xargs sed -i -r 's/defined\((ENABLE_[A-Z0-9_]*)\)/\1/g'
+ manual changes to meson.build

squash! build-sys: use #if Y instead of #ifdef Y everywhere

v2:
- fix incorrect setting of HAVE_LIBIDN2

6 years agoseccomp: add sched_yield syscall to the @default syscall set 6986/head
Djalal Harouni [Wed, 4 Oct 2017 09:41:42 +0000 (10:41 +0100)] 
seccomp: add sched_yield syscall to the @default syscall set

6 years agocore: use strv_isempty to check if supplementary_groups is empty 6985/head
Zbigniew Jędrzejewski-Szmek [Wed, 4 Oct 2017 09:33:30 +0000 (11:33 +0200)] 
core: use strv_isempty to check if supplementary_groups is empty

With the previous commit, we know that it will be NULL if empty, but
it's safe to always use strv_isempty() in case the code changes
in the future.