chiark / gitweb /
elogind.git
7 years agocore: fix message about detected memory hierarchy
Zbigniew Jędrzejewski-Szmek [Wed, 15 Nov 2017 09:19:45 +0000 (10:19 +0100)]
core: fix message about detected memory hierarchy

Just the error check and message were wrong, otherwise the logic was OK.

7 years agoUse plural DelegateControllers= consistently
Zbigniew Jędrzejewski-Szmek [Tue, 14 Nov 2017 20:29:40 +0000 (21:29 +0100)]
Use plural DelegateControllers= consistently

7 years agologind: fix SetLinger to authorize by client's effective User ID
Alan Jenkins [Fri, 15 Sep 2017 16:35:02 +0000 (17:35 +0100)]
logind: fix SetLinger to authorize by client's effective User ID

SetLinger is authorized by the PolicyKit action "set-self-linger", if it is
not passed an explicit UID.

According to comments we were determining the default UID from the client's
session.  However, user processes e.g. which are run from a terminal
emulator do not necessarily belong to a session scope unit.  They may
equally be started from the elogind user manager [1][2].  Actually the
comment was wrong, and it would also have worked for processes
started from the elogind user manager.

Nevertheless it seems to involve fetching "augmented credentials" i.e.
it's using a racy method, so we shouldn't have been authenticating based
on it.

We could change the default UID, but that raises issues especially for
consistency between the methods.  Instead we can just use the clients
effective UID for authorization.

This commit also fixes `loginctl enable-linger $USER` to match the docs
that say it was equivalent to `loginctl enable-linger` (given that $USER
matches the callers user and owner_uid).  Previously, the former would not
have suceeded for unpriviliged users in the default configuration.

[1] It seems the main meaning of per-session scopes is tracking the PAM
login process.  Killing that provokes logind to revoke device access.  Less
circularly, killing it provokes getty to hangup the TTY.

[2] User units may be started with an environment which includes
XDG_SESSION_ID (presuambly GNOME does this?).  Or not.

7 years agologinctl: enable-linger does not need fallback to XDG_SESSION_ID
Alan Jenkins [Mon, 18 Sep 2017 17:04:59 +0000 (18:04 +0100)]
loginctl: enable-linger does not need fallback to XDG_SESSION_ID

To maintain consistency with `loginctl user-status`, drop the fallback to
XDG_SESSION_ID for `loginctl enable-linger`.  The fallback was unnecessary
and also incorrect: it passed the numeric value of the session identifier
as a UID value.

7 years agologind: "self" objects which do not apply - return specific error messages
Alan Jenkins [Sat, 14 Oct 2017 08:25:56 +0000 (09:25 +0100)]
logind: "self" objects which do not apply - return specific error messages

It's confusing that the bus API has aliases like "session/self" that return
an error based on ENXIO, when it also has methods that return e.g.
NO_SESSION_FOR_PID for the same problem.  The latter kind of error includes
more specifically helpful messages.

"user/self" is the odd one out; it returns a generic UnknownObject error
when it is not applicable to the caller.  It's not clear whether this was
intentional, but at first I thought it was more correct.  More
specifically, user_object_find() was returning 0 for "user/self", in the
same situations (more or less) where user_node_enumerator() was omitting
"user/self".  I thought that was a good idea, because returning e.g. -ENXIO instead
suggested that there _is_ something specific on that path.  And it could be
confused with errors of the method being called.

Therefore I suggested changing the enumerator, always admitting that there
is a handler for the path "foo/self", but returning a specific error when
queried.  However this interacts poorly with tools like D-Feet or `busctl`.
In either tool, looking at logind would show an error message, and then go
on to omit "user/self" in the normal listing.  These tools are very useful,
so we don't want to interfere with them.

I think we can change the error codes without causing problems.  The self
objects were not listed in the documentation.  They have been suggested to
other projects - but without reference to error reporting.  "seat/self" is
used by various Wayland compositors for VT switching, but they don't appear
to reference specific errors.

We _could_ insist on the link between enumeration and UnknownObject, and
standardize on that as the error for the aliases.  But I'm not aware of any
practical complaints, that we returned an error from an object that didn't
exist.

Instead, let's unify the codepaths for "user/self" vs GetUserByPid(0) etc.
We will return the most helpful error message we can think of, if the
object does not exist.  E.g. for "session/self", we might return an error
that the caller does not belong to a session.  If one of the compositors is
ever simplified to use "session/self" in initialization, users would be
able to trigger such errors (e.g. run `gnome-shell` inside gnome-terminal).
The message text will most likely be logged.  The user might not know what
the "session" is, but at least we'll be pointing towards the right
questions.  I think it should also be clearer for development / debugging.

Unifying the code paths is also slightly helpful for auditing / marking
calls to sd_bus_creds_get_session() in subsequent commits.

7 years agobasic: remove redundant check (#7320)
Topi Miettinen [Mon, 13 Nov 2017 21:00:03 +0000 (21:00 +0000)]
basic: remove redundant check (#7320)

The check is redundant as the whole block is only evaluated if
__IGNORE_pkey_mprotect is not defined. Change to #else.

7 years agocore: rework the Delegate= unit file setting to take a list of controller names
Lennart Poettering [Thu, 9 Nov 2017 14:29:34 +0000 (15:29 +0100)]
core: rework the Delegate= unit file setting to take a list of controller names

Previously it was not possible to select which controllers to enable for
a unit where Delegate=yes was set, as all controllers were enabled. With
this change, this is made configurable, and thus delegation units can
pick specifically what they want to manage themselves, and what they
don't care about.

7 years agoconf-parser: simplify things a bit by using strextend()
Lennart Poettering [Wed, 8 Nov 2017 20:38:51 +0000 (21:38 +0100)]
conf-parser: simplify things a bit by using strextend()

7 years agocgroup: make use of unit_get_subtree_mask() where appropriate
Lennart Poettering [Wed, 8 Nov 2017 18:16:03 +0000 (19:16 +0100)]
cgroup: make use of unit_get_subtree_mask() where appropriate

subtree_mask is own_mask | members_mask, let's make use of that to
shorten a few things

7 years agocgroup-util: add brief comments clarifying which controllers are v2-only and which...
Lennart Poettering [Wed, 8 Nov 2017 17:39:28 +0000 (18:39 +0100)]
cgroup-util: add brief comments clarifying which controllers are v2-only and which v1-only

7 years agobasic/missing: add numbers for pkey_mprotect
Zbigniew Jędrzejewski-Szmek [Mon, 13 Nov 2017 08:27:53 +0000 (09:27 +0100)]
basic/missing: add numbers for pkey_mprotect

Follow-up for b835eeb4ec1dd122b6feff2b70881265c529fcdd.

7 years agostring-util: when ellipsizing to a length if (size_t) -1, become a NOP
Lennart Poettering [Fri, 10 Nov 2017 20:41:53 +0000 (21:41 +0100)]
string-util: when ellipsizing to a length if (size_t) -1, become a NOP

Let's say that (size_t) -1 (i.e. SIZE_T_MAX) is equivalent to
"unbounded" ellipsation, i.e. ellipsation as NOP. In which case the
relevant functions become little more than strdup()/strndup().

This is useful to simplify caller code in case we want to turn off
ellipsation in certain code paths with minimal caller-side handling for
this.

7 years agopager: cache not only number of columns but also of lines before we open pager
Lennart Poettering [Fri, 10 Nov 2017 20:10:17 +0000 (21:10 +0100)]
pager: cache not only number of columns but also of lines before we open pager

Not that we need it, but let's do this as matter of completeness.

7 years agocore: track why unit dependencies came to be
Lennart Poettering [Wed, 25 Oct 2017 18:46:01 +0000 (20:46 +0200)]
core: track why unit dependencies came to be

This replaces the dependencies Set* objects by Hashmap* objects, where
the key is the depending Unit, and the value is a bitmask encoding why
the specific dependency was created.

The bitmask contains a number of different, defined bits, that indicate
why dependencies exist, for example whether they are created due to
explicitly configured deps in files, by udev rules or implicitly.

Note that memory usage is not increased by this change, even though we
store more information, as we manage to encode the bit mask inside the
value pointer each Hashmap entry contains.

Why this all? When we know how a dependency came to be, we can update
dependencies correctly when a configuration source changes but others
are left unaltered. Specifically:

1. We can fix UDEV_WANTS dependency generation: so far we kept adding
   dependencies configured that way, but if a device lost such a
   dependency we couldn't them again as there was no scheme for removing
   of dependencies in place.

2. We can implement "pin-pointed" reload of unit files. If we know what
   dependencies were created as result of configuration in a unit file,
   then we know what to flush out when we want to reload it.

3. It's useful for debugging: "elogind-analyze dump" now shows
   this information, helping substantially with understanding how
   elogind's dependency tree came to be the way it came to be.

7 years agovirt: trivial whitespace fixes
Lennart Poettering [Tue, 24 Oct 2017 10:18:27 +0000 (12:18 +0200)]
virt: trivial whitespace fixes

7 years agobasic/hashmap: add cleanup of memory pools (#7164)
Zbigniew Jędrzejewski-Szmek [Fri, 10 Nov 2017 14:44:58 +0000 (15:44 +0100)]
basic/hashmap: add cleanup of memory pools (#7164)

It was dropped in 89439d4fc0d29f04ac68432fd06ab84bc4e36e20. As a result, every
process that uses a hashmap allocates and then leaks the hashmap mempools.
The mempools are only allocated in the main thread, but we don't know where
the memory is used.

So let's check if we are the last thread and free the mempools then. This is
fairly heavy, because /proc/self/status has to be opened and parsed, but we do
it only when compiled for valgrind, i.e. not by default, and compared to running
under valgrind or asan, the extra cost is acceptable. The big advantage is that
we don't have to think or filter out this false positive.

As a micro-opt, cleanup is attempted only in the main thread. We could allow
any thread to check if it is the last one and perform cleanup, but that'd mean
that we'd have to _do_ the check in every thread. We don't use threads like
that, our non-main threads are always short-lived, so let's just accept the
possibility that we'll leak memory if a thread survives. The check is also
non-atomic, but it's called in a destructor of the main thread _and_ we do
cleanup only when there are no other threads, so the risk of some library
suddenly spawning another thread is very low. All in all, this is not perfect,
but should work in 999‰ of cases.

Fixes the following valgrind warning:

==22564== HEAP SUMMARY:
==22564==     in use at exit: 8,192 bytes in 2 blocks
==22564==   total heap usage: 243 allocs, 241 frees, 151,905 bytes allocated
==22564==
==22564== 4,096 bytes in 1 blocks are still reachable in loss record 1 of 2
==22564==    at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
==22564==    by 0x4F08A8C: mempool_alloc_tile (mempool.c:62)
==22564==    by 0x4F08B16: mempool_alloc0_tile (mempool.c:81)
==22564==    by 0x4EF8DE0: hashmap_base_new (hashmap.c:748)
==22564==    by 0x4EF8ED9: internal_hashmap_new (hashmap.c:782)
==22564==    by 0x11045D: test_hashmap_copy (test-hashmap-plain.c:87)
==22564==    by 0x115722: test_hashmap_funcs (test-hashmap-plain.c:914)
==22564==    by 0x10FC9D: main (test-hashmap.c:60)
==22564==
==22564== 4,096 bytes in 1 blocks are still reachable in loss record 2 of 2
==22564==    at 0x4C2FB6B: malloc (vg_replace_malloc.c:299)
==22564==    by 0x4F08A8C: mempool_alloc_tile (mempool.c:62)
==22564==    by 0x4F08B16: mempool_alloc0_tile (mempool.c:81)
==22564==    by 0x4EF8DE0: hashmap_base_new (hashmap.c:748)
==22564==    by 0x4EF8EF8: internal_ordered_hashmap_new (hashmap.c:786)
==22564==    by 0x10A2A0: test_ordered_hashmap_copy (test-hashmap-ordered.c:89)
==22564==    by 0x10F70F: test_ordered_hashmap_funcs (test-hashmap-ordered.c:916)
==22564==    by 0x10FCA2: main (test-hashmap.c:61)
==22564==
==22564== LEAK SUMMARY:
==22564==    definitely lost: 0 bytes in 0 blocks
==22564==    indirectly lost: 0 bytes in 0 blocks
==22564==      possibly lost: 0 bytes in 0 blocks
==22564==    still reachable: 8,192 bytes in 2 blocks
==22564==         suppressed: 0 bytes in 0 blocks

v2:
- check if we are the main thread

v3:
- check if there are no other threads

7 years agoelogind-firstboot: add vconsole keymap support (#7035)
tblume [Fri, 10 Nov 2017 09:31:44 +0000 (10:31 +0100)]
elogind-firstboot: add vconsole keymap support (#7035)

Enable elogind-firstboot to set the keymap.

RFE:

https://github.com/elogind/elogind/issues/6346

7 years agotree-wide: do not work in assert()
Yu Watanabe [Thu, 9 Nov 2017 09:38:02 +0000 (18:38 +0900)]
tree-wide: do not work in assert()

Follow-up for 85e55d14dea66f5fe412ca8128487d5ea828b7b1.

7 years agoudev-rules: Permission changes for /dev/dri/renderD*
Tom Stellard [Tue, 31 Oct 2017 15:46:24 +0000 (08:46 -0700)]
udev-rules: Permission changes for /dev/dri/renderD*

- Remove the uaccess tag from /dev/dri/renderD*.
- Change the owning group from video to render.
- Change default mode to 0666.
- Add an option to allow users to set the access mode for these devices at
compile time.

7 years agoudev-rules: Permission changes for /dev/kvm
Tom Stellard [Tue, 31 Oct 2017 15:41:53 +0000 (08:41 -0700)]
udev-rules: Permission changes for /dev/kvm

- Remove uaccess tag from /dev/kvm.
- Change the default mode for /dev/kvm to 0666.

7 years agotree-wide: do not work in assert() (#7271)
Yu Watanabe [Tue, 7 Nov 2017 13:04:20 +0000 (22:04 +0900)]
tree-wide: do not work in assert() (#7271)

Fixes #7270.

7 years agotest-util: silence clang warning about unaligned access
Zbigniew Jędrzejewski-Szmek [Wed, 1 Nov 2017 22:06:27 +0000 (23:06 +0100)]
test-util: silence clang warning about unaligned access

7 years agoutil-lib: mark variable with _unused_ to silence clang warning
Zbigniew Jędrzejewski-Szmek [Wed, 1 Nov 2017 22:01:24 +0000 (23:01 +0100)]
util-lib: mark variable with _unused_ to silence clang warning

_unused_ means "the variable is meant to be possible unused and gcc
will not generate a warning about it", which is exactly what we need here,
since we're only declaring it for the side effect of _cleanup_.

7 years agoRemove a bunch of unused variables
Zbigniew Jędrzejewski-Szmek [Wed, 1 Nov 2017 21:32:22 +0000 (22:32 +0100)]
Remove a bunch of unused variables

gcc does not warn about those, because of the _cleanup_ usage.
clang is smarter here.

7 years agomeson: do not include man/meson.build if xsltproc not found
Yu Watanabe [Tue, 31 Oct 2017 08:12:13 +0000 (17:12 +0900)]
meson: do not include man/meson.build if xsltproc not found

Fixes #7232.

7 years agofs-util: small tweak in chase_symlinks()
Lennart Poettering [Wed, 4 Oct 2017 15:34:03 +0000 (17:34 +0200)]
fs-util: small tweak in chase_symlinks()

If we follow an absolute symlink there's no need to prefix the path with
a "/", since by definition it already has one.

This helps suppressing double "/" in resolved paths containing absolute
symlinks.

7 years agoelogind-detect-virt: refine hypervisor detection (#7171)
Razvan Cojocaru [Thu, 26 Oct 2017 14:59:04 +0000 (17:59 +0300)]
elogind-detect-virt: refine hypervisor detection (#7171)

Continue to try to get more details about the actual underlying
hypervisor with successive tests until none are available.
This fixes issue #7165.

7 years agoAdding timer_event to wakeup as suggested by MHD_get_timeout (#7152)
martingh [Thu, 26 Oct 2017 08:54:30 +0000 (10:54 +0200)]
Adding timer_event to wakeup as suggested by MHD_get_timeout (#7152)

7 years agomodprobe.d: fix directory of modprobe configuration file (#7149)
Michael Biebl [Sat, 21 Oct 2017 06:32:50 +0000 (08:32 +0200)]
modprobe.d: fix directory of modprobe configuration file (#7149)

kmod upstream uses /lib/modprobe.d which means we need to use rootprefix
instead of prefix for installing the modprobe configuration file as
otherwise split-usr systems are broken.

See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=879191

7 years agologind: allow two very close error messages to be distinguished
Zbigniew Jędrzejewski-Szmek [Sat, 14 Oct 2017 10:43:06 +0000 (12:43 +0200)]
logind: allow two very close error messages to be distinguished

In https://bugzilla.redhat.com/show_bug.cgi?id=1486859 error messages appera:

Sep 06 19:09:07 ld92.e.math.uh.edu audit[21482]: AVC avc:  denied  { read } for  pid=21482 comm="elogind-logind" name="dbus-1" dev="tmpfs" ino=5548194 scontext=system_u:system_r:elogind_logind_t:s0 tcontext=unconfined_u:object_r:session_dbusd_tmp_t:s0 tclass=dir permissive=0
Sep 06 19:09:07 ld92.e.math.uh.edu elogind-logind[21482]: Failed to remove runtime directory /run/user/8664: Permission denied

But it's not clear which of the two rm_rf's is the source. Let's make
them different.

7 years agoutil-lib: simplify kexec_loaded()
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2017 21:00:54 +0000 (23:00 +0200)]
util-lib: simplify kexec_loaded()

7 years agomeson: drop unneeded check for grep
Zbigniew Jędrzejewski-Szmek [Sun, 15 Oct 2017 17:47:16 +0000 (19:47 +0200)]
meson: drop unneeded check for grep

7 years agomodprobe.d: expand drop-in to handle dummy0 as well (#7099)
Mantas Mikulėnas [Mon, 16 Oct 2017 15:17:47 +0000 (18:17 +0300)]
modprobe.d: expand drop-in to handle dummy0 as well (#7099)

7 years agobasic/env-util: don't relax unesaping of serialized environment strings
Lubomir Rintel [Wed, 11 Oct 2017 13:05:38 +0000 (15:05 +0200)]
basic/env-util: don't relax unesaping of serialized environment strings

We wrote them ourselves -- they shouldn't contain invalid sequences.

7 years agobasic/env-util: drop the validation when deserializing environment
Lubomir Rintel [Wed, 11 Oct 2017 07:29:30 +0000 (09:29 +0200)]
basic/env-util: drop the validation when deserializing environment

The environment variables we've serialized can quite possibly contain
characters outside the set allowed by env_assignment_is_valid(). In
fact, my environment seems to contain a couple of these:

  * TERMCAP set by screen contains a '\x7f' character
  * BASH_FUNC_module%% variable has a '%' character in name

Strict check of environment variables name and value certainly makes sense for
unit files, but not so much for deserialization of values we already had
in our environment.

7 years agopwx tools: Make location agnostic.
Sven Eden [Fri, 9 Mar 2018 17:41:25 +0000 (18:41 +0100)]
pwx tools: Make location agnostic.

7 years agoVersion 235.3 Release v235.3
Sven Eden [Fri, 9 Mar 2018 06:57:50 +0000 (07:57 +0100)]
Version 235.3 Release

7 years agocheck_tree.pl: Added handling of xml files.
Sven Eden [Fri, 9 Mar 2018 06:53:40 +0000 (07:53 +0100)]
check_tree.pl: Added handling of xml files.

7 years agocheck_tree.pl : Add handling of .gperf files.
Sven Eden [Fri, 9 Mar 2018 06:32:56 +0000 (07:32 +0100)]
check_tree.pl : Add handling of .gperf files.

7 years agocheck_tree.pl: Do not search 'po' directory. Better resurrect (aka rewrite) 'update_p...
Sven Eden [Fri, 9 Mar 2018 06:22:12 +0000 (07:22 +0100)]
check_tree.pl: Do not search 'po' directory. Better resurrect (aka rewrite) 'update_po.sh'

7 years agocheck_tree.pl: Do not allow commented out includes to be moved under our elogind...
Sven Eden [Thu, 8 Mar 2018 07:18:48 +0000 (08:18 +0100)]
check_tree.pl: Do not allow commented out includes to be moved under our elogind block.

7 years agocheck_tree.pl: Handle renames elogind<=>systemd-logind correctly.
Sven Eden [Wed, 7 Mar 2018 17:08:37 +0000 (18:08 +0100)]
check_tree.pl: Handle renames elogind<=>systemd-logind correctly.

7 years agoAdd migration tools for safe keeping.
Sven Eden [Wed, 7 Mar 2018 16:51:03 +0000 (17:51 +0100)]
Add migration tools for safe keeping.

7 years agosystemdstatedir is not used anywhere and leads to an empty directory being created...
Sven Eden [Wed, 7 Mar 2018 16:39:55 +0000 (17:39 +0100)]
systemdstatedir is not used anywhere and leads to an empty directory being created upon install. -> removed.

7 years agoSome minor cleanups
Sven Eden [Wed, 7 Mar 2018 16:35:44 +0000 (17:35 +0100)]
Some minor cleanups

7 years agotools/check-includes.pl : Prepared for check-tree.pl handling.
Sven Eden [Tue, 6 Mar 2018 07:34:00 +0000 (08:34 +0100)]
tools/check-includes.pl : Prepared for check-tree.pl handling.

7 years agoMeson build system: Add missing '#' in masked blocks
Sven Eden [Tue, 6 Mar 2018 07:19:58 +0000 (08:19 +0100)]
Meson build system: Add missing '#' in masked blocks

7 years agotools/check-includes.pl : Fixed errors. The constant long list of errors in Eclipse...
Sven Eden [Fri, 2 Feb 2018 06:15:23 +0000 (07:15 +0100)]
tools/check-includes.pl : Fixed errors. The constant long list of errors in Eclipse Epic drove me nuts. ;-)

7 years agoFix build on musl
Bjorn Pagen [Thu, 22 Feb 2018 22:05:31 +0000 (17:05 -0500)]
Fix build on musl

Before this fix, elogind did not compile on musl, as the header "musl-missing.h" tries to include a nonexistant header: "config.h". This patch fixes that. Musl compiles with no issues once this patch is administered.

7 years agouaccess-command: [trivial] Differentiate apply vs reset error log messages.
Arthur Taylor [Tue, 13 Feb 2018 19:51:19 +0000 (11:51 -0800)]
uaccess-command: [trivial] Differentiate apply vs reset error log messages.

Also change systemd to logind in a comment.

7 years agoIntroduce elogind-uaccess-command to replace uaccess builtin.
Arthur Taylor [Thu, 8 Feb 2018 23:03:50 +0000 (15:03 -0800)]
Introduce elogind-uaccess-command to replace uaccess builtin.

The uaccess udev builtin command is only used by logind and contains
functionality only implemented in logind. As such, while we cannot
write udev-builtin commands in elogind (not being udev), we can write
standalone binaries and rewrite our udev rules to use them instead.

This fixes the feature of granting users access to devices using a user
ACL which is toggled only when the user is associated with an active
session. Currently this functionality is half broken, as while the ACL
is granted and revoked while VT-switching, it is not granted to new
devices as they are plugged in. This issue is fixed by this commit.

7 years agoClose stdin, stdout and stderr on daemonizing
Andreas Messer [Sat, 27 Jan 2018 18:34:24 +0000 (19:34 +0100)]
Close stdin, stdout and stderr on daemonizing

7 years agotest/test-hexdecoct.c: Add include for musl_missin.h for strndupa().
Sven Eden [Thu, 25 Jan 2018 06:52:49 +0000 (07:52 +0100)]
test/test-hexdecoct.c: Add include for musl_missin.h for strndupa().
shared/musl_missing.h: Rewrite strndupa() define to use x_ prefixed
                       variables, so they won't shadow surronding
                       variables of the same name.

7 years agotest/test-parse-util.c: Masked the test of strtod() with set german
Sven Eden [Thu, 25 Jan 2018 06:40:28 +0000 (07:40 +0100)]
test/test-parse-util.c: Masked the test of strtod() with set german
locale to be only used with __GLIBC__.

It seems that the strtod() function in stdlib.h from musl_libc does
not heed the set locale. It fails with a german floating point
number.

7 years agotest/test-sizeof.c: disable tests for missing typedefs in musl
maxice8 [Tue, 16 Jan 2018 11:08:15 +0000 (09:08 -0200)]
test/test-sizeof.c: disable tests for missing typedefs in musl

7 years agowork-around usage of glibc-specific __register_atfork for musl systems
maxice8 [Tue, 16 Jan 2018 10:29:32 +0000 (08:29 -0200)]
work-around usage of glibc-specific __register_atfork for musl systems

__register_atfork is glibc-specific but is roughly equivalent to
pthread_atfork, add a definition of it on musl_missing.h and guard
against the definition of __register_atfork on src/basic/process-util.c
using #ifdef __GLIBC__

7 years agoshared/musl_missing.h: replace ifdef with if on HAVE_[__]SECURE_GETENV
maxice8 [Tue, 16 Jan 2018 10:25:32 +0000 (08:25 -0200)]
shared/musl_missing.h: replace ifdef with if on HAVE_[__]SECURE_GETENV

now meson defines itself on config.h HAVE_[__]SECURE_GETENV, instead of
checking if it is defined, check if it set to false value.

also undefine before redefining it to true.

7 years agoshared/musl_missing.h: replace ifdef HAVE_UTMP with if ENABLE_UTMP
maxice8 [Tue, 16 Jan 2018 10:23:17 +0000 (08:23 -0200)]
shared/musl_missing.h: replace ifdef HAVE_UTMP with if ENABLE_UTMP

now meson defines if the feature is enabled or not, check if the
feature is enabled

7 years agoPrep v235.3 : Fix cgroup hierarchy detection code
Sven Eden [Thu, 18 Jan 2018 22:01:12 +0000 (23:01 +0100)]
Prep v235.3 : Fix cgroup hierarchy detection code

There is no sub-grouping with elogind, so /sys/fs/cgroup/elogind is
not needed to be mounted as cgroup fs in legacy mode.

Fixes Bug https://bugs.gentoo.org/644834

7 years agoVersion 235.2 Release v235.2
Sven Eden [Mon, 15 Jan 2018 19:34:18 +0000 (20:34 +0100)]
Version 235.2 Release

7 years agoIf elogind is just started, /sys/fs/cgroup/elogind might not exist, yet on legacy...
Sven Eden [Mon, 15 Jan 2018 19:20:52 +0000 (20:20 +0100)]
If elogind is just started, /sys/fs/cgroup/elogind might not exist, yet on legacy and hybrid systems.

7 years agoVersion 235.1 Release v235.1
Sven Eden [Sun, 14 Jan 2018 17:09:55 +0000 (18:09 +0100)]
Version 235.1 Release

7 years agoPrep 235: Don't allow multiple jobs being executed at the same time
Sven Eden [Sun, 14 Jan 2018 17:07:25 +0000 (18:07 +0100)]
Prep 235: Don't allow multiple jobs being executed at the same time

7 years agoPrep 235: Removed orphaned header
Sven Eden [Thu, 11 Jan 2018 07:12:13 +0000 (08:12 +0100)]
Prep 235: Removed orphaned header

7 years agoPrep 235: Make cgroups2 available, hybrid mode already works.
Sven Eden [Wed, 10 Jan 2018 17:06:23 +0000 (18:06 +0100)]
Prep 235: Make cgroups2 available, hybrid mode already works.

7 years agoPrep 235: Make elogind masks in sd-bus.h c90 compatible again.
Sven Eden [Tue, 9 Jan 2018 17:59:35 +0000 (18:59 +0100)]
Prep 235: Make elogind masks in sd-bus.h c90 compatible again.

7 years agoPrep 235: Enabled sd_peer_get_session() and sd_peer_get_owner_uid() to try to work...
Sven Eden [Tue, 9 Jan 2018 17:57:22 +0000 (18:57 +0100)]
Prep 235: Enabled sd_peer_get_session() and sd_peer_get_owner_uid() to try to work with eloginds session id to user mapping.

7 years agoPrep 235: Enabled sd_bus_creds_get_slice(), sd_bus_creds_get_user_slice(), sd_peer_ge...
Sven Eden [Tue, 9 Jan 2018 17:52:14 +0000 (18:52 +0100)]
Prep 235: Enabled sd_bus_creds_get_slice(), sd_bus_creds_get_user_slice(), sd_peer_get_user_slice() and sd_pid_get_user_slice() to try to work with eloginds session id to user mapping.

7 years agoPrep 235: Enabled sd_peer_get_slice() and sd_pid_get_slice() to at least try to work...
Sven Eden [Tue, 9 Jan 2018 17:35:22 +0000 (18:35 +0100)]
Prep 235: Enabled sd_peer_get_slice() and sd_pid_get_slice() to at least try to work. This is considered experimental.

7 years agoPrep 235: Although systemd slices are unsupported, make cg_path_get_slice() available...
Sven Eden [Tue, 9 Jan 2018 08:13:45 +0000 (09:13 +0100)]
Prep 235: Although systemd slices are unsupported, make cg_path_get_slice() available, but in 'elogind jargon'

7 years agosrc/systemd/meson.build: Fix add_install_script() call
Sven Eden [Tue, 9 Jan 2018 07:46:25 +0000 (08:46 +0100)]
src/systemd/meson.build: Fix add_install_script() call

7 years agoRemove coccinelle files that slithered back in.
Sven Eden [Mon, 8 Jan 2018 17:42:40 +0000 (18:42 +0100)]
Remove coccinelle files that slithered back in.

7 years agoDev: Add loginctl target to Code::Blocks project file
Sven Eden [Mon, 8 Jan 2018 07:37:08 +0000 (08:37 +0100)]
Dev: Add loginctl target to Code::Blocks project file

7 years agoPrep 235: Add loginctl target to Makefile
Sven Eden [Mon, 8 Jan 2018 07:36:28 +0000 (08:36 +0100)]
Prep 235: Add loginctl target to Makefile

7 years agoForgot to symlink _sdcommon.h
Sven Eden [Fri, 15 Dec 2017 05:01:07 +0000 (06:01 +0100)]
Forgot to symlink _sdcommon.h

7 years agoPrep 235: Implement an alternative approach for sd_pid_get_owner_uid(), making test...
Sven Eden [Wed, 13 Dec 2017 18:21:30 +0000 (19:21 +0100)]
Prep 235: Implement an alternative approach for sd_pid_get_owner_uid(), making test-login to no longer fail.

7 years agoAdd test-login target for Code::Blocks for easier debugging.
Sven Eden [Wed, 13 Dec 2017 07:54:48 +0000 (08:54 +0100)]
Add test-login target for Code::Blocks for easier debugging.

7 years agosd-bus.h, sd-daemon.h : MAke elogind masks ISO C90 compatible.
Sven Eden [Wed, 13 Dec 2017 07:50:52 +0000 (08:50 +0100)]
sd-bus.h, sd-daemon.h : MAke elogind masks ISO C90 compatible.

7 years agobasic/siphash24.c: Only disable -Wimplicit-fallthrough on gcc-7+
Sven Eden [Tue, 12 Dec 2017 17:35:44 +0000 (18:35 +0100)]
basic/siphash24.c: Only disable -Wimplicit-fallthrough on gcc-7+

7 years agoUpdate README - Attempt to reduce the chance of becoming flame-bait.
Sven Eden [Tue, 12 Dec 2017 17:32:40 +0000 (18:32 +0100)]
Update README - Attempt to reduce the chance of becoming flame-bait.

7 years agoPrep v234.4: ake all supportable API functions visible
Sven Eden [Tue, 12 Dec 2017 17:21:24 +0000 (18:21 +0100)]
Prep v234.4: ake all supportable API functions visible
 (v234 addition).

7 years ago Prep v237.3: Make all supportable API functions visible
Sven Eden [Tue, 12 Dec 2017 17:18:28 +0000 (18:18 +0100)]
 Prep v237.3: Make all supportable API functions visible
(v233 addition).

7 years agoPrep v232.6: Make all supportable API functions visible
Sven Eden [Tue, 12 Dec 2017 17:06:57 +0000 (18:06 +0100)]
Prep v232.6: Make all supportable API functions visible
 (v232 addition).

7 years agotime-util: Disable explicit fallthrough wanring on gcc-7+
Sven Eden [Tue, 12 Dec 2017 17:02:58 +0000 (18:02 +0100)]
time-util: Disable explicit fallthrough wanring on gcc-7+

7 years agoPrep 229.9: Make all supportable API functions visible.
Sven Eden [Tue, 12 Dec 2017 06:54:16 +0000 (07:54 +0100)]
Prep 229.9: Make all supportable API functions visible.

The process of cleaning up elogind, meaning to mask all bits that are
unneeded by elogind, has been finished a while ago.

It is therefore time to re-enable all previously masked API functions
that elogind can support. This will make it easier for future
developers to integrate elogind into their software where they
already support systemd-login.

7 years agoMask unused entries in .po files.
Sven Eden [Mon, 11 Dec 2017 16:14:55 +0000 (17:14 +0100)]
Mask unused entries in .po files.

7 years agobasic/exec-utils:do_execute() : Remove "maybe unitialized" warning
Sven Eden [Mon, 11 Dec 2017 16:12:50 +0000 (17:12 +0100)]
basic/exec-utils:do_execute() : Remove "maybe unitialized" warning

7 years agoCleaned up orphaned files
Sven Eden [Mon, 11 Dec 2017 16:06:40 +0000 (17:06 +0100)]
Cleaned up orphaned files

7 years agosrc/basic/meson.build: Prepare generate_cap_list fix for our migration scripts
Sven Eden [Mon, 11 Dec 2017 07:33:35 +0000 (08:33 +0100)]
src/basic/meson.build: Prepare generate_cap_list fix for our migration scripts

7 years agoFix and fortify cap-list generation and inlcude symlinking for gentoo build system.
Sven Eden [Sun, 10 Dec 2017 14:15:12 +0000 (15:15 +0100)]
Fix and fortify cap-list generation and inlcude symlinking for gentoo build system.

7 years agoMeson build system: Recreate the symlinking of elogind/systemd/*.h headers into elogin/
Sven Eden [Fri, 8 Dec 2017 16:53:48 +0000 (17:53 +0100)]
Meson build system: Recreate the symlinking of elogind/systemd/*.h headers into elogin/

7 years agoFix various build failures with the latest systemd updates.
Sven Eden [Fri, 8 Dec 2017 16:52:41 +0000 (17:52 +0100)]
Fix various build failures with the latest systemd updates.

7 years agoApply missing updates from upstream
Sven Eden [Fri, 8 Dec 2017 07:02:34 +0000 (08:02 +0100)]
Apply missing updates from upstream

7 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.

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

7 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

7 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 elogind versions.

Fixes: #6402
7 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.

7 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.

7 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.