chiark / gitweb /
elogind.git
6 years agocheck_tree.pl : Fix transportation of elogind mask info
Sven Eden [Thu, 17 May 2018 06:19:47 +0000 (08:19 +0200)]
check_tree.pl : Fix transportation of elogind mask info

6 years agocheck_tree.pl : Do not skip mask info with useless hunks.
Sven Eden [Thu, 17 May 2018 06:13:21 +0000 (08:13 +0200)]
check_tree.pl : Do not skip mask info with useless hunks.

6 years agocheck_tree.pl: Remember mask starts and elses in hunks, so the
Sven Eden [Thu, 17 May 2018 06:08:37 +0000 (08:08 +0200)]
check_tree.pl: Remember mask starts and elses in hunks, so the
resulting patches can be reworked without ignoring changes in useless
hunks.

6 years agomigrate_tree.pl : Check target first when creating new files.
Sven Eden [Thu, 17 May 2018 05:44:41 +0000 (07:44 +0200)]
migrate_tree.pl : Check target first when creating new files.

6 years agocheck_tree.pl: Replace the source in creation patches with /dev/null.
Sven Eden [Thu, 17 May 2018 05:38:55 +0000 (07:38 +0200)]
check_tree.pl: Replace the source in creation patches with /dev/null.

7 years agomigrate_tree.pl: Ensure that the commit file is always written on exit.
Sven Eden [Wed, 16 May 2018 16:14:01 +0000 (18:14 +0200)]
migrate_tree.pl: Ensure that the commit file is always written on exit.

7 years agomigrate_tree.pl: Add a signal handler, so the commit file is updated even on SIGINT.
Sven Eden [Wed, 16 May 2018 06:06:32 +0000 (08:06 +0200)]
migrate_tree.pl: Add a signal handler, so the commit file is updated even on SIGINT.

7 years agomigrate_tree.pl: Make the last commit csv location agnostic.
Sven Eden [Wed, 16 May 2018 05:47:58 +0000 (07:47 +0200)]
migrate_tree.pl: Make the last commit csv location agnostic.

7 years agocheck_tree.pl migrate_tree.pl: Move necessary eop stuff into END blocks.
Sven Eden [Wed, 16 May 2018 05:01:59 +0000 (07:01 +0200)]
check_tree.pl migrate_tree.pl: Move necessary eop stuff into END blocks.

7 years agomigrate_tree.pl: Use git rev-parse to get the shortest possible version of each refid...
Sven Eden [Tue, 15 May 2018 16:01:23 +0000 (18:01 +0200)]
migrate_tree.pl: Use git rev-parse to get the shortest possible version of each refid we work with.

7 years agocheck_tree.pl: While unpreparing shell: comment comment lines and do
Sven Eden [Tue, 15 May 2018 15:49:48 +0000 (17:49 +0200)]
check_tree.pl: While unpreparing shell: comment comment lines and do
not add '# ' prefixes to mask blocks in xml patch hunks.

7 years agomeson.build: Clean up, so check_tree.pl does not find a difference to upstream.
Sven Eden [Tue, 15 May 2018 15:47:18 +0000 (17:47 +0200)]
meson.build: Clean up, so check_tree.pl does not find a difference to upstream.

7 years agomigrate_tree.pl: Call 'git am --abort' if it failed to apply.
Sven Eden [Tue, 15 May 2018 06:22:08 +0000 (08:22 +0200)]
migrate_tree.pl: Call 'git am --abort' if it failed to apply.

7 years agomigrate_tree.pl: Fixed Usage of Try::Tiny
Sven Eden [Tue, 15 May 2018 06:16:00 +0000 (08:16 +0200)]
migrate_tree.pl: Fixed Usage of Try::Tiny

7 years agomigrate_tree.pl: Finished the first working version for testing.
Sven Eden [Tue, 15 May 2018 05:55:42 +0000 (07:55 +0200)]
migrate_tree.pl: Finished the first working version for testing.

7 years agomigrate_tree.pl: Application of the reworked patches added.
Sven Eden [Mon, 14 May 2018 16:50:18 +0000 (18:50 +0200)]
migrate_tree.pl: Application of the reworked patches added.

7 years agomigrate_tree.pl: Reworking of the formatted patches added.
Sven Eden [Mon, 14 May 2018 16:34:03 +0000 (18:34 +0200)]
migrate_tree.pl: Reworking of the formatted patches added.

7 years agocheck_tree.pl: Add --create to allow creation of files, and --stay to not reset the...
Sven Eden [Mon, 14 May 2018 05:31:02 +0000 (07:31 +0200)]
check_tree.pl: Add --create to allow creation of files, and --stay to not reset the upstream tree on program end.

7 years agopwx/check_tree.pl: Switch to use Git::Wrapper for checking out the wanted refid on...
Sven Eden [Wed, 9 May 2018 05:19:24 +0000 (07:19 +0200)]
pwx/check_tree.pl: Switch to use Git::Wrapper for checking out the wanted refid on the upstream tree.

7 years agopwx/migrate_tree.pl: New program to consolidate the pwx git bash helpers.
Sven Eden [Mon, 7 May 2018 17:34:57 +0000 (19:34 +0200)]
pwx/migrate_tree.pl: New program to consolidate the pwx git bash helpers.

7 years agomusl_missing.h: add FTW_* macros missing from musl libc.
maxice8 [Fri, 27 Apr 2018 13:05:25 +0000 (10:05 -0300)]
musl_missing.h: add FTW_* macros missing from musl libc.

7 years agoFix double-hyphen error in man/logind.conf.xml and man/user-system-options.xml
Sven Eden [Thu, 26 Apr 2018 17:51:19 +0000 (19:51 +0200)]
Fix double-hyphen error in man/logind.conf.xml and man/user-system-options.xml

7 years agoUpdated man/loginctl.xml to fit elogind a bit better.
Sven Eden [Thu, 26 Apr 2018 17:41:40 +0000 (19:41 +0200)]
Updated man/loginctl.xml to fit elogind a bit better.

7 years agoRemove man/standard-conf.xml, as this does not apply for elogind.
Sven Eden [Thu, 26 Apr 2018 17:41:14 +0000 (19:41 +0200)]
Remove man/standard-conf.xml, as this does not apply for elogind.

7 years agoMove /var/lib/systemd/linger to /var/lib/elogind/.
Sven Eden [Mon, 23 Apr 2018 16:40:49 +0000 (18:40 +0200)]
Move /var/lib/systemd/linger to /var/lib/elogind/.

7 years agoReverted accidential renaming of /run/systemd to /run/elogind. Applications using...
Sven Eden [Mon, 23 Apr 2018 16:38:53 +0000 (18:38 +0200)]
Reverted accidential renaming of /run/systemd to /run/elogind. Applications using elogind as a drop-in replacement expect the first.

7 years agocheck_tree.pl: Do not change /run/systemd
Sven Eden [Mon, 23 Apr 2018 09:03:46 +0000 (11:03 +0200)]
check_tree.pl: Do not change /run/systemd

7 years agoFix 'double dash in comment' error.
Sven Eden [Fri, 20 Apr 2018 15:24:07 +0000 (17:24 +0200)]
Fix 'double dash in comment' error.

7 years agocheck_tree.pl: Add preparation for XML files.
Sven Eden [Fri, 20 Apr 2018 15:12:17 +0000 (17:12 +0200)]
check_tree.pl: Add preparation for XML files.

7 years agoUpdate man page sources to upstream tag v236 variants.
Sven Eden [Thu, 19 Apr 2018 16:37:32 +0000 (18:37 +0200)]
Update man page sources to upstream tag v236 variants.

7 years agoman/sd_id128_randomize.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/sd_id128_randomize.xml: Added check_tree.pl compatible elogind masking.

7 years agoman/logind.conf.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/logind.conf.xml: Added check_tree.pl compatible elogind masking.

7 years agoman/loginctl.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/loginctl.xml: Added check_tree.pl compatible elogind masking.

7 years agoman/elogind.xml: Added check_tree.pl compatible elogind masking.
Sven Eden [Thu, 19 Apr 2018 16:15:56 +0000 (18:15 +0200)]
man/elogind.xml: Added check_tree.pl compatible elogind masking.

7 years agocheck_tree.pl : Enhance XML handling.
Sven Eden [Thu, 19 Apr 2018 16:14:50 +0000 (18:14 +0200)]
check_tree.pl : Enhance XML handling.

7 years agoManpages: update elogind refentry for better handling through check_tree.pl
Sven Eden [Wed, 18 Apr 2018 15:09:23 +0000 (17:09 +0200)]
Manpages: update elogind refentry for better handling through check_tree.pl

7 years agoPrepare src/libelogind/libelogind.pc.in for better handling through check_tree.pl
Sven Eden [Wed, 18 Apr 2018 15:08:42 +0000 (17:08 +0200)]
Prepare src/libelogind/libelogind.pc.in for better handling through check_tree.pl

7 years agomissing_syscall: when adding syscall replacements, use different names (#8229)
Zbigniew Jędrzejewski-Szmek [Wed, 21 Feb 2018 13:04:50 +0000 (14:04 +0100)]
missing_syscall: when adding syscall replacements, use different names (#8229)

In meson.build we check that functions are available using:
    meson.get_compiler('c').has_function('foo')
which checks the following:
- if __stub_foo or __stub___foo are defined, return false
- if foo is declared (a pointer to the function can be taken), return true
- otherwise check for __builtin_memfd_create

_stub is documented by glibc as
   It defines a symbol '__stub_FUNCTION' for each function
   in the C library which is a stub, meaning it will fail
   every time called, usually setting errno to ENOSYS.

So if __stub is defined, we know we don't want to use the glibc version, but
this doesn't tell us if the name itself is defined or not. If it _is_ defined,
and we define our replacement as an inline static function, we get an error:

In file included from ../src/basic/missing.h:1358:0,
                 from ../src/basic/util.h:47,
                 from ../src/basic/calendarspec.h:29,
                 from ../src/basic/calendarspec.c:34:
../src/basic/missing_syscall.h:65:19: error: static declaration of 'memfd_create' follows non-static declaration
 static inline int memfd_create(const char *name, unsigned int flags) {
                   ^~~~~~~~~~~~
.../usr/include/bits/mman-shared.h:46:5: note: previous declaration of 'memfd_create' was here
 int memfd_create (const char *__name, unsigned int __flags) __THROW;
     ^~~~~~~~~~~~

To avoid this problem, call our inline functions different than glibc,
and use a #define to map the official name to our replacement.

Fixes #8099.

v2:
- use "missing_" as the prefix instead of "_"

v3:
- rebase and update for statx()

  Unfortunately "statx" is also present in "struct statx", so the define
  causes issues. Work around this by using a typedef.

I checked that systemd compiles with current glibc
(glibc-devel-2.26-24.fc27.x86_64) if HAVE_MEMFD_CREATE, HAVE_GETTID,
HAVE_PIVOT_ROOT, HAVE_SETNS, HAVE_RENAMEAT2, HAVE_KCMP, HAVE_KEYCTL,
HAVE_COPY_FILE_RANGE, HAVE_BPF, HAVE_STATX are forced to 0.

Setting HAVE_NAME_TO_HANDLE_AT to 0 causes an issue, but it's not because of
the define, but because of struct file_handle.

7 years agoPrep v236.1: To catch up with upstream, already branch out v236-stable.
Sven Eden [Thu, 29 Mar 2018 05:53:20 +0000 (07:53 +0200)]
Prep v236.1: To catch up with upstream, already branch out v236-stable.

7 years agoPrep v236: Adapt elogind parts in the build system to upstream changes.
Sven Eden [Mon, 26 Mar 2018 16:22:06 +0000 (18:22 +0200)]
Prep v236: Adapt elogind parts in the build system to upstream changes.

7 years agocheck_tree.pl: Added *.sym and *.in file handling.
Sven Eden [Fri, 16 Mar 2018 06:59:32 +0000 (07:59 +0100)]
check_tree.pl: Added *.sym and *.in file handling.

7 years agocheck_tree.pl: Do not remove empty lines prior masks/inserts. Do not rename 'systemd...
Sven Eden [Fri, 16 Mar 2018 05:56:25 +0000 (06:56 +0100)]
check_tree.pl: Do not remove empty lines prior masks/inserts. Do not rename 'systemd' in mask blocks.

7 years agocheck_tree.pl: chomp git rev-parse results.
Sven Eden [Thu, 15 Mar 2018 05:12:03 +0000 (06:12 +0100)]
check_tree.pl: chomp git rev-parse results.

7 years agoPrep v236: Update root build files.
Sven Eden [Thu, 15 Mar 2018 05:03:12 +0000 (06:03 +0100)]
Prep v236: Update root build files.

7 years agoPrep v236 : Add missing SPDX-License-Identifier (9/9) tools
Sven Eden [Tue, 13 Mar 2018 18:20:00 +0000 (19:20 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (9/9) tools

7 years agoPrep v236 : Add missing SPDX-License-Identifier (8/9) src/test
Sven Eden [Tue, 13 Mar 2018 18:19:10 +0000 (19:19 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (8/9) src/test

7 years agoPrep v236 : Add missing SPDX-License-Identifier (7/9) src/systemd
Sven Eden [Tue, 13 Mar 2018 18:18:29 +0000 (19:18 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (7/9) src/systemd

7 years agoPrep v236 : Add missing SPDX-License-Identifier (6/9) src/shared
Sven Eden [Tue, 13 Mar 2018 18:17:48 +0000 (19:17 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (6/9) src/shared

7 years agoPrep v236 : Add missing SPDX-License-Identifier (5/9) src/login
Sven Eden [Tue, 13 Mar 2018 18:14:05 +0000 (19:14 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (5/9) src/login

7 years agoPrep v236 : Add missing SPDX-License-Identifier (4/9) src/libelogind
Sven Eden [Tue, 13 Mar 2018 18:12:55 +0000 (19:12 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (4/9) src/libelogind

7 years agoPrep v236 : Add missing SPDX-License-Identifier (3/9) src/core
Sven Eden [Tue, 13 Mar 2018 18:12:26 +0000 (19:12 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (3/9) src/core

7 years agoPrep v236 : Add missing SPDX-License-Identifier (2/9) src/basic
Sven Eden [Tue, 13 Mar 2018 18:11:43 +0000 (19:11 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (2/9) src/basic

7 years agoPrep v236 : Add missing SPDX-License-Identifier (1/9) shell-completion
Sven Eden [Tue, 13 Mar 2018 18:10:50 +0000 (19:10 +0100)]
Prep v236 : Add missing SPDX-License-Identifier (1/9) shell-completion

7 years agoPrep v236: Remove obsolete files that have slithered in.
Sven Eden [Tue, 13 Mar 2018 18:16:48 +0000 (19:16 +0100)]
Prep v236: Remove obsolete files that have slithered in.

7 years agoPrep v236: Update build system and adapt to eloginds needs.
Sven Eden [Tue, 13 Mar 2018 18:05:56 +0000 (19:05 +0100)]
Prep v236: Update build system and adapt to eloginds needs.

7 years agoPrep v236: Apply missing upstream updates to the build system
Sven Eden [Tue, 13 Mar 2018 07:17:29 +0000 (08:17 +0100)]
Prep v236: Apply missing upstream updates to the build system

7 years agoNew: pwx/update_po_files.pl : Coment out all translations to non-existent files.
Sven Eden [Tue, 13 Mar 2018 07:16:23 +0000 (08:16 +0100)]
New: pwx/update_po_files.pl : Coment out all translations to non-existent files.

 => Update po translation files

7 years agocheck_tree.pl: Added the possibility to (manualy) check root files and enhanced shell...
Sven Eden [Tue, 13 Mar 2018 06:55:12 +0000 (07:55 +0100)]
check_tree.pl: Added the possibility to (manualy) check root files and enhanced shell mask handling.

7 years agoPrep v236: Update root level files
Sven Eden [Mon, 12 Mar 2018 05:59:45 +0000 (06:59 +0100)]
Prep v236: Update root level files

7 years agoUpdate TODO
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2017 13:12:39 +0000 (14:12 +0100)]
Update TODO

7 years agoMake taint message structured and add catalog entry
Zbigniew Jędrzejewski-Szmek [Thu, 14 Dec 2017 09:15:41 +0000 (10:15 +0100)]
Make taint message structured and add catalog entry

Dec 14 14:10:54 krowka elogind[1]: System is tainted: overflowgid-not-65534
-- Subject: The system is configured in a way that might cause problems
-- Defined-By: elogind
-- Support: https://lists.freedesktop.org/mailman/listinfo/elogind-devel
--
-- The following "tags" are possible:
-- - "split-usr" — /usr is a separate file system and was not mounted when elogind
--   was booted
-- - "cgroups-missing" — the kernel was compiled without cgroup support or access
--   to expected interface files is resticted
-- - "var-run-bad" — /var/run is not a symlink to /run
-- - "overflowuid-not-65534" — the kernel user ID used for "unknown" users (with
--   NFS or user namespaces) is not 65534
-- - "overflowgid-not-65534" — the kernel group ID used for "unknown" users (with
--   NFS or user namespaces) is not 65534
-- Current system is tagged as overflowgid-not-65534.

7 years agomeson: increase version numbers
Lennart Poettering [Mon, 11 Dec 2017 15:10:25 +0000 (16:10 +0100)]
meson: increase version numbers

7 years agocore: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown...
Daniel Black [Thu, 14 Dec 2017 11:17:43 +0000 (22:17 +1100)]
core: add EXTEND_TIMEOUT_USEC={usec} - prevent timeouts in startup/runtime/shutdown (#7214)

With Type=notify services, EXTEND_TIMEOUT_USEC= messages will delay any startup/
runtime/shutdown timeouts.

A service that hasn't timed out, i.e, start time < TimeStartSec,
runtime < RuntimeMaxSec and stop time < TimeoutStopSec, may by sending
EXTEND_TIMEOUT_USEC=, allow the service to continue beyond the limit for
the execution phase (i.e TimeStartSec, RunTimeMaxSec and TimeoutStopSec).

EXTEND_TIMEOUT_USEC= must continue to be sent (in the same way as
WATCHDOG=1) within the time interval specified to continue to reprevent
the timeout from occuring.

Watchdog timeouts are also extended if a EXTEND_TIMEOUT_USEC is greater
than the remaining time on the watchdog counter.

Fixes #5868.

7 years agoman: elogind.unit: move note about clearing lists (#7621)
Daniel Black [Thu, 14 Dec 2017 04:51:23 +0000 (15:51 +1100)]
man: elogind.unit: move note about clearing lists (#7621)

This is mainly for drop-in files.

7 years agosysctl: disable buffer while writing to /proc
Tiago Salem Herrmann [Tue, 12 Dec 2017 15:52:45 +0000 (13:52 -0200)]
sysctl: disable buffer while writing to /proc

fputs() writes only first 2048 bytes and fails
to write to /proc when values are larger than that.
This patch adds a new flag to WriteStringFileFlags
that make it possible to disable the buffer under
specific cases.

7 years agotree-wide: use STRLEN() to allocate buffer of constant size
Thomas Haller [Wed, 13 Dec 2017 07:41:11 +0000 (08:41 +0100)]
tree-wide: use STRLEN() to allocate buffer of constant size

Using strlen() to declare a buffer results in a variable-length array,
even if the compiler likely optimizes it to be a compile time constant.

When building with -Wvla, certain versions of gcc complain about such
buffers. Compiling with -Wvla has the advantage of preventing variably
length array, which defeat static asserts that are implemented by
declaring an array of negative length.

7 years agobasic/macros: add STRLEN() to get length of string literal as constant expression
Thomas Haller [Wed, 13 Dec 2017 07:17:07 +0000 (08:17 +0100)]
basic/macros: add STRLEN() to get length of string literal as constant expression

While the compiler likely optimizes strlen(x) for string literals,
it is not a constant expression.

Hence,

  char buffer[strlen("OPTION_000") + 1];

declares a variable-length array. STRLEN() can be used instead
when a constant espression is needed.

It's not entirely identical to strlen(), as STRLEN("a\0") counts 2.
Also, it only works with string literals and the macro enforces
that the argument is a literal.

7 years agomeson: link NSS modules with -z nodelete (#7607)
Lennart Poettering [Tue, 12 Dec 2017 19:13:16 +0000 (20:13 +0100)]
meson: link NSS modules with -z nodelete (#7607)

We might end up allocating mempools, and when we are unloaded we might
orphan them, thus leaking them. Hence, let's just stick around for good,
so the mempools remain referenced continously and for good, and thus no
memory is leaked (though the memory isn't cleaned up either).

Fixes: #7596
7 years agoverbs: add a new VERB_MUSTBEROOT flag
Lennart Poettering [Mon, 11 Dec 2017 22:10:11 +0000 (23:10 +0100)]
verbs: add a new VERB_MUSTBEROOT flag

Given that we regularly have verbs that require privileges, let's just
make this a flag of the verb.

7 years agotree-wide: drop a few == NULL and != NULL comparison
Lennart Poettering [Fri, 8 Dec 2017 19:52:38 +0000 (20:52 +0100)]
tree-wide: drop a few == NULL and != NULL comparison

Our CODING_STYLE suggests not comparing with NULL, but relying on C's
downgrade-to-bool feature for that. Fix up some code to match these
guidelines. (This is not comprehensive, the coccinelle output for this
is unfortunately kinda borked)

7 years agovirt: use XENFEAT_dom0 to detect the hardware domain (#6442, #6662) (#7581)
Olaf Hering [Fri, 8 Dec 2017 21:21:42 +0000 (22:21 +0100)]
virt: use XENFEAT_dom0 to detect the hardware domain (#6442, #6662) (#7581)

The detection of ConditionVirtualisation= relies on the presence of
/proc/xen/capabilities. If the file exists and contains the string
"control_d", the running system is a dom0 and VIRTUALIZATION_NONE should
be set. In case /proc/xen exists, or some sysfs files indicate "xen",
VIRTUALIZATION_XEN should be set to indicate the system is a domU.

With an (old) xenlinux based kernel, /proc/xen/capabilities is always
available and the detection described above works always. But with a
pvops based kernel, xenfs must be mounted on /proc/xen to get
"capabilities". This is done by a proc-xen.mount unit, which is part of
xen.git. Since the mounting happens "late", other units may be scheduled
before "proc-xen.mount". If these other units make use of
"ConditionVirtualisation=", the virtualization detection returns
incorect results. detect_vm() will set VIRTUALIZATION_XEN because "xen"
is found in sysfs. This value will be cached. Once xenfs is mounted, the
next process that runs detect_vm() will get VIRTUALIZATION_NONE.

This misdetection can be fixed by using
/sys/hypervisor/properties/features, which exports the value returned by
the "XENVER_get_features" hypercall. If the bit XENFEAT_dom0 is set, the
domain is the "hardware domain". It is supposed to have permissions to
access all hardware. The used sysfs file is available since v2.6.31.

The commonly used term "dom0" refers to the control domain which runs
the toolstack and has access to all hardware. But the virtualization
host may be configured such that one dedicated domain becomes the
"hardware domain", and another one the "toolstack domain".

7 years agoacl: fix typo in comment (#7580)
Yu Watanabe [Fri, 8 Dec 2017 12:34:25 +0000 (21:34 +0900)]
acl: fix typo in comment (#7580)

7 years agoresolved: implement D-Bus API for DNS-SD
Dmitry Rozhkov [Mon, 23 Oct 2017 11:46:13 +0000 (14:46 +0300)]
resolved: implement D-Bus API for DNS-SD

7 years agoman: missing whitespace (#7579)
Clinton Roy [Fri, 8 Dec 2017 02:44:20 +0000 (15:44 +1300)]
man: missing whitespace (#7579)

7 years agovirt: propagate errors in detect_vm_xen_dom0 (#7553)
Olaf Hering [Thu, 7 Dec 2017 20:09:32 +0000 (21:09 +0100)]
virt: propagate errors in detect_vm_xen_dom0 (#7553)

Update detect_vm_xen_dom0 to propagate errors in case reading
/proc/xen/capabilites fails. This does not fix any bugs, it just makes
it consistent with other functions called by detect_vm.

7 years agomeson: place elogind-sulogin-shell in build/
Zbigniew Jędrzejewski-Szmek [Thu, 7 Dec 2017 09:44:43 +0000 (10:44 +0100)]
meson: place elogind-sulogin-shell in build/

We do that will all executables so that it's easy to call them.

7 years agomeson: warn if nobody-user and nobody-group are set to different name
Yu Watanabe [Thu, 7 Dec 2017 08:19:11 +0000 (17:19 +0900)]
meson: warn if nobody-user and nobody-group are set to different name

It may work, but is very strange. So, let's warn about that.

v2:
Debian uses nobody and nogroup. Do not warn such case.

7 years agosysusers: use NOBODY_USER_NAME
Yu Watanabe [Thu, 7 Dec 2017 06:49:16 +0000 (15:49 +0900)]
sysusers: use NOBODY_USER_NAME

7 years agovirt: remove triple spurious newline
Lennart Poettering [Wed, 6 Dec 2017 19:16:30 +0000 (20:16 +0100)]
virt: remove triple spurious newline

7 years agovirt: use /proc/xen as indicator for a Xen domain (#6442, #6662) (#7555)
Olaf Hering [Wed, 6 Dec 2017 18:59:30 +0000 (19:59 +0100)]
virt: use /proc/xen as indicator for a Xen domain (#6442, #6662) (#7555)

The file /proc/xen/capabilities is only available if xenfs is mounted.

With a classic xenlinux based kernel that file is available
unconditionally. But with a modern pvops based kernel, xenfs must be
mounted before the "capabilities" may appear. xenfs is mounted very late
via .services files provided by the Xen toolstack. Other units may be
scheduled before xenfs is mounted, which will confuse the detection of
VIRTUALIZATION_XEN.

In all Xen enabled kernels, and if that kernel is actually running on
the Xen hypervisor, the "/proc/xen" directory is the reliable indicator
that this instance runs in a "Xen guest".

Adjust the code to check for /proc/xen instead of
/proc/xen/capabilities.

Fixes commit 3f61278b5 ("basic: Bugfix Detect XEN Dom0 as no virtualization")

7 years agoSet secure_boot flag in Kernel Zero-Page (#7482)
Max Resch [Wed, 6 Dec 2017 14:29:52 +0000 (15:29 +0100)]
Set secure_boot flag in Kernel Zero-Page (#7482)

Setting the secure_boot flag, avoids getting the printout
"EFI stub: UEFI Secure Boot is enabled." when booting
a Linux kernel with linuxx64.efi.stub and EFI SecureBoot enabled.

This is mainly a cosmetic fixup, as the "quiet" kernel parameter does
not silence pr_efi printouts in the linux kernel (this only works using
the efi stub from the linux source tree)

7 years agoAdded some missing Swedish Strings (#7552)
hanklank [Wed, 6 Dec 2017 12:52:25 +0000 (13:52 +0100)]
Added some missing Swedish Strings (#7552)

7 years agomeson: print warnings if the "nobody" user/group name is not compatible with the...
Lennart Poettering [Tue, 5 Dec 2017 10:00:24 +0000 (11:00 +0100)]
meson: print warnings if the "nobody" user/group name is not compatible with the local system

At least on Fedora and Debian systems this not obvious to get right,
hence warn.

7 years agouser-util: add UID_NOBODY defines that resolve to (uid_t) 65534
Lennart Poettering [Mon, 4 Dec 2017 16:06:56 +0000 (17:06 +0100)]
user-util: add UID_NOBODY defines that resolve to (uid_t) 65534

We use it all over the place, let's add a #define for it. Makes things
easier greppable, and more explanatory I think.

7 years agonss-elogind: tweak checks when we consult PID 1 for dynamic UID/GID lookups
Lennart Poettering [Sat, 2 Dec 2017 12:07:18 +0000 (13:07 +0100)]
nss-elogind: tweak checks when we consult PID 1 for dynamic UID/GID lookups

Instead of contacting PID 1 for dynamic UID/GID lookups for all
UIDs/GIDs that do not qualify as "system" do the more precise check
instead: check if they actually qualify for the "dynamic" range.

7 years agouser-util: add new uid_is_system() helper
Lennart Poettering [Sat, 2 Dec 2017 11:59:21 +0000 (12:59 +0100)]
user-util: add new uid_is_system() helper

This adds uid_is_system() and gid_is_system(), similar in style to
uid_is_dynamic(). That a helper like this is useful is illustrated by
the fact that test-condition.c didn't get the check right so far, which
this patch fixes.

7 years agobuild-sys: make the dynamic UID range, and the container UID range configurable
Lennart Poettering [Sat, 2 Dec 2017 11:48:31 +0000 (12:48 +0100)]
build-sys: make the dynamic UID range, and the container UID range configurable

Also, export these ranges in our pkg-config files.

7 years agoutil-lib: kill duplicate slashes in lookup paths
Zbigniew Jędrzejewski-Szmek [Thu, 23 Nov 2017 12:02:21 +0000 (13:02 +0100)]
util-lib: kill duplicate slashes in lookup paths

Since we're munging the array anyway, we can make the output a bit
nicer too.

7 years agohexdecoct: fix comment typo (#7548)
Lennart Poettering [Tue, 5 Dec 2017 15:42:58 +0000 (16:42 +0100)]
hexdecoct: fix comment typo (#7548)

7 years agostring-util: rework strextend() to optionally inset separators between each appended...
Lennart Poettering [Tue, 28 Nov 2017 15:37:53 +0000 (16:37 +0100)]
string-util: rework strextend() to optionally inset separators between each appended string

This adds a new flavour of strextend(), called
strextend_with_separator(), which takes an optional separator string. If
specified, the separator is inserted between each appended string, as
well as before the first one, but only if the original string was
non-empty.

This new call is particularly useful when appending new options to mount
option strings and suchlike, which need to be comma-separated, and
initially start out from an empty string.

7 years agomeson: fix indentation
Yu Watanabe [Tue, 5 Dec 2017 05:01:39 +0000 (14:01 +0900)]
meson: fix indentation

7 years agoutil-lib,tests: rework unbase64 so that we skip over whitespace automatically (#7522)
Lennart Poettering [Sun, 3 Dec 2017 19:57:24 +0000 (20:57 +0100)]
util-lib,tests: rework unbase64 so that we skip over whitespace automatically (#7522)

Let's optimize things a bit, and instead of having to strip whitespace
first before decoding base64, let's do that implicitly while doing so.
Given that base64 was designed the way it was designed specifically to
be tolerant to whitespace changes, it's a good idea to do this
automatically and implicitly.

7 years agosysusers: Provide meson argument to set gid for 'users' group (#7533)
Ikey Doherty [Sun, 3 Dec 2017 12:28:23 +0000 (12:28 +0000)]
sysusers: Provide meson argument to set gid for 'users' group (#7533)

To allow better integration with distributions requiring an explicitly
set gid for the `users` group, provide the new `-Dusers-gid` option to
set to a new numeric value.

In the absence of a specified gid, we'll fallback to the default existing
behaviour of `-` as the gid value, to automatically assign the next available
gid on the system.

7 years agofs-util: remove comment about non-existing function
Yu Watanabe [Thu, 30 Nov 2017 16:15:42 +0000 (01:15 +0900)]
fs-util: remove comment about non-existing function

7 years agofs-util: chase_symlinks(): remove unnecessary slash at the head
Yu Watanabe [Thu, 30 Nov 2017 17:19:44 +0000 (02:19 +0900)]
fs-util: chase_symlinks(): remove unnecessary slash at the head

Before this, chase_symlinks("/../../foo/bar",...) returns //foo/bar.
This removes the unnecessary slash at the head.

7 years ago*: fix some inconsistent control statement style
Vito Caputo [Sat, 2 Dec 2017 00:49:52 +0000 (16:49 -0800)]
*: fix some inconsistent control statement style

7 years agoNEWS: update the text a bit (#7524)
Zbigniew Jędrzejewski-Szmek [Fri, 1 Dec 2017 15:25:19 +0000 (16:25 +0100)]
NEWS: update the text a bit (#7524)

This fixes various typos, removes some duplications, and adds a bit more
detail in the few places which are potential pitfalls for users.
Also change the way the paragraphs about new options begin, because having
a paragraph saying "Two new options have been added", and then bit lower
again "Two new options have been added" is confusing.

7 years agoAdd x-elogind.growfs option for fstab
Zbigniew Jędrzejewski-Szmek [Wed, 29 Nov 2017 19:02:11 +0000 (20:02 +0100)]
Add x-elogind.growfs option for fstab

7 years agoAdd x-elogind.makefs option for fstab
Zbigniew Jędrzejewski-Szmek [Tue, 21 Nov 2017 22:18:05 +0000 (23:18 +0100)]
Add x-elogind.makefs option for fstab

I opted to completely generate a unit for both mount points and swaps. For
swaps, it would be possible to use fixed template unit like elogind-mkswap@.service,
because there's no information passed except the device name. For mount points,
that's not possible because both the device name and file system type need to
be passed. Nevertheless, I expect that options will need to passed to both mkfs
and mkswap, in which case it'll be necessary to create units of both types
anyway.

7 years agoAdd mkfs wrapper which first checks if the partition is empty
Zbigniew Jędrzejewski-Szmek [Sun, 26 Nov 2017 21:51:29 +0000 (22:51 +0100)]
Add mkfs wrapper which first checks if the partition is empty