chiark / gitweb /
7 years agoupdate TODO
Lennart Poettering [Fri, 5 Sep 2014 19:49:23 +0000 (21:49 +0200)]
update TODO

7 years agoexit-status: fix URL in comment
Daniel Mack [Fri, 5 Sep 2014 11:48:05 +0000 (13:48 +0200)]
exit-status: fix URL in comment

The LSB sites have moved, so update the URL.

7 years agoexec: move code executed after fork into exec_child()
Daniel Mack [Sat, 23 Aug 2014 14:02:21 +0000 (16:02 +0200)]
exec: move code executed after fork into exec_child()

This factors out one conditional branch that has grown way too big, and
makes the code more readable by using return statements rather than jump

7 years agoexec: factor out most function arguments of exec_spawn() to ExecParameters
Daniel Mack [Sat, 23 Aug 2014 13:28:37 +0000 (15:28 +0200)]
exec: factor out most function arguments of exec_spawn() to ExecParameters

This way, the list of arguments to that function gets more comprehensive,
and we can get around passing lots of NULL and 0 arguments from socket.c,
swap.c and mount.c.

It also allows for splitting up the code in exec_spawn().

While at it, make ExecContext const in execute.c.

7 years agoman: make it more clear that the concepts systemctl(1) manage are introduced in syste...
Lennart Poettering [Thu, 4 Sep 2014 19:41:54 +0000 (21:41 +0200)]
man: make it more clear that the concepts systemctl(1) manage are introduced in systemd(1)

Based on a suggestion of Ken Coar.

7 years agohibernate-resume: let's move all hibernate-resume tools into the same directory
Lennart Poettering [Thu, 4 Sep 2014 19:40:00 +0000 (21:40 +0200)]
hibernate-resume: let's move all hibernate-resume tools into the same directory

They are closely related, so let's move them together, and clean up the
.c file naming while we are at it.

7 years agonetworkd: link - allow loopback links to be manage, but ignore DHCP/IPv4LL
Tom Gundersen [Thu, 4 Sep 2014 18:54:08 +0000 (20:54 +0200)]
networkd: link - allow loopback links to be manage, but ignore DHCP/IPv4LL

7 years agobuild: don't install busname units and target if kdbus support is disabled
Michael Biebl [Wed, 3 Sep 2014 21:34:29 +0000 (23:34 +0200)]
build: don't install busname units and target if kdbus support is disabled

7 years agonetworkd: link - clarify log message when receiving address for unknown link
Tom Gundersen [Thu, 4 Sep 2014 12:16:56 +0000 (14:16 +0200)]
networkd: link - clarify log message when receiving address for unknown link

7 years agonetworkd: link - do not manage loopback links
Tom Gundersen [Thu, 4 Sep 2014 11:40:24 +0000 (13:40 +0200)]
networkd: link - do not manage loopback links


7 years agonetworkd: link - save link flags when the link is added
Tom Gundersen [Thu, 4 Sep 2014 12:10:43 +0000 (14:10 +0200)]
networkd: link - save link flags when the link is added

Don't wait for the link to be fully synchronised.

7 years agonetworkd: move carrier gained/lost handling from link_update_flags() to link_update()
Tom Gundersen [Thu, 4 Sep 2014 12:05:54 +0000 (14:05 +0200)]
networkd: move carrier gained/lost handling from link_update_flags() to link_update()

This allows us also to simplify link_has_carrier() a bit.

7 years agoUpdate TODO
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:12:51 +0000 (22:12 -0400)]
Update TODO

7 years agoman: fix typo
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:07:29 +0000 (22:07 -0400)]
man: fix typo

7 years agosystemd: fix argument ordering in UnsetAndSetEnvironment
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:22:38 +0000 (22:22 -0400)]
systemd: fix argument ordering in UnsetAndSetEnvironment

Fixup for v208-615-g718db96199.

7 years agolocaled: check for partially matching converted keymaps
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:55:54 +0000 (22:55 -0400)]
localed: check for partially matching converted keymaps

If a user specifies multiple X11 keymaps, with a (at least the first
one) nonempty variant, and we don't match the whole combo, use
a converted keymap which includes the variant in preference to
the default, variantless, keymap.

E.g.: We would convert X11 config "layout=fr variant=mac" to "fr-mac",
but "layout=fr,us variant=mac," to "fr", because we don't have a
converted keymap which would match "fr,us", and we don't have a legacy
mapping for "fr,us". This is unexpected, and if we cannot match both,
it is still better to match the primary mapping and use "fr-mac".

7 years agolocaled: introduce helper function to simplify matching
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:55:52 +0000 (22:55 -0400)]
localed: introduce helper function to simplify matching

7 years agolocaled: log locale/keymap changes in detail
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:55:16 +0000 (22:55 -0400)]
localed: log locale/keymap changes in detail

Converting X11 to legacy keymaps and back is a fucking mess. Let's
make it at least possible to request detailed logs of what is being
changed and why (LOG_DEBUG level).

At LOG_INFO level, we would log the requested change of X11 or console
keymap, but not the resulting change after conversion to console or X11.
Make sure that every change of configuration on disk has a matching
line in the logs.

7 years agolocaled: remove free_and_copy
Zbigniew Jędrzejewski-Szmek [Thu, 4 Sep 2014 02:53:23 +0000 (22:53 -0400)]
localed: remove free_and_copy

It was mostly a duplicate of free_and_strdup().

7 years agolocaled: double free in error path and modernization
Zbigniew Jędrzejewski-Szmek [Wed, 3 Sep 2014 14:28:24 +0000 (10:28 -0400)]
localed: double free in error path and modernization

Very unlikely to trigger, but in principle strv_free
could be called twice: once explictly, and once from cleanup.

7 years agobuild-sys: configure option to disable hibernation
Umut Tezduyar Lindskog [Tue, 2 Sep 2014 10:31:49 +0000 (12:31 +0200)]
build-sys: configure option to disable hibernation

7 years agoman: two fixes, reported on irc by 'wget'
Lennart Poettering [Wed, 3 Sep 2014 17:31:22 +0000 (19:31 +0200)]
man: two fixes, reported on irc by 'wget'

7 years agoupdate TODO
Lennart Poettering [Wed, 3 Sep 2014 16:59:17 +0000 (18:59 +0200)]
update TODO

7 years agobase-file-system: always generate error messages locally
Lennart Poettering [Wed, 3 Sep 2014 17:00:21 +0000 (19:00 +0200)]
base-file-system: always generate error messages locally

Functions either should generate error messages for everything they do
themselves, or for nothing and let the caller do it. But they certainly
shouldn't generate errors for some messages but not for others. Since
the function in this case is one that generates messages on its own, it
really should do that for everything, not just for some things, hence.

7 years agoupdate TODO
Lukas Nykryn [Wed, 3 Sep 2014 11:59:59 +0000 (13:59 +0200)]
update TODO

Yum was creating <container>/var/run/ and hence this directory
was created before filesystem package could create the symlink
/var/run -> /run.
This should be now fixed in yum.

7 years agoinitrd-parse-etc.service: ignore return code of daemon-reload
Harald Hoyer [Wed, 3 Sep 2014 11:28:31 +0000 (13:28 +0200)]
initrd-parse-etc.service: ignore return code of daemon-reload

It seems the return code of systemctl daemon-reload can be !=0 in some
circumstances, which causes a failure of the unit and breaks booting in
the initrd.

7 years agobase_filesystem_create: do not try to create "/root" if it exists
Harald Hoyer [Wed, 3 Sep 2014 11:22:40 +0000 (13:22 +0200)]
base_filesystem_create: do not try to create "/root" if it exists

The check, if the directory/file already exists is only executed, if
there is a symlink target specified. In case of "/root", there is none,
so it is unconditionally tried to create the directory.

In case of a readonly filesystem, errno != EEXIST, but errno == EROFS,
so base_filesystem_create() and switch_root does not succeed.

This patch checks for existance not only in the symlink case.

7 years agoman: fix file extension in udev rules example
Zbigniew Jędrzejewski-Szmek [Tue, 2 Sep 2014 23:37:04 +0000 (19:37 -0400)]
man: fix file extension in udev rules example

7 years agoRevert "timesyncd: remove retry_timer logic which is covered by the server timeout"
Kay Sievers [Tue, 2 Sep 2014 13:28:56 +0000 (15:28 +0200)]
Revert "timesyncd: remove retry_timer logic which is covered by the server timeout"

This reverts commit 665c6a9eab46b0b253af6566ca9fc70c866b3fcd.

On Tue, Sep 2, 2014 at 3:17 PM, Miroslav Lichvar <> wrote:
> With the other patch allowing missed replies included it's now getting
> stuck as there is no timer to send the 2nd and 3rd request.

7 years agotimesyncd: don't reset polling interval when reselecting server
Kay Sievers [Tue, 2 Sep 2014 12:33:59 +0000 (14:33 +0200)]
timesyncd: don't reset polling interval when reselecting server

Original patch from: Miroslav Lichvar <>

7 years agotimesyncd: allow two missed replies before reselecting server
Miroslav Lichvar [Tue, 2 Sep 2014 12:29:51 +0000 (14:29 +0200)]
timesyncd: allow two missed replies before reselecting server

After receiving a reply from the server, allow two missed replies before
switching to another server to avoid unnecessary clock hopping when
packets are getting lost in the network.

7 years agotimesyncd: remove retry_timer logic which is covered by the server timeout
Kay Sievers [Tue, 2 Sep 2014 12:27:00 +0000 (14:27 +0200)]
timesyncd: remove retry_timer logic which is covered by the server timeout

7 years agotimesyncd: wait before reconnecting to first server
Miroslav Lichvar [Wed, 27 Aug 2014 14:47:24 +0000 (16:47 +0200)]
timesyncd: wait before reconnecting to first server

When all servers are exhausted, wait for one poll interval before trying
to connect again to the first server in the list. Also, keep increasing
the polling interval to make sure a client not getting any valid replies
will not send requests to any server more frequently than is allowed by
the maximum polling interval.

7 years agosd-rtnl: don't assign to unused variable
Tom Gundersen [Mon, 1 Sep 2014 20:59:52 +0000 (22:59 +0200)]
sd-rtnl: don't assign to unused variable

Reported by Thomas H.P. Andersen <>.

7 years agorules: remove firmware loading rules
Zbigniew Jędrzejewski-Szmek [Mon, 1 Sep 2014 16:55:23 +0000 (12:55 -0400)]
rules: remove firmware loading rules

blueness> poettering, was there a reason for not removing
          50-firmware.rules when you nuked userland firmware

Followup for v216-119-gbe2ea723b1.

7 years agologin: simplify controller handling
David Herrmann [Mon, 1 Sep 2014 12:04:44 +0000 (14:04 +0200)]
login: simplify controller handling

Simplify the way we handler session-controllers and fix several
 * send ReleaseDevice() signals on forced session takeover
 * fix mem-leaks for busnames in case VT preparation fails (non-critical)
 * avoid passing pre-allocated names to helpers

7 years agologin: fix mem leak
Thomas Hindoe Paaboel Andersen [Sun, 31 Aug 2014 21:34:01 +0000 (23:34 +0200)]
login: fix mem leak

7 years agoconfig-parser: fix mem leak
Thomas Hindoe Paaboel Andersen [Sun, 31 Aug 2014 21:13:12 +0000 (23:13 +0200)]
config-parser: fix mem leak

7 years agojournal-remote: fix check if realloc failed
Thomas Hindoe Paaboel Andersen [Sun, 31 Aug 2014 20:54:40 +0000 (22:54 +0200)]
journal-remote: fix check if realloc failed

7 years agotest-network: fix off-by-one error in test
Tom Gundersen [Sun, 31 Aug 2014 17:22:33 +0000 (19:22 +0200)]
test-network: fix off-by-one error in test

7 years agomissing: add IFF_MULTI_QUEUE
Tom Gundersen [Sun, 31 Aug 2014 16:50:23 +0000 (18:50 +0200)]
missing: add IFF_MULTI_QUEUE

This was added in 3.8, but we should building with 3.7 headers.

Reported by Samuli Suominen <>.

7 years agojournalctl: Allow to disable line cap with --lines=all
Jan Janssen [Sun, 31 Aug 2014 09:12:22 +0000 (11:12 +0200)]
journalctl: Allow to disable line cap with --lines=all

7 years agoQuote unit names in suggested systemctl commandlines
Zbigniew Jędrzejewski-Szmek [Sun, 31 Aug 2014 04:42:27 +0000 (00:42 -0400)]
Quote unit names in suggested systemctl commandlines

The fact that unit names have to be quoted can be a bit surprising.
Show quotes in the hint commandline, but only after checking that this
is necessary, since quotes are visually heavy and usually not needed.

7 years agounits: update rescue.service and emergency.service
Zbigniew Jędrzejewski-Szmek [Sun, 31 Aug 2014 02:34:56 +0000 (22:34 -0400)]
units: update rescue.service and emergency.service

^D works in emergency.service too. One needs to log in when in rescue
mode too.

7 years agounits: m4 is not needed for rescue.service
Zbigniew Jędrzejewski-Szmek [Sun, 31 Aug 2014 03:59:37 +0000 (23:59 -0400)]
units: m4 is not needed for rescue.service

7 years agounits: make emergency.service conflict with rescue.service
Zbigniew Jędrzejewski-Szmek [Sun, 31 Aug 2014 02:33:40 +0000 (22:33 -0400)]
units: make emergency.service conflict with rescue.service

They both use StandardInput=tty-force so they cannot be run

7 years agotimesyncd-manager: don't clear current_server_name if ServerAddress is NULL
Steven Noonan [Sat, 30 Aug 2014 12:58:06 +0000 (05:58 -0700)]
timesyncd-manager: don't clear current_server_name if ServerAddress is NULL

[zj: add comment]

7 years agosd-dhcp6-client: properly calculate buffer size when parsing options
Zbigniew Jędrzejewski-Szmek [Sat, 30 Aug 2014 22:31:21 +0000 (18:31 -0400)]
sd-dhcp6-client: properly calculate buffer size when parsing options

Also make pointer calculations more explicit so they are
easier to understand.

7 years agotest-dhcp6-client: Fix option length
Patrik Flykt [Fri, 29 Aug 2014 06:20:46 +0000 (09:20 +0300)]
test-dhcp6-client: Fix option length

The whole DHCPv6 test message length was incorrectly used as the length
of DHCPv6 options causing the following bad memory access:

$ build/test-dhcp6-client
Assertion 'interface_index >= -1' failed at ../src/libsystemd-network/sd-dhcp6-client.c:129, function sd_dhcp6_client_set_index(). Ignoring.
==29135==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7fe204aa9148 at pc 0x7fe204a5958f bp 0x7fff3e47d470 sp 0x7fff3e47d460
READ of size 1 at 0x7fe204aa9148 thread T0
    #0 0x7fe204a5958e in option_parse_hdr ../src/libsystemd-network/dhcp6-option.c:145
    #1 0x7fe204a59884 in dhcp6_option_parse ../src/libsystemd-network/dhcp6-option.c:165
    #2 0x7fe204a4eb9c in test_advertise_option ../src/libsystemd-network/test-dhcp6-client.c:227
    #3 0x7fe204a51c58 in main ../src/libsystemd-network/test-dhcp6-client.c:584
    #4 0x7fe2031590df in __libc_start_main (/lib64/
    #5 0x7fe204a4cc5b (/home/test/systemd/build/test-dhcp6-client+0x25c5b)

0x7fe204aa9148 is located 2 bytes to the right of global variable 'msg_advertise' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9080) of size 198
0x7fe204aa9148 is located 56 bytes to the left of global variable 'msg_reply' from '../src/libsystemd-network/test-dhcp6-client.c' (0x7fe204aa9180) of size 173
SUMMARY: AddressSanitizer: global-buffer-overflow ../src/libsystemd-network/dhcp6-option.c:145 option_parse_hdr

7 years agocgroup-util: shorten cg_path_get_session
Zbigniew Jędrzejewski-Szmek [Fri, 29 Aug 2014 12:48:33 +0000 (07:48 -0500)]
cgroup-util: shorten cg_path_get_session

7 years agosystemd: fix error message
Zbigniew Jędrzejewski-Szmek [Sat, 30 Aug 2014 21:22:42 +0000 (17:22 -0400)]
systemd: fix error message

7 years agotest-compress: also test with incompressible inputs
Zbigniew Jędrzejewski-Szmek [Sat, 30 Aug 2014 18:47:36 +0000 (14:47 -0400)]
test-compress: also test with incompressible inputs

7 years agojournal/compress: use LZ4_compress_continue()
Evangelos Foutras [Sat, 30 Aug 2014 07:13:43 +0000 (10:13 +0300)]
journal/compress: use LZ4_compress_continue()

We can't use LZ4_compress_limitedOutput_continue() because in the
worst-case scenario the compressed output can be slightly bigger than
the input block. This generally affects very few blocks and is no reason
to abort the compression process.

I ran into this when I noticed that Chromium core dumps weren't being
compressed. After switching to LZ4_compress_continue() a ~330MB Chromium
core dump gets compressed to ~17M.

7 years agosd-ipv4ll: name the correct source
Tom Gundersen [Fri, 29 Aug 2014 11:08:16 +0000 (13:08 +0200)]
sd-ipv4ll: name the correct source

7 years agoFix a few more typos
Ruben Kerkhof [Sat, 30 Aug 2014 15:13:16 +0000 (17:13 +0200)]
Fix a few more typos

7 years agoUpdate french translation
Sylvain Plantefève [Sat, 30 Aug 2014 14:25:59 +0000 (16:25 +0200)]
Update french translation

7 years agolibudev: fix symbol version for udev_queue_flush() and udev_queue_get_fd()
Michael Biebl [Sat, 30 Aug 2014 00:01:51 +0000 (02:01 +0200)]
libudev: fix symbol version for udev_queue_flush() and udev_queue_get_fd()

Those symbols were introduced in commit
14cb733684d3c3f50d088a3a370ddf8e8894dfa4 and released in v215.

7 years agoudev: bump event timeout to 60 seconds
Kay Sievers [Sat, 30 Aug 2014 09:36:32 +0000 (11:36 +0200)]
udev: bump event timeout to 60 seconds

7 years agoudev: remove userspace firmware loading support
Kay Sievers [Sat, 30 Aug 2014 09:34:20 +0000 (11:34 +0200)]
udev: remove userspace firmware loading support

7 years agocompletion: filter templates from restartable units
Dave Reisner [Sat, 30 Aug 2014 00:35:15 +0000 (20:35 -0400)]
completion: filter templates from restartable units

Since c6a373a2634854, we might encounter unit templates via the
'list-units' verb. These aren't restartable (and we throw errors), so
make sure they're filtered out of the completion options.

fixes downstream bug:

7 years agoUpdate Russian translation
Sergey Ptashnick [Fri, 29 Aug 2014 15:48:47 +0000 (19:48 +0400)]
Update Russian translation

By analogy with commit 1977376274.

7 years agotimesyncd: check root distance
Miroslav Lichvar [Wed, 27 Aug 2014 14:47:20 +0000 (16:47 +0200)]
timesyncd: check root distance

NTPv4 servers don't reply with unsynchronized status when they lost
synchronization, they only keep increasing the root dispersion and it's
up to the client to decide at which point they no longer consider it

Ignore replies with root distance over 5 seconds.

7 years agotimesyncd: get kernel timestamp in nanoseconds
Miroslav Lichvar [Wed, 27 Aug 2014 14:47:19 +0000 (16:47 +0200)]
timesyncd: get kernel timestamp in nanoseconds

7 years agotimesyncd: fix calculation of transmit time
Miroslav Lichvar [Wed, 27 Aug 2014 14:47:18 +0000 (16:47 +0200)]
timesyncd: fix calculation of transmit time

The kernel timestamp (recv_time) is made earlier than current time
(now_ts), use the timestamp captured before sending packet directly.

7 years agotimesyncd: check if stratum is valid
Miroslav Lichvar [Wed, 27 Aug 2014 14:47:17 +0000 (16:47 +0200)]
timesyncd: check if stratum is valid

7 years agoFix a few typos in log messages
Ruben Kerkhof [Fri, 29 Aug 2014 11:28:04 +0000 (13:28 +0200)]
Fix a few typos in log messages

7 years agosystemd-journal-upload: fix invalid After=
Marius Tessmann [Thu, 28 Aug 2014 20:01:46 +0000 (22:01 +0200)]
systemd-journal-upload: fix invalid After=

After= belongs into [Unit], not [Install]. Found with systemd-analyze

7 years agosystemd-firstboot: fix typo in man page
Marius Tessmann [Thu, 28 Aug 2014 20:01:45 +0000 (22:01 +0200)]
systemd-firstboot: fix typo in man page

7 years agosystemd-firstboot.service: fix man page section
Marius Tessmann [Thu, 28 Aug 2014 20:01:44 +0000 (22:01 +0200)]
systemd-firstboot.service: fix man page section

Found with systemd-analyze verify.

7 years agosd-event: simplify sd_event_source_set_name()
David Herrmann [Thu, 28 Aug 2014 20:44:28 +0000 (22:44 +0200)]
sd-event: simplify sd_event_source_set_name()

free_and_strdup() does exactly the same as sd_event_source_set_name(), use

7 years agosd-event: name event sources used in libraries
Tom Gundersen [Thu, 28 Aug 2014 13:46:29 +0000 (15:46 +0200)]
sd-event: name event sources used in libraries

This should help in debugging failing event sources.

7 years agosd-event: use event source name rather than address in debug messages
Tom Gundersen [Thu, 28 Aug 2014 13:48:07 +0000 (15:48 +0200)]
sd-event: use event source name rather than address in debug messages

7 years agosd-event: allow naming event sources
Tom Gundersen [Thu, 28 Aug 2014 13:47:39 +0000 (15:47 +0200)]
sd-event: allow naming event sources

7 years agosd-rtnl: log if kernel buffer is overrun as we currently can't handle that case
Tom Gundersen [Thu, 28 Aug 2014 13:59:13 +0000 (15:59 +0200)]
sd-rtnl: log if kernel buffer is overrun as we currently can't handle that case

7 years agohibernate-resume: refuse to run outside of an initrd
Lennart Poettering [Thu, 28 Aug 2014 18:24:12 +0000 (20:24 +0200)]
hibernate-resume: refuse to run outside of an initrd

7 years agoupdate TODO
Lennart Poettering [Thu, 28 Aug 2014 18:23:52 +0000 (20:23 +0200)]
update TODO

7 years agonetworkctl: do not mix dns and ntp servers
Zbigniew Jędrzejewski-Szmek [Mon, 18 Aug 2014 21:22:26 +0000 (17:22 -0400)]
networkctl: do not mix dns and ntp servers

7 years agobus: don't skip interfaces in bus_message_map_properties_changed()
David Herrmann [Thu, 28 Aug 2014 13:24:00 +0000 (15:24 +0200)]
bus: don't skip interfaces in bus_message_map_properties_changed()

Skipping interfaces randomly without the caller specifying it is nasty.
Avoid this and let the caller do that themselves.

7 years agolocale: fix sending PropertiesChanged for x11 keymap changed
David Herrmann [Thu, 28 Aug 2014 13:22:26 +0000 (15:22 +0200)]
locale: fix sending PropertiesChanged for x11 keymap changed

The sd_bus_emit_properties_changed() call for x11 keymap changes lacks
commas.. whoops. Fix it! Now localed emits PropertiesChanged signals

7 years agouse the switch_root function in shutdown
Harald Hoyer [Thu, 21 Aug 2014 14:21:26 +0000 (16:21 +0200)]
use the switch_root function in shutdown

removes code duplication

also move switch-root to shared

7 years agomacro: use unique variable names for math-macros
David Herrmann [Thu, 28 Aug 2014 12:45:38 +0000 (14:45 +0200)]
macro: use unique variable names for math-macros

Similar to container_of(), we now use unique variable names for the bascic
math macros MAX, MIN, CLAMP, LESS_BY. Furthermore, unit tests are added to
verify they work as expected.

For a rationale, see:
    commit fb835651aff79a1e7fc5795086c9b26e59a8e6ca
    Author: David Herrmann <>
    Date:   Fri Aug 22 14:41:37 2014 +0200

        shared: make container_of() use unique variable names

7 years agobus: fix use-after-free in slot-release
David Herrmann [Thu, 28 Aug 2014 10:42:03 +0000 (12:42 +0200)]
bus: fix use-after-free in slot-release

We must not access slot->floating after we possible dropped the last
reference to it. Fix all callback-invocations to first check
slot->floating and possible disconnect the slot, then release the last

7 years agoterminal: free sysview-device names on destruction
David Herrmann [Thu, 28 Aug 2014 10:25:58 +0000 (12:25 +0200)]
terminal: free sysview-device names on destruction

Don't leak the device-names during device destruction in sysview. Somehow,
the device-name is "const char*", so make it "char*" first to avoid
warnings when calling free() on it.

7 years agoterminal: free xkb state on keyboard destruction
David Herrmann [Thu, 28 Aug 2014 10:21:33 +0000 (12:21 +0200)]
terminal: free xkb state on keyboard destruction

Fix leaking the xkb-state during keyboard destruction, leaking lots of xkb
references into the wild.

7 years agonspawn: fix --network-interface
Tom Gundersen [Thu, 28 Aug 2014 10:15:51 +0000 (12:15 +0200)]
nspawn: fix --network-interface

Use SETLINK when modifying an existing link.

7 years agoterminal: sysview: don't return uninitialized error codes
David Herrmann [Thu, 28 Aug 2014 09:01:31 +0000 (11:01 +0200)]
terminal: sysview: don't return uninitialized error codes

In case 'scan_evdev' and 'scan_drm' are both false, we never set 'r' to
anyhting, thus return an uninitialized error code. Fix this by always
returning 0 as we catch negative codes earlier, anyway. Thanks to Thomas
H.P. Anderson for the report.

7 years agosd-journal: verify that object start with the field name
Zbigniew Jędrzejewski-Szmek [Wed, 27 Aug 2014 03:54:31 +0000 (23:54 -0400)]
sd-journal: verify that object start with the field name

If the journal is corrupted, we might return an object that does
not start with the expected field name and/or is shorter than it

7 years agosd-journal: properly convert object->size on big endian
Zbigniew Jędrzejewski-Szmek [Sun, 24 Aug 2014 02:35:03 +0000 (22:35 -0400)]
sd-journal: properly convert object->size on big endian

mmap code crashes when attempting to map an object of zero size.

7 years agoterminal: remove unused variable
Thomas Hindoe Paaboel Andersen [Wed, 27 Aug 2014 21:23:10 +0000 (23:23 +0200)]
terminal: remove unused variable

7 years agoupdate TODO
Lennart Poettering [Wed, 27 Aug 2014 19:43:33 +0000 (21:43 +0200)]
update TODO

7 years agoutil: fix minimal race where we might miss SIGTERMs when forking off an agent
Lennart Poettering [Wed, 27 Aug 2014 19:42:20 +0000 (21:42 +0200)]
util: fix minimal race where we might miss SIGTERMs when forking off an agent

Before forking, block all signals, and unblock them afterwards. This way
the child will have them blocked, and we won't lose them.

7 years agoman: add sample glib/sd-event integration
Tom Gundersen [Wed, 27 Aug 2014 17:04:29 +0000 (19:04 +0200)]
man: add sample glib/sd-event integration

This should be moved to man pages, but for now the C code is included directly.

Suggested by Zbyszek.

7 years agoterminal: add systemd-evcat input debugging tool
David Herrmann [Wed, 27 Aug 2014 16:38:01 +0000 (18:38 +0200)]
terminal: add systemd-evcat input debugging tool

Like systemd-subterm, this new systemd-evcat tool should only be used to
debug libsystemd-terminal. systemd-evcat attaches to the running session
and pushes all evdev devices attached to the current session into an
idev-session. All events of the created idev-devices are then printed to
stdout for input-event debugging.

7 years agoterminal: add xkb-based keyboard devices to idev
David Herrmann [Wed, 27 Aug 2014 16:34:55 +0000 (18:34 +0200)]
terminal: add xkb-based keyboard devices to idev

The idev-keyboard object provides keyboard devices to the idev interface.
It uses libxkbcommon to provide proper keymap support.

So far, the keyboard implementation is pretty straightforward with one
keyboard device per matching evdev element. We feed everything into the
system keymap and provide proper high-level keyboard events to the
application. Compose-features and IM need to be added later.

7 years agoterminal: add evdev elements to idev
David Herrmann [Wed, 27 Aug 2014 16:31:34 +0000 (18:31 +0200)]
terminal: add evdev elements to idev

The evdev-element provides linux evdev interfaces as idev-elements. This
way, all real input hardware devices on linux can be used with the idev

We use libevdev to interface with the kernel. It's a simple wrapper
library around the kernel evdev API that takes care to resync devices
after kernel-queue overflows, which is a rather non-trivial task.
Furthermore, it's a well tested interface used by all other major input
users (Xorg, weston, libinput, ...).
Last but not least, it provides nice keycode to keyname lookup tables (and
vice versa), which is really nice for debugging input problems.

7 years agoterminal: add input interface
David Herrmann [Wed, 27 Aug 2014 16:17:27 +0000 (18:17 +0200)]
terminal: add input interface

The idev-interface provides input drivers for all libsystemd-terminal
based applications. It is split into 4 main objects:
    idev_context: The context object tracks global state of the input
                  interface. This will include data like system-keymaps,
                  xkb contexts and more.
    idev_session: A session serves as controller for a set of devices.
                  Each session on an idev-context is independent of each
                  other. The session is also the main notification object.
                  All events raised via idev are reported through the
                  session interface. Apart of that, the session is a
                  pretty dumb object that just contains devices.
    idev_element: Elements provide real hardware in the idev stack. For
                  each hardware device, one element is added. Elements
                  have no knowledge of higher-level device types, they
                  only provide raw input data to the upper levels. For
                  example, each evdev device is represented by a different
                  element in an idev session.
     idev_device: Devices are objects that the application deals with. An
                  application is usually not interested in elements (and
                  those are hidden to applications), instead, they want
                  high-level input devices like keyboard, touchpads, mice
                  and more. Device are the high-level interface provided
                  by idev. Each device might be fed by a set of elements.
                  Elements drive the device. If elements are removed,
                  devices are destroyed. If elements are added, suitable
                  devices are created.

Applications should monitor the system for sessions and hardware devices.
For each session they want to operate on, they create an idev_session
object and add hardware to that object. The idev interface requires the
application to monitor the system (preferably via sysview_*, but not
required) for hardware devices. Whenever hardware is added to the idev
session, new devices *might* be created. The relationship between hardware
and high-level idev-devices is hidden in the idev-session and not exposed.

Internally, the idev elements and devices are virtual objects. Each real
hardware and device type inherits those virtual objects and provides real
elements and devices. Those types will be added in follow-up commits.

Data flow from hardware to the application is done via idev_*_feed()
functions. Data flow from applications to hardware is done via
idev_*_feedback() functions. Feedback is usually used for LEDs, FF and
similar operations.

7 years agoterminal: add system view interface
David Herrmann [Tue, 26 Aug 2014 13:03:41 +0000 (15:03 +0200)]
terminal: add system view interface

We're going to need multiple binaries that provide session-services via
logind device management. To avoid re-writing the seat/session/device
scan/monitor interface for each of them, this commit adds a generic helper
to libsystemd-terminal:

The sysview interface scans and tracks seats, sessions and devices on a
system. It basically mirrors the state of logind on the application side.
Now, each session-service can listen for matching sessions and
attach to them. On each session, managed device access is provided. This
way, it is pretty simple to write session-services that attach to multiple
sessions (even split across seats).

7 years agobus: split bus_map_all_properties into multiple helpers
David Herrmann [Sun, 24 Aug 2014 16:55:58 +0000 (18:55 +0200)]
bus: split bus_map_all_properties into multiple helpers

The bus_map_all_properties() helper calls
org.freedesktop.DBus.Properties.GetAll() on a given target and parses the
result according to a given property-table. This simplifies dealing with
DBus.Properties significantly. However, the function is blocking and thus
not really useful in many situations.

This patch extracts the core of this function and adds two new helpers
which directly take dbus-messages as arguments. This way, you can issue
asynchronous requests and parse the result via these helpers:

      This is the same as bus_map_all_properties() but takes the result
      message from a GetAll() request as argument. You can thus issue an
      asynchronous GetAll() request and then use this helper once you got
      the result.

      This function takes a signal-message that was retrieved via a
      PropertiesChanged signal and then parses it like if you retrieved
      it via GetAll(). Furthermore, this function returns the number of
      matched properties that got invalidated by the PropertiesChanged
      signal, but didn't carry the new value. This way, the caller can
      issue a new GetAll() request and then parse the result.

The old function bus_map_all_properties() is functionally unchanged, but
now uses bus_message_map_all_properties() internally.

7 years agoutil: make lookup_uid() global
David Herrmann [Wed, 27 Aug 2014 16:03:29 +0000 (18:03 +0200)]
util: make lookup_uid() global

This is a useful helper, make it global. It will be required for
libsystemd-terminal, at minimum.

7 years agoudev: add missing new-line in udevadm error
David Herrmann [Wed, 27 Aug 2014 16:02:17 +0000 (18:02 +0200)]
udev: add missing new-line in udevadm error

fprintf() does not add new-lines automatically like log_*() does. Add the
missing \n specified so "udevadm" invoked without arguments adds a newline
    udevadm: missing or unknown command