chiark / gitweb /
elogind.git
6 years agologind: add missing check for conflicting operation v.s. scheduled shutdown
Alan Jenkins [Mon, 21 Aug 2017 10:49:25 +0000 (11:49 +0100)]
logind: add missing check for conflicting operation v.s. scheduled shutdown

> We don't want to shutdown while a suspend is running, and vice versa.
> This would be confusing and could lead to data loss in the worst case.

https://bugs.launchpad.net/ubuntu/+source/elogind/+bug/1441253/comments/4

According to the above comment, if the conflicting operation is hung,
we don't want to force things when the admin has not passed a force option.

Similarly if you're not an admin, you probably shouldn't get to sneak
around this check by using a scheduled shutdown instead of an unscheduled
one.  (And no-one so far thought it necessary to add such a permission in
PolKit).

Note that if the conflicting operation was _not_ hung, and we lost the
race with suspend, the system might not have shut down at the scheduled
time anyway.  Which is no good if you were scheduling a power outage.
And scheduling a shutdown for an arbitrary time when the system is resumed,
does not seem a very useful semantic.  More likely, scheduled shutdowns are
useful on systems which do not use suspend, such as multi-user servers.
(In which case even PolKit defaults likely don't let the users trigger
suspend).

6 years agologind: method_schedule_shutdown() already rejects empty `type`
Alan Jenkins [Tue, 22 Aug 2017 12:54:21 +0000 (13:54 +0100)]
logind: method_schedule_shutdown() already rejects empty `type`

Don't test for an empty `type` afterwards.  This is not how you cancel
scheduled shutdowns - there's a separate method for that.

6 years agobuild-sys: don't build networkctl if networkd is disabled
Felipe Sateler [Mon, 21 Aug 2017 12:48:41 +0000 (09:48 -0300)]
build-sys: don't build networkctl if networkd is disabled

6 years agocapability: add new ambient_capabilities_supported() helper
Lennart Poettering [Wed, 9 Aug 2017 13:07:15 +0000 (15:07 +0200)]
capability: add new ambient_capabilities_supported() helper

This new function reports whether ambient caps are available, and should
be quick because the result is cached.

6 years agocapability: change capability_bounding_set_drop() to be work without privileges when...
Lennart Poettering [Wed, 9 Aug 2017 13:05:36 +0000 (15:05 +0200)]
capability: change capability_bounding_set_drop() to be work without privileges when executing a NOP

This way daemons which already dropped all caps may use the call to
drop priviliges again, which becomes a non-failing NOP.

6 years agotree-wide: use path_startswith() rather than startswith() where ever that's appropriate
Lennart Poettering [Wed, 9 Aug 2017 17:03:39 +0000 (19:03 +0200)]
tree-wide: use path_startswith() rather than startswith() where ever that's appropriate

When checking path prefixes we really should use the right APIs, just in
case people add multiple slashes to their paths...

6 years agoutil-lib: add a new skip_dev_prefix() helper
Lennart Poettering [Wed, 9 Aug 2017 17:01:18 +0000 (19:01 +0200)]
util-lib: add a new skip_dev_prefix() helper

This new helper removes a leading /dev if there is one. We have code
doing this all over the place, let's unify this, and correct it while
we are at it, by using path_startswith() rather than startswith() to
drop the prefix.

6 years agoPrep v235: Update test-login.c
shwsh [Tue, 5 Sep 2017 15:23:33 +0000 (22:23 +0700)]
Prep v235: Update test-login.c

 * Merge pull request #29 from shwsh/master

6 years agoPrep v235: Allow elogind to be auto-started by dbus requests
Sven Eden [Fri, 1 Sep 2017 11:35:48 +0000 (13:35 +0200)]
Prep v235: Allow elogind to be auto-started by dbus requests

6 years agoPrep v235: Fix pam_elogind
Sven Eden [Fri, 1 Sep 2017 11:22:46 +0000 (13:22 +0200)]
Prep v235: Fix pam_elogind

6 years agoPrep v235: systemd installs in /lib/systemd, so we install in /lib/elogind.
Sven Eden [Thu, 31 Aug 2017 15:34:31 +0000 (17:34 +0200)]
Prep v235: systemd installs in /lib/systemd, so we install in /lib/elogind.

6 years agoPrep v235: Catch and react on SIGINT, SIGQUIT and SIGTERM
Sven Eden [Thu, 31 Aug 2017 14:44:51 +0000 (16:44 +0200)]
Prep v235: Catch and react on SIGINT, SIGQUIT and SIGTERM

6 years agoPrep v235: Fix startup order and add debug logging.
Sven Eden [Thu, 31 Aug 2017 05:58:32 +0000 (07:58 +0200)]
Prep v235: Fix startup order and add debug logging.

6 years agoPrep v235: Do not write an early PID file, if elogind is going to be daemonized.
Sven Eden [Wed, 30 Aug 2017 08:59:42 +0000 (10:59 +0200)]
Prep v235: Do not write an early PID file, if elogind is going to be daemonized.

6 years agoPrep v235: Apply pending upstream updates in src/test [4/4]
Sven Eden [Wed, 30 Aug 2017 05:49:50 +0000 (07:49 +0200)]
Prep v235: Apply pending upstream updates in src/test [4/4]

6 years agoPrep v235: Apply pending upstream updates in src/login [3/4]
Sven Eden [Wed, 30 Aug 2017 05:49:50 +0000 (07:49 +0200)]
Prep v235: Apply pending upstream updates in src/login [3/4]

6 years agoPrep v235: Apply pending upstream updates in src/core [2/4]
Sven Eden [Wed, 30 Aug 2017 05:49:50 +0000 (07:49 +0200)]
Prep v235: Apply pending upstream updates in src/core [2/4]

6 years agoPrep v235: Apply pending upstream updates in src/basic [1/4]
Sven Eden [Wed, 30 Aug 2017 05:49:50 +0000 (07:49 +0200)]
Prep v235: Apply pending upstream updates in src/basic [1/4]

6 years agoPrep 235: add missing libshared.sym and remove obsolete kdbus.h
Sven Eden [Wed, 30 Aug 2017 05:48:30 +0000 (07:48 +0200)]
Prep 235: add missing libshared.sym and remove obsolete kdbus.h

6 years agoPrep v235: optimize elogind extra startup functionality
Sven Eden [Wed, 30 Aug 2017 05:47:40 +0000 (07:47 +0200)]
Prep v235: optimize elogind extra startup functionality

6 years agofileio: rename function parameter to avoid masking global symbol
Alan Jenkins [Tue, 29 Aug 2017 09:56:32 +0000 (10:56 +0100)]
fileio: rename function parameter to avoid masking global symbol

> glibc exports a function called sync(), we should probably avoid
> overloading that as a variable here locally (gcc even used to warn about
> that, not sure why it doesn't anymore), to avoid confusion around what
> "if (sync)" actually means

6 years agoshared: Add a linker script so that all functions are tagget @SD_SHARED instead of...
Felipe Sateler [Mon, 28 Aug 2017 16:49:03 +0000 (13:49 -0300)]
shared: Add a linker script so that all functions are tagget @SD_SHARED instead of @Base (#6669)

This helps prevent symbol collisions with other programs and libraries. In particular,
because PAM modules are loaded into the process that is creating the session, and
elogind creates PAM sessions, the potential for collisions is high.

Disambiguate all elogind calls by tagging a 'version' SD_SHARED.

Fixes #6624

6 years agoSupport 'rdma' as a ListenNetlink= argument (#6626)
Jason Gunthorpe [Mon, 28 Aug 2017 15:22:10 +0000 (09:22 -0600)]
Support 'rdma' as a ListenNetlink= argument (#6626)

NETLINK_RDMA has been in the kernel since v3.0.

6 years agologind: make sure we don't process the same method call twice (#6583)
Lennart Poettering [Sat, 26 Aug 2017 13:19:26 +0000 (15:19 +0200)]
logind: make sure we don't process the same method call twice (#6583)

Tiny mistake, big effect.

Fixes: #6375
6 years ago"Don't fear the fsync()"
Alan Jenkins [Thu, 17 Aug 2017 16:09:44 +0000 (17:09 +0100)]
"Don't fear the fsync()"

For files which are vital to boot

1. Avoid opening any window where power loss will zero them out or worse.
   I know app developers all coded to the ext3 implementation, but
   the only formal documentation we have says we're broken if we actually
   rely on it.  E.g.

   * `man mount`, search for `auto_da_alloc`.
   * http://www.linux-mtd.infradead.org/faq/ubifs.html#L_atomic_change
   * https://thunk.org/tytso/blog/2009/03/15/dont-fear-the-fsync/

2. If we tell the kernel we're interested in writing them to disk, it will
   tell us if that fails.  So at minimum, this means we play our part in
   notifying the user about errors.

I refactored error-handling in `udevadm-hwdb` a little.  It turns out I did
exactly the same as had already been done in the `elogind-hwdb` version,
i.e. commit d702dcd.

6 years agocapability: change capability_bounding_set_drop() to be work without privileges when...
Lennart Poettering [Wed, 9 Aug 2017 13:05:36 +0000 (15:05 +0200)]
capability: change capability_bounding_set_drop() to be work without privileges when executing a NOP

This way daemons which already dropped all caps may use the call to
drop priviliges again, which becomes a non-failing NOP.

6 years agomkdir: chmod_and_chown() returns errors as "return -errno", not in errno itself
Lennart Poettering [Wed, 9 Aug 2017 10:46:09 +0000 (12:46 +0200)]
mkdir: chmod_and_chown() returns errors as "return -errno", not in errno itself

6 years agopam_logind: skip leading /dev/ from PAM_TTY field before passing it on
Lennart Poettering [Wed, 9 Aug 2017 17:04:36 +0000 (19:04 +0200)]
pam_logind: skip leading /dev/ from PAM_TTY field before passing it on

Apparently, PAM documents that the PAM_TTY should come with a /dev
prefix, but we don't expect it so far, except that Wayland ends up
setting it after all, the way the docs suggest. Hence, let's simply drop
the /dev prefix if it is there.

Fixes: #6516
6 years agoPrep v235: Set defaults for the sleep config *after* loading the config file.
Sven Eden [Tue, 29 Aug 2017 14:37:03 +0000 (16:37 +0200)]
Prep v235: Set defaults for the sleep config *after* loading the config file.

6 years agoPrep v235: Fix pkgconfig/libelogind.pc
Sven Eden [Tue, 22 Aug 2017 14:55:10 +0000 (16:55 +0200)]
Prep v235: Fix pkgconfig/libelogind.pc

6 years agoPrep v235: Use the new ELOGIND_PID_FILE macro consistently
Sven Eden [Fri, 18 Aug 2017 13:00:44 +0000 (15:00 +0200)]
Prep v235: Use the new ELOGIND_PID_FILE macro consistently

6 years agoPrep v235: Allow elogind to daemonize itself with "-D|--daemon".
Sven Eden [Wed, 16 Aug 2017 08:28:51 +0000 (10:28 +0200)]
Prep v235: Allow elogind to daemonize itself with "-D|--daemon".

6 years agoPrep v235: Cleaned up a stray mask-end-start chain.
Sven Eden [Wed, 16 Aug 2017 08:19:14 +0000 (10:19 +0200)]
Prep v235: Cleaned up a stray mask-end-start chain.

6 years agoPrep v235: Update build system to fit elogind
Sven Eden [Tue, 15 Aug 2017 04:56:29 +0000 (06:56 +0200)]
Prep v235: Update build system to fit elogind

- Update man/rules/meson.build with elogind set of xml files.
- Update documentation generating tools to fit elogind.
- Follow upstream and link against libelogind-shared-<version>.so

6 years agoPrep v235: Add missing includes and dependencies.
Sven Eden [Mon, 14 Aug 2017 08:18:50 +0000 (10:18 +0200)]
Prep v235: Add missing includes and dependencies.

6 years agoPrep v235: Apply upstream fixes (10/10) [src/update-utmp]
Sven Eden [Mon, 14 Aug 2017 07:16:16 +0000 (09:16 +0200)]
Prep v235: Apply upstream fixes (10/10) [src/update-utmp]

6 years agoPrep v235: Apply upstream fixes (9/10) [src/test]
Sven Eden [Mon, 14 Aug 2017 07:16:16 +0000 (09:16 +0200)]
Prep v235: Apply upstream fixes (9/10) [src/test]

6 years agoPrep v235: Apply upstream fixes (8/10) [src/systemd]
Sven Eden [Mon, 14 Aug 2017 07:16:16 +0000 (09:16 +0200)]
Prep v235: Apply upstream fixes (8/10) [src/systemd]

6 years agoPrep v235: Apply upstream fixes (7/10) [src/shared]
Sven Eden [Mon, 14 Aug 2017 07:16:16 +0000 (09:16 +0200)]
Prep v235: Apply upstream fixes (7/10) [src/shared]

6 years agoPrep v235: Apply upstream fixes (6/10) [src/login]
Sven Eden [Mon, 14 Aug 2017 07:16:15 +0000 (09:16 +0200)]
Prep v235: Apply upstream fixes (6/10) [src/login]

6 years agoPrep v235: Apply upstream fixes (5/10) [src/libelogind]
Sven Eden [Mon, 14 Aug 2017 05:49:46 +0000 (07:49 +0200)]
Prep v235: Apply upstream fixes (5/10) [src/libelogind]

6 years agoPrep v235: Apply upstream fixes (4/10) [src/core]
Sven Eden [Mon, 14 Aug 2017 05:49:28 +0000 (07:49 +0200)]
Prep v235: Apply upstream fixes (4/10) [src/core]

6 years agoPrep v235: Apply upstream fixes (3/10) [src/basic]
Sven Eden [Mon, 14 Aug 2017 07:16:15 +0000 (09:16 +0200)]
Prep v235: Apply upstream fixes (3/10) [src/basic]

6 years agoPrep v235: Apply upstream fixes (2/10) [man]
Sven Eden [Mon, 14 Aug 2017 05:49:08 +0000 (07:49 +0200)]
Prep v235: Apply upstream fixes (2/10) [man]

6 years agoPrep v235: Apply upstream fixes (1/10) [root]
Sven Eden [Mon, 14 Aug 2017 06:49:45 +0000 (08:49 +0200)]
Prep v235: Apply upstream fixes (1/10) [root]

6 years agoPrep v235: Remove superfluous .gitignore files
Sven Eden [Mon, 14 Aug 2017 05:37:32 +0000 (07:37 +0200)]
Prep v235: Remove superfluous .gitignore files

6 years agotests: when running a manager object in a test, migrate to private cgroup subroot...
Lennart Poettering [Wed, 9 Aug 2017 13:42:49 +0000 (15:42 +0200)]
tests: when running a manager object in a test, migrate to private cgroup subroot first (#6576)

Without this "meson test" will end up running all tests in the same
cgroup root, and they all will try to manage it. Which usually isn't too
bad, except when they end up clearing up each other's cgroups. This race
is hard to trigger but has caused various CI runs to fail spuriously.

With this change we simply move every test that runs a manager object
into their own private cgroup. Note that we don't clean up the cgroup at
the end, we leave that to the cgroup manager around it.

This fixes races that become visible by test runs throwing out errors
like this:

```
exec-systemcallfilter-failing.service: Passing 0 fds to service
exec-systemcallfilter-failing.service: About to execute: /bin/echo 'This should not be seen'
exec-systemcallfilter-failing.service: Forked /bin/echo as 5693
exec-systemcallfilter-failing.service: Changed dead -> start
exec-systemcallfilter-failing.service: Failed to attach to cgroup /exec-systemcallfilter-failing.service: No such file or directory
Received SIGCHLD from PID 5693 ((echo)).
Child 5693 ((echo)) died (code=exited, status=219/CGROUP)
exec-systemcallfilter-failing.service: Child 5693 belongs to exec-systemcallfilter-failing.service
exec-systemcallfilter-failing.service: Main process exited, code=exited, status=219/CGROUP
exec-systemcallfilter-failing.service: Changed start -> failed
exec-systemcallfilter-failing.service: Unit entered failed state.
exec-systemcallfilter-failing.service: Failed with result 'exit-code'.
exec-systemcallfilter-failing.service: cgroup is empty
Assertion 'service->main_exec_status.status == status_expected' failed at ../src/src/test/test-execute.c:71, function check(). Aborting.
```

BTW, I tracked this race down by using perf:

```
        # perf record -e cgroup:cgroup_mkdir,cgroup_rmdir
        …
        # perf script
```

Thanks a lot @iaguis, @alban for helping me how to use perf for this.

Fixes #5895.

6 years agobuild-sys: fix invalid args detected by meson 0.42 (#6561)
userwithuid [Wed, 9 Aug 2017 13:41:44 +0000 (13:41 +0000)]
build-sys: fix invalid args detected by meson 0.42 (#6561)

some run_target() calls were using params from custom_target()

example message:
WARNING: Passed invalid keyword argument "input". This will become a hard error in the future.

New way to call targets:
ninja man/man
ninja man/html
ninja man/update-man-rules

6 years agosd-login: test - fix failure when run from non-graphical seat
Alan Jenkins [Tue, 8 Aug 2017 15:13:52 +0000 (16:13 +0100)]
sd-login: test - fix failure when run from non-graphical seat

Observed when running from the console of a elogind nspawn container
(see failure below).

The value of r was tested, when r was last set by
sd_session_can_graphical().  This did not correspond to the value expected.

Fix the code, so we compare relevant values now.  Hopefully :).

Test failure
------------

/* Information printed is from the live system */
sd_pid_get_unit(0, …) → "session-13.scope"
sd_pid_get_user_unit(0, …) → "n/a"
sd_pid_get_slice(0, …) → "user-1000.slice"
sd_pid_get_session(0, …) → "13"
sd_pid_get_owner_uid(0, …) → 1000
sd_pid_get_cgroup(0, …) → "/user.slice/user-1000.slice/session-13.scope"
sd_uid_get_display(1000, …) → "13"
sd_uid_get_sessions(1000, …) → [2] "15 13"
sd_uid_get_seats(1000, …) → [1] "seat0"
sd_session_is_active("13") → yes
sd_session_is_remote("13") → no
sd_session_get_state("13") → "active"
sd_session_get_uid("13") → 1000
sd_session_get_type("13") → "tty"
sd_session_get_class("13") → "user"
sd_session_get_display("13") → "n/a"
sd_session_get_remote_user("13") → "n/a"
sd_session_get_remote_host("13") → "n/a"
sd_session_get_seat("13") → "seat0"
sd_session_can_multi_seat("seat0") → no
sd_session_can_tty("seat0") → no
sd_session_can_graphical("seat0") → no
sd_uid_get_state(1000, …) → active
Assertion '!!k == !!r' failed at ../src/libelogind/sd-login/test-login.c:191, function test_login(). Aborting.

6 years agosd-login: test - fix function name in output
Alan Jenkins [Tue, 8 Aug 2017 14:54:15 +0000 (15:54 +0100)]
sd-login: test - fix function name in output

6 years agotreewide: fix typos (#6566)
Torstein Husebø [Tue, 8 Aug 2017 14:05:29 +0000 (16:05 +0200)]
treewide: fix typos (#6566)

6 years agosd-bus: free everything when bus_set_address_user fails (#6552)
Evgeny Vereshchagin [Tue, 8 Aug 2017 06:42:51 +0000 (09:42 +0300)]
sd-bus: free everything when bus_set_address_user fails (#6552)

Fixes:
```
$ env -i valgrind --leak-check=full ./build/test-bus-chat
...
==7763== 1,888 (1,824 direct, 64 indirect) bytes in 1 blocks are
definitely lost in loss record 2 of 2
==7763==    at 0x4C2FA50: calloc (vg_replace_malloc.c:711)
==7763==    by 0x4F8FF9A: sd_bus_new (sd-bus.c:175)
==7763==    by 0x4F938BF: sd_bus_open_user (sd-bus.c:1138)
==7763==    by 0x109ACD: server_init (test-bus-chat.c:70)
==7763==    by 0x10BCF8: main (test-bus-chat.c:526)
==7763==
```

Closes #6481

6 years agoprocess-util: add sched_{policy,priority}_is_valid()
Yu Watanabe [Wed, 2 Aug 2017 04:43:44 +0000 (13:43 +0900)]
process-util: add sched_{policy,priority}_is_valid()

6 years agosecurebits-util: add secure_bits_{from_string,to_string_alloc}()
Yu Watanabe [Mon, 7 Aug 2017 14:40:25 +0000 (23:40 +0900)]
securebits-util: add secure_bits_{from_string,to_string_alloc}()

6 years agocore: propagate reload from RELOADING=1 notification (#6550)
Jouke Witteveen [Mon, 7 Aug 2017 09:27:24 +0000 (11:27 +0200)]
core: propagate reload from RELOADING=1 notification (#6550)

6 years agobus-util: do not print (uint64_t) -1 as is (#6522)
Yu Watanabe [Sun, 6 Aug 2017 00:37:25 +0000 (09:37 +0900)]
bus-util: do not print (uint64_t) -1 as is (#6522)

Closes #4295 and #6511.

6 years agoprocess-util: update the end pointer of the process name on rename (#6492)
Jouke Witteveen [Wed, 2 Aug 2017 15:08:31 +0000 (17:08 +0200)]
process-util: update the end pointer of the process name on rename (#6492)

We only updated the end pointer when allocating new memory, i.e. on the first
call to rename_process.

6 years agomodprobe.d: ship drop-in to set bonding max_bonds to 0 (#6448)
Dimitri John Ledkov [Wed, 2 Aug 2017 12:41:18 +0000 (13:41 +0100)]
modprobe.d: ship drop-in to set bonding max_bonds to 0 (#6448)

This allows networkd to correctly manage bond0 using networkd, when requested
by the user.

Fixes #5971 #6184

6 years agoresolved,nss-myhostname: use _gateway for the gateway
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jul 2017 06:15:08 +0000 (02:15 -0400)]
resolved,nss-myhostname: use _gateway for the gateway

This changes the symbolic name for the default gateway from "gateway" to
"_gateway". A new configuration option -Dcompat-gateway-hostname=true|false
is added. If it is set, the old name is also supported, but the new name
is used as the canonical name in either case. This is intended as a temporary
measure to make the transition easier, and the option should be removed
after a few releases, at which point only the new name will be used.

The old "gateway" name mostly works OK, but hasn't gained widespread acceptance
because of the following (potential) conflicts:
- it is completely legal to have a host called "gateway"
- there is no guarantee that "gateway" will not be registered as a TLD, even
  though this currently seems unlikely. (Even then, there would be no
  conflict except for the case when the top-level domain itself was being resolved.
  The "gateway" or "_gateway" labels have only special meaning when the
  whole name consists of a single label, so resolution of any subdomain
  of the hypothetical gateway. TLD would still work OK. )
Moving to "_gateway" avoids those issues because underscores are not allowed
in host names (RFC 1123, §2.1) and avoids potential conflicts with local or
global names.

v2:
- simplify the logic to hardcode "_gateway" and allow
  -Dcompat-gateway-hostname=true as a temporary measure.

6 years agostring-util: optimize strshorten() a bit
Lennart Poettering [Thu, 20 Jul 2017 12:17:30 +0000 (14:17 +0200)]
string-util: optimize strshorten() a bit

There's no reason to determine the full length of the string, it's
sufficient to know whether it is larger than the intended size...

6 years agoalloc-util: add new helpers memdup_suffix0() and newdup_suffix0()
Lennart Poettering [Thu, 20 Jul 2017 12:14:55 +0000 (14:14 +0200)]
alloc-util: add new helpers memdup_suffix0() and newdup_suffix0()

These are similar to memdup() and newdup(), but reserve one extra NUL
byte at the end of the new allocation and initialize it. It's useful
when copying out data from fixed size character arrays where NUL
termination can't be assumed.

6 years agoprocess-util: slightly optimize querying of our own process metadata
Lennart Poettering [Mon, 17 Jul 2017 21:35:25 +0000 (23:35 +0200)]
process-util: slightly optimize querying of our own process metadata

When we are checking our own data, we can optimize things a bit.

6 years agocore, sd-bus, logind: make use of uid_is_valid() in more places
Lennart Poettering [Fri, 14 Jul 2017 16:57:04 +0000 (18:57 +0200)]
core, sd-bus, logind: make use of uid_is_valid() in more places

6 years agoPrep v235: Updated root files to upstream commit 7a0019d
Sven Eden [Thu, 10 Aug 2017 08:23:44 +0000 (10:23 +0200)]
Prep v235: Updated root files to upstream commit 7a0019d

6 years agobasic: cosmetic changes (#6440)
Yu Watanabe [Mon, 24 Jul 2017 23:32:34 +0000 (08:32 +0900)]
basic: cosmetic changes (#6440)

6 years agomeson: install the git hook (#6425)
Zbigniew Jędrzejewski-Szmek [Mon, 24 Jul 2017 08:41:45 +0000 (04:41 -0400)]
meson: install the git hook (#6425)

This was done autogen.sh previously and was dropped in
72cdb3e783174dcf9223a49f03e3b0e2ca95ddb8. Let's add it back.
The meson configuration step is the only reasonable place.

Note that this only works for the most standard git dirs, e.g.
the hook will not be installed if git worktree is used or if
$GIT_DIR is specified, etc. I think that's OK because most of
the time meson will be run at least once in the original cloned
dir.

6 years agoDrop kdbus bits
Zbigniew Jędrzejewski-Szmek [Sun, 23 Jul 2017 15:45:57 +0000 (11:45 -0400)]
Drop kdbus bits

Some kdbus_flag and memfd related parts are left behind, because they
are entangled with the "legacy" dbus support.

test-bus-benchmark is switched to "manual". It was already broken before
(in the non-kdbus mode) but apparently nobody noticed. Hopefully it can
be fixed later.

6 years agoDrop bus-policy bits
Zbigniew Jędrzejewski-Szmek [Sun, 23 Jul 2017 13:28:45 +0000 (09:28 -0400)]
Drop bus-policy bits

6 years agoDrop busname unit type
Zbigniew Jędrzejewski-Szmek [Sun, 23 Jul 2017 13:24:39 +0000 (09:24 -0400)]
Drop busname unit type

Since busname units are only useful with kdbus, they weren't actively
used. This was dead code, only compile-tested. If busname units are
ever added back, it'll be cleaner to start from scratch (possibly reverting
parts of this patch).

6 years agovirt: enable detecting QEMU (TCG) via CPUID (#6399)
Daniel Berrange [Wed, 19 Jul 2017 09:06:07 +0000 (10:06 +0100)]
virt: enable detecting QEMU (TCG) via CPUID (#6399)

QEMU >= 2.10 will include a CPUID leaf with value "TCGTCGTCGTCG"
on x86 when running with the TCG CPU emulator:

  https://lists.gnu.org/archive/html/qemu-devel/2017-07/msg05231.html

Existing methods of detecting QEMU are left unchanged for sake of
backcompatibility.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
6 years agobasic: use _unlocked() stdio in strip_tab_ansi() (#6385)
Vito Caputo [Mon, 17 Jul 2017 22:05:52 +0000 (15:05 -0700)]
basic: use _unlocked() stdio in strip_tab_ansi() (#6385)

Trivial performance boost by explicitly bypassing the implicit
locking of stdio.

This significantly affects common cases of `journalctl` usage:

 Before:

  # time ./journalctl -b -1 > /dev/null
   real    0m26.628s
   user    0m26.495s
   sys     0m0.125s

  # time ./journalctl -b -1 > /dev/null
   real    0m27.069s
   user    0m26.936s
   sys     0m0.134s

  # time ./journalctl -b -1 > /dev/null
   real    0m26.727s
   user    0m26.607s
   sys     0m0.119s

 After:

  # time ./journalctl -b -1 > /dev/null
   real    0m23.394s
   user    0m23.244s
   sys     0m0.142s

  # time ./journalctl -b -1 > /dev/null
   real    0m23.283s
   user    0m23.160s
   sys     0m0.121s

  # time ./journalctl -b -1 > /dev/null
   real    0m23.274s
   user    0m23.125s
   sys     0m0.144s

Fixes https://github.com/elogind/elogind/issues/6341

6 years agotest-hashmap: use $SYSTEMD_SLOW_TESTS variable
Zbigniew Jędrzejewski-Szmek [Wed, 12 Jul 2017 20:55:00 +0000 (20:55 +0000)]
test-hashmap: use $SYSTEMD_SLOW_TESTS variable

test-hashmap is a very good test, but it gets in the way when one wants to
compile and quickly test changes.

6 years agoPrep v235: Update root files to upstream commit 896bbe7
Sven Eden [Tue, 8 Aug 2017 05:51:05 +0000 (07:51 +0200)]
Prep v235: Update root files to upstream commit 896bbe7

6 years agoGeneral: README updated
Sven Eden [Mon, 31 Jul 2017 06:36:00 +0000 (08:36 +0200)]
General: README updated

- The list of dependencies has been changed
- Added upstream information about the new meson+ninja build system

6 years agoGeneral: Update build system to upstream support of meson+ninja.
Sven Eden [Mon, 31 Jul 2017 06:28:21 +0000 (08:28 +0200)]
General: Update build system to upstream support of meson+ninja.

Upstream thinks, that the auto tools are too 'legacy', or that they
are at least no longer fitting.

We follow, as the classic auto tools files have been removed, so no
other choice here...

6 years agoVersion 234.1 Release
Sven Eden [Thu, 27 Jul 2017 15:52:28 +0000 (17:52 +0200)]
Version 234.1 Release

6 years agoPrep v234: Check against TRANSPORT_LOCAL in check_inhibitors()
Sven Eden [Thu, 27 Jul 2017 15:48:36 +0000 (17:48 +0200)]
Prep v234: Check against TRANSPORT_LOCAL in check_inhibitors()

6 years agoALL: Add --with-rootlibexecdir and change default to ${libdir}/libexec
Sven Eden [Thu, 27 Jul 2017 14:07:50 +0000 (16:07 +0200)]
ALL: Add --with-rootlibexecdir and change default to ${libdir}/libexec

6 years agoPrep v234: Eventually fix the cgroup stuff. elogind is not init.
Sven Eden [Thu, 27 Jul 2017 08:18:44 +0000 (10:18 +0200)]
Prep v234: Eventually fix the cgroup stuff. elogind is not init.

6 years agoPrep 234: Fix Makefile.am to install elogind in rootlibexecdir, like upstream does...
Sven Eden [Thu, 27 Jul 2017 08:17:16 +0000 (10:17 +0200)]
Prep 234: Fix Makefile.am to install elogind in rootlibexecdir, like upstream does with systemd-login.

6 years agoPrep 234: Rename pam-systemd to pam-elogind in pam module init log message.
Sven Eden [Wed, 26 Jul 2017 13:13:56 +0000 (15:13 +0200)]
Prep 234: Rename pam-systemd to pam-elogind in pam module init log message.

6 years agoPrep v234: Re-add user/session to the gc_queue when stopping.
Sven Eden [Wed, 26 Jul 2017 08:26:15 +0000 (10:26 +0200)]
Prep v234: Re-add user/session to the gc_queue when stopping.

If manager_gc() does not find the user/session, their respective
finalize_*() method is never called, leaving stale state files in
/run/systemd/sessions and run/systemd/users.

6 years agoPrep v233.4: Update LTO usage to be more convenient.
Sven Eden [Fri, 21 Jul 2017 11:37:31 +0000 (13:37 +0200)]
Prep v233.4: Update LTO usage to be more convenient.

- Add -fuse-linker-plugin to work around odd compiler and binutils
  installs. Should fix most "plugin needed to handle lto object"
  issues.
- Read back whether LTO really has been enabled or not, so we can
  display a status line at the end of configure.
- Only enforce gold linker if LTO has been enabled.

These checks can still be disabled with the --disable-lto option,
which will make configure to skip all checks regarding LTO.

6 years agoPrep v234: Apply missing upstream fixes in src/test (6/6)
Sven Eden [Tue, 25 Jul 2017 08:20:12 +0000 (10:20 +0200)]
Prep v234: Apply missing upstream fixes in src/test (6/6)

6 years agoPrep v234: Apply missing upstream fixes in src/systemd (5/6)
Sven Eden [Tue, 25 Jul 2017 08:20:01 +0000 (10:20 +0200)]
Prep v234: Apply missing upstream fixes in src/systemd (5/6)

6 years agoPrep v234: Apply missing upstream fixes in src/shared (4/6)
Sven Eden [Tue, 25 Jul 2017 09:41:55 +0000 (11:41 +0200)]
Prep v234: Apply missing upstream fixes in src/shared (4/6)

6 years agoPrep v234: Apply missing upstream fixes in src/login (3/6)
Sven Eden [Tue, 25 Jul 2017 08:19:45 +0000 (10:19 +0200)]
Prep v234: Apply missing upstream fixes in src/login (3/6)

6 years agoPrep v234: Apply missing upstream fixes in src/libelogind (2/6)
Sven Eden [Tue, 25 Jul 2017 09:41:55 +0000 (11:41 +0200)]
Prep v234: Apply missing upstream fixes in src/libelogind (2/6)

6 years agoPrep v234: Apply missing upstream fixes in src/basic (1/6)
Sven Eden [Tue, 25 Jul 2017 08:19:24 +0000 (10:19 +0200)]
Prep v234: Apply missing upstream fixes in src/basic (1/6)

6 years agoPrep v234: Clarify status of $XDG_RUNTIME_DIR
Sven Eden [Tue, 25 Jul 2017 08:18:10 +0000 (10:18 +0200)]
Prep v234: Clarify status of $XDG_RUNTIME_DIR

6 years agoPrep v234: Remove now obsolete text files from src/libelogind/sd-bus
Sven Eden [Tue, 25 Jul 2017 07:49:53 +0000 (09:49 +0200)]
Prep v234: Remove now obsolete text files from src/libelogind/sd-bus

6 years agoPrep v234: Update root build files to upstream.
Sven Eden [Tue, 25 Jul 2017 06:32:29 +0000 (08:32 +0200)]
Prep v234: Update root build files to upstream.

6 years agoRevert "core: link user keyring to session keyring (#6275)" (#6342)
Lennart Poettering [Wed, 12 Jul 2017 14:00:44 +0000 (16:00 +0200)]
Revert "core: link user keyring to session keyring (#6275)" (#6342)

This reverts commit 437a85112e02042b62751395b9e7225628c1b708.

The outcome of this isn't that clear, let's revert this for now, see
discussion on #6286.

6 years agotime-util: make parse_timestamp() return -EINVAL if the input is very old date (...
Yu Watanabe [Tue, 11 Jul 2017 17:12:48 +0000 (02:12 +0900)]
time-util: make parse_timestamp() return -EINVAL if the input is very old date (#6327)

This reverts 7635ab8e74ea4a94e81143c3077570a986df375c and makes parse_timestamp()
return -EINVAL if the input is older than 1970-01-01.

Fixes #6290.

6 years agoAdd comments to log_functions which shouldn't be called from library code (#6326)
Zbigniew Jędrzejewski-Szmek [Tue, 11 Jul 2017 08:40:11 +0000 (04:40 -0400)]
Add comments to log_functions which shouldn't be called from library code (#6326)

6 years agorandom-util: we are fine if ints are 16 bytes actually
Lennart Poettering [Tue, 11 Jul 2017 08:36:53 +0000 (10:36 +0200)]
random-util: we are fine if ints are 16 bytes actually

Not that it matters IRL, but let's make this less surprising to read...

6 years agorandom-util: always cast from smaller to bigger type when comparing
Lennart Poettering [Tue, 11 Jul 2017 08:35:47 +0000 (10:35 +0200)]
random-util: always cast from smaller to bigger type when comparing

When we compare two size values, let's make sure we cast from the
smaller to the bigger type first, if both types differ, rather than the
reverse in order to not run into overflows.

6 years agobasic/strv: use existing qsort_safe() helper
Zbigniew Jędrzejewski-Szmek [Mon, 10 Jul 2017 18:55:14 +0000 (14:55 -0400)]
basic/strv: use existing qsort_safe() helper

strv_sort() predates qsort_safe(), but we can convert it to it to
save a few lines.

6 years agosd_uid_get_state: do not return -ENOENT if state is "offline" (#6302)
Yu, Li-Yu [Sat, 8 Jul 2017 22:59:29 +0000 (17:59 -0500)]
sd_uid_get_state: do not return -ENOENT if state is "offline" (#6302)

6 years agosd-login: fix memleak when output argument is NULL
Zbigniew Jędrzejewski-Szmek [Sat, 8 Jul 2017 22:04:44 +0000 (18:04 -0400)]
sd-login: fix memleak when output argument is NULL