chiark / gitweb /
7 years agobus: use EUID over UID and fix unix-creds
David Herrmann [Sun, 18 Jan 2015 12:55:55 +0000 (13:55 +0100)]
bus: use EUID over UID and fix unix-creds

Whenever a process performs an action on an object, the kernel uses the
EUID of the process to do permission checks and to apply on any newly
created objects. The UID of a process is only used if someone *ELSE* acts
on the process. That is, the UID of a process defines who owns the
process, the EUID defines what privileges are used by this process when
performing an action.

Process limits, on the other hand, are always applied to the real UID, not
the effective UID. This is, because a process has a user object linked,
which always corresponds to its UID. A process never has a user object
linked for its EUID. Thus, accounting (and limits) is always done on the
real UID.

This commit fixes all sd-bus users to use the EUID when performing
privilege checks and alike. Furthermore, it fixes unix-creds to be parsed
as EUID, not UID (as the kernel always takes the EUID on UDS). Anyone
using UID (eg., to do user-accounting) has to fall back to the EUID as UDS
does not transmit the UID.

7 years agobus-proxy: fake all UIDs/GIDs, not just the real UID/GID
David Herrmann [Sun, 18 Jan 2015 12:54:46 +0000 (13:54 +0100)]
bus-proxy: fake all UIDs/GIDs, not just the real UID/GID

Make sure we tell the kernel to fake all UIDs/GIDs. Otherwise, the remote
side has no chance of querying our effective UID (which is usually what
they're interested in).

7 years agobus-proxy: fix bus-uid tracking
David Herrmann [Sun, 18 Jan 2015 12:07:21 +0000 (13:07 +0100)]
bus-proxy: fix bus-uid tracking

We need to implicitly allow HELLO from users with the same uid as the bus.
Fix the bus-uid tracking to use the original uid, not the uid after

7 years agologind: hide 'self' links if not available
David Herrmann [Sun, 18 Jan 2015 11:59:39 +0000 (12:59 +0100)]
logind: hide 'self' links if not available

If the caller does not run in a session/seat or has no tracked user, hide
the /org/freedesktop/login1/.../self links in introspection data.
Otherwise, "busctl tree org.freedesktop.login1" tries to query those nodes
even though it cant.

7 years agobus-proxy: don't print error-messages if we check multiple dests
David Herrmann [Sat, 17 Jan 2015 20:18:52 +0000 (21:18 +0100)]
bus-proxy: don't print error-messages if we check multiple dests

If we test the policy against multiple destination names, we really should
not print warnings if one of the names results in DENY. Instead, pass the
whole array of names to the policy and let it deal with it.

7 years agobus-proxy: implement org.freedesktop.DBus.ReloadConfig()
David Herrmann [Sat, 17 Jan 2015 18:06:34 +0000 (19:06 +0100)]
bus-proxy: implement org.freedesktop.DBus.ReloadConfig()

Make sure to reload our xml policy configuration if requested via the bus.

7 years agobus-proxy: fix indentation
David Herrmann [Sat, 17 Jan 2015 17:54:09 +0000 (18:54 +0100)]
bus-proxy: fix indentation

Fix whitespace indentation.

7 years agobus-proxy: drop privileges if run as root
David Herrmann [Sat, 17 Jan 2015 17:23:33 +0000 (18:23 +0100)]
bus-proxy: drop privileges if run as root

We cannot use "User=" in unit-files if we want to retain privileges. So
make bus-proxy.c explicitly drop privileges. However, only do that if
we're root, as there is no need to drop it on the user-bus.

7 years agobus-proxy: share policy between threads
David Herrmann [Sat, 17 Jan 2015 17:07:58 +0000 (18:07 +0100)]
bus-proxy: share policy between threads

This implements a shared policy cache with read-write locks. We no longer
parse the XML policy in each thread.

This will allow us to easily implement ReloadConfig().

7 years agobuild: move stdio-bridge into $PATH
David Herrmann [Sat, 17 Jan 2015 17:01:01 +0000 (18:01 +0100)]
build: move stdio-bridge into $PATH

Make sure stdio-bridge can be found in $PATH. Otherwise, "xyzctl -H"

7 years agohwdb: restore comments about MSI devices
Maxim Mikityanskiy [Sat, 17 Jan 2015 16:27:12 +0000 (11:27 -0500)]
hwdb: restore comments about MSI devices

Some time ago 95-keymap.rules was replaced by
60-keyboard.hwdb. Original comments for MSI laptops (that were in
95-keymap.rules) were removed, but I think they are important for
understanding what's going on.

7 years agobus-proxy: set custom thread names
David Herrmann [Sat, 17 Jan 2015 13:32:58 +0000 (14:32 +0100)]
bus-proxy: set custom thread names

Set thread-names to "p$PIDu$UID" and suffix with '*' if truncated. This
helps debugging bus-proxy issues if we want to figure out which
connections are currently open.

7 years agobus-proxy: turn into multi-threaded daemon
David Herrmann [Sat, 17 Jan 2015 12:57:46 +0000 (13:57 +0100)]
bus-proxy: turn into multi-threaded daemon

Instead of using Accept=true and running one proxy for each connection, we
now run one proxy-daemon with a thread per connection. This will enable us
to share resources like policies in the future.

7 years agomissing: add macros for OFD locks
Michael Marineau [Thu, 15 Jan 2015 21:25:00 +0000 (13:25 -0800)]
missing: add macros for OFD locks

7 years agoremove unneeded libgen.h includes
Cristian Rodríguez [Wed, 14 Jan 2015 13:39:53 +0000 (10:39 -0300)]
remove unneeded libgen.h includes

7 years agoGrammar changes to catalog
Chris Atkinson [Tue, 13 Jan 2015 15:06:25 +0000 (10:06 -0500)]
Grammar changes to catalog

7 years agorandom-seed: avoid errors when we cannot write random-seed file
Colin Guthrie [Mon, 12 Jan 2015 20:40:14 +0000 (20:40 +0000)]
random-seed: avoid errors when we cannot write random-seed file

When we call 'systemd-random-seed load' with a read-only /var/lib/systemd,
the cleanup code (which rewrites the random-seed file) will fail and exit.

Arguably, if the filesystem is read-only and the random-seed file exists
then this will be possibly be quite bad for entroy on subsequent reboots
but it should still not make the unit fail.

7 years agobus-proxy: bring back systemd-stdio-bridge
David Herrmann [Fri, 16 Jan 2015 13:45:34 +0000 (14:45 +0100)]
bus-proxy: bring back systemd-stdio-bridge

Now that we want to make bus-proxy multi-threaded, we have to bring back
the systemd-stdio-bridge for our TCP use-cases.

7 years agobus-proxy: extract proxy into Proxy object
David Herrmann [Fri, 16 Jan 2015 13:19:19 +0000 (14:19 +0100)]
bus-proxy: extract proxy into Proxy object

Move all the proxy code into a "struct Proxy" object that can be used
from multiple binaries.

We now dropped SMACK as we have to refactor it to work properly. We can
introduce it later on.

7 years agobus-proxy: refactor bus-creation
David Herrmann [Thu, 15 Jan 2015 16:33:28 +0000 (17:33 +0100)]
bus-proxy: refactor bus-creation

Move local and destination bus creation into a helper function. This
further reduces the line count of main().

7 years agoupdate TODO
Lennart Poettering [Fri, 16 Jan 2015 19:09:23 +0000 (20:09 +0100)]
update TODO

7 years agoimport: support importing qcow2 images
Lennart Poettering [Fri, 16 Jan 2015 19:07:25 +0000 (20:07 +0100)]
import: support importing qcow2 images

With this change the import tool will now unpack qcow2 images into
normal raw disk images, suitable for usage with nspawn.

This allows has the benefit of also allowing importing Ubuntu Cloud
images for usage with nspawn.

7 years agoimport: support downloading .xz compressed images
Lennart Poettering [Fri, 16 Jan 2015 17:42:17 +0000 (18:42 +0100)]
import: support downloading .xz compressed images

That way we can download fedora cloud raw images as-is and decompress
them on-the-fly.

7 years agobuild-sys: add libsystemd-fw where needed
Kay Sievers [Fri, 16 Jan 2015 14:35:42 +0000 (15:35 +0100)]
build-sys: add libsystemd-fw where needed

7 years agobuild-sys: add missing HAVE_LIBIPTC
Kay Sievers [Fri, 16 Jan 2015 14:16:05 +0000 (15:16 +0100)]
build-sys: add missing HAVE_LIBIPTC

7 years agohwbd: add click angle for the Logitech M325
Peter Hutterer [Fri, 16 Jan 2015 01:11:10 +0000 (11:11 +1000)]
hwbd: add click angle for the Logitech M325

This device has 18 stops per rotation == 20 degree angle. Advertised as
"Micro-precise scrolling"

7 years agoos-release: Add PRIVACY_POLICY_URL
Bastien Nocera [Tue, 13 Jan 2015 16:20:24 +0000 (17:20 +0100)]
os-release: Add PRIVACY_POLICY_URL

7 years agoLLDP: Support locally assigned port subtype
Susant Sahani [Thu, 15 Jan 2015 07:11:28 +0000 (12:41 +0530)]
LLDP: Support locally assigned port subtype

The Zyxel switch sends port subtype as Locally assigned (7).

reported by Mantas Mikulėnas <>

7 years agoTODO: update
David Herrmann [Thu, 15 Jan 2015 13:09:36 +0000 (14:09 +0100)]
TODO: update

7 years agoudev: merge evdev_id into input_id
David Herrmann [Thu, 15 Jan 2015 11:40:38 +0000 (12:40 +0100)]
udev: merge evdev_id into input_id

There is no reason to keep both separated. We want to avoid API specific
tools and instead keep generic terms like 'input'.

7 years agoudev: fix NULL-ptr deref
David Herrmann [Thu, 15 Jan 2015 11:38:57 +0000 (12:38 +0100)]
udev: fix NULL-ptr deref

Make sure we properly validate the return value of
udev_device_get_sysattr_value(). It might be NULL for several reasons.

7 years agobus-proxyd: move synthesize_name_acquired()
Daniel Mack [Thu, 15 Jan 2015 13:10:28 +0000 (14:10 +0100)]
bus-proxyd: move synthesize_name_acquired()

Move synthesize_name_acquired() to synthesize.c.

7 years agobus-proxy: factor out code for driver handling and message synthesis
Daniel Mack [Thu, 15 Jan 2015 12:56:44 +0000 (13:56 +0100)]
bus-proxy: factor out code for driver handling and message synthesis

Move synthesize_*() into synthesize.c and bus_proxy_process_driver() into
driver.c for better code separation.

7 years agonspawn: fix log typos
Jonathan Boulle [Thu, 15 Jan 2015 07:19:30 +0000 (08:19 +0100)]
nspawn: fix log typos

7 years agohwdb: add MOUSE_WHEEL_CLICK_ANGLE as property
Peter Hutterer [Thu, 8 Jan 2015 23:51:40 +0000 (09:51 +1000)]
hwdb: add MOUSE_WHEEL_CLICK_ANGLE as property

Most mice have a wheel click angle of 15 degrees, i.e. 24 clicks per full
wheel rotation. Some mice, like the Logitech M325 have a larger angle. To
allow userspace to make use of that knowledge, add a property to the hwdb.

This allows for better predictive scrolling. e.g. a mouse that has a smaller
click angle will scroll faster, with this value you can accommodate this
where needed. Likewise, using "half turn of the wheel" or "full turn of the
wheel" as a UI element becomes possible.

This addition is mainly driven by libinput 0.8, having the angle enables
libinput to provide an API that distinguishes between a physical distance
(like touchpad scrolling does) and discrete steps (wheel clicks).
Callers can choose what they prefer based on the device.

7 years agoupdate TODO
Lennart Poettering [Thu, 15 Jan 2015 00:44:03 +0000 (01:44 +0100)]
update TODO

7 years agonspawn,machined: change default container image location from /var/lib/container...
Lennart Poettering [Thu, 15 Jan 2015 00:40:02 +0000 (01:40 +0100)]
nspawn,machined: change default container image location from /var/lib/container to /var/lib/machines

Given that this is also the place to store raw disk images which are
very much bootable with qemu/kvm it sounds like a misnomer to call the
directory "container". Hence, let's change this sooner rather than
later, and use the generic name, in particular since we otherwise try to
use the generic "machine" preferably over the more specific "container"
or "vm".

7 years agoimport: rename "gpt" disk image type to "raw"
Lennart Poettering [Thu, 15 Jan 2015 00:03:33 +0000 (01:03 +0100)]
import: rename "gpt" disk image type to "raw"

After all, nspawn can now dissect MBR partition levels, too, hence
".gpt" appears a misnomer. Moreover, the the .raw suffix for these files
is already pretty popular (the Fedora disk images use it for example),
hence sounds like an OK scheme to adopt.

7 years agofix zsh completion typo
Moez Bouhlel [Wed, 14 Jan 2015 14:33:32 +0000 (14:33 +0000)]
fix zsh completion typo

json-see => json-sse

7 years agotest-path: do not skip tests if we are not root
Ronny Chevalier [Wed, 14 Jan 2015 23:07:15 +0000 (00:07 +0100)]
test-path: do not skip tests if we are not root

We can properly run the tests without being root

7 years agotest-exec: do not skip all the tests
Ronny Chevalier [Wed, 14 Jan 2015 23:07:11 +0000 (00:07 +0100)]
test-exec: do not skip all the tests

Only 5 tests cannot be executed if we are not root, so just skip them
but not the whole set.

7 years agospawn: downgrade loopback detach errors to debug
Lennart Poettering [Wed, 14 Jan 2015 23:51:54 +0000 (00:51 +0100)]
spawn: downgrade loopback detach errors to debug

Sometimes udev or some other background daemon might keep the loopback
devices busy while we already want to detach them. Downgrade the warning
about it.

Given that we use autodetach downgrading these messages should be with
little risk.

7 years agonspawn: add support for limited dissecting of MBR disk images with nspawn
Lennart Poettering [Wed, 14 Jan 2015 23:47:10 +0000 (00:47 +0100)]
nspawn: add support for limited dissecting of MBR disk images with nspawn

With this change nspawn's -i switch now can now make sense of MBR disk
images too - however only if there's only a single, bootable partition
of type 0x83 on the image. For all other cases we cannot really make
sense from the partition table alone.

The big benefit of this change is that upstream Fedora Cloud Images can
now be booted unmodified with systemd-nspawn:

 # wget
 # unxz Fedora-Cloud-Base-20141203-21.x86_64.raw.xz
 # systemd-nspawn -i Fedora-Cloud-Base-20141203-21.x86_64.raw -b

Next stop: teach the import logic to automatically download these
images, uncompress and verify them.

7 years agonspawn: pass the container's init PID out via sd_notify()
Lennart Poettering [Wed, 14 Jan 2015 22:29:01 +0000 (23:29 +0100)]
nspawn: pass the container's init PID out via sd_notify()

This is useful for nspawn managers that want to learn when nspawn is
finished with initialiuzation, as well what the PID of the init system
in the container is.

7 years agoupdate TODO
Lennart Poettering [Wed, 14 Jan 2015 22:18:24 +0000 (23:18 +0100)]
update TODO

7 years agonspawn: fix an incorrect assert comparison
Lennart Poettering [Wed, 14 Jan 2015 22:17:07 +0000 (23:17 +0100)]
nspawn: fix an incorrect assert comparison

7 years agologinctl: fix misuse compound literals
Lennart Poettering [Wed, 14 Jan 2015 22:16:28 +0000 (23:16 +0100)]
loginctl: fix misuse compound literals

The lifetime of compound literals is bound to the local scope, we hence
cannot refernce them outside of it.

7 years agosd-bus: tell Coverity that it's OK not to care for return values in some cases
Lennart Poettering [Wed, 14 Jan 2015 22:16:11 +0000 (23:16 +0100)]
sd-bus: tell Coverity that it's OK not to care for return values in some cases

7 years agonspawn: add file system locks for controlling access to container images
Lennart Poettering [Wed, 14 Jan 2015 22:09:02 +0000 (23:09 +0100)]
nspawn: add file system locks for controlling access to container images

This adds three kinds of file system locks for container images:

a) a file system lock next to the actual image, in a .lck file in the
   same directory the image is located. This lock has the benefit of
   usually being located on the same NFS share as the image itself, and
   thus allows locking container images across NFS shares.

b) a file system lock in /run, named after st_dev and st_ino of the
   root of the image. This lock has the advantage that it is unique even
   if the same image is bind mounted to two different places at the same
   time, as the ino/dev stays constant for them.

c) a file system lock that is only taken when a new disk image is about
   to be created, that ensures that checking whether the name is already
   used across the search path, and actually placing the image is not
   interrupted by other code taking the name.

a + b are read-write locks. When a container is booted in read-only mode
a read lock is taken, otherwise a write lock.

Lock b is always taken after a, to avoid ABBA problems.

Lock c is mostly relevant when renaming or cloning images.

7 years agosysv-generator: always use fstatat() if we can
Lennart Poettering [Wed, 14 Jan 2015 21:37:56 +0000 (22:37 +0100)]
sysv-generator: always use fstatat() if we can

7 years agosysv-generator: fix memory leak on failure
Lennart Poettering [Wed, 14 Jan 2015 21:31:03 +0000 (22:31 +0100)]
sysv-generator: fix memory leak on failure

This fixes a memory leak introduced by

7 years agomachinectl: fix minor memory leak
Lennart Poettering [Wed, 14 Jan 2015 21:30:43 +0000 (22:30 +0100)]
machinectl: fix minor memory leak

7 years agopty: minor modernization
Lennart Poettering [Wed, 14 Jan 2015 01:22:27 +0000 (02:22 +0100)]
pty: minor modernization

We initialize structs during declartion if possible

7 years agomachined: use the FS_IMMUTABLE_FL file flag, if available, to implement a "read-only...
Lennart Poettering [Wed, 14 Jan 2015 01:21:51 +0000 (02:21 +0100)]
machined: use the FS_IMMUTABLE_FL file flag, if available, to implement a "read-only" concept for raw disk images, too

7 years agoutil: the chattr flags field is actually unsigned, judging by kernel sources
Lennart Poettering [Wed, 14 Jan 2015 01:04:17 +0000 (02:04 +0100)]
util: the chattr flags field is actually unsigned, judging by kernel sources

Unlike some client code suggests...

7 years agoptyfw: add missing error check
Lennart Poettering [Wed, 14 Jan 2015 01:01:42 +0000 (02:01 +0100)]
ptyfw: add missing error check

7 years agonspawn: remove the right propagation directory
Lennart Poettering [Wed, 14 Jan 2015 01:01:11 +0000 (02:01 +0100)]
nspawn: remove the right propagation directory

7 years agotest: hashmap_put behaviour for equal keys
Martin Pitt [Sat, 13 Dec 2014 03:22:28 +0000 (04:22 +0100)]
test: hashmap_put behaviour for equal keys

Check string ops hashmap_put() for keys with a different pointer but the same

7 years agoman: remove "nofail" from systemd.swap(5)
Zbigniew Jędrzejewski-Szmek [Wed, 14 Jan 2015 01:05:42 +0000 (20:05 -0500)]
man: remove "nofail" from systemd.swap(5)

As suggested by Marcos Felipe Rasia de Mello <>.

7 years agomachinectl: use GNU basename, not the XPG version
Cristian Rodríguez [Sun, 11 Jan 2015 17:50:15 +0000 (14:50 -0300)]
machinectl: use GNU basename, not the XPG version

7 years agorefcnt: refcnt is unsigned, fix comparisons
Tom Gundersen [Tue, 13 Jan 2015 22:03:11 +0000 (23:03 +0100)]
refcnt: refcnt is unsigned, fix comparisons

This does not make a difference, but the code was confusing.

7 years agonspawn: --help typo fix
Lennart Poettering [Tue, 13 Jan 2015 19:59:07 +0000 (20:59 +0100)]
nspawn: --help typo fix

7 years agoupdate TODO
Lennart Poettering [Tue, 13 Jan 2015 19:07:54 +0000 (20:07 +0100)]
update TODO

7 years agonetworkd: propagate IPFoward= per-interface setting also to /proc/sys/net/ipv4/ip_forward
Lennart Poettering [Tue, 13 Jan 2015 19:50:46 +0000 (20:50 +0100)]
networkd: propagate IPFoward= per-interface setting also to /proc/sys/net/ipv4/ip_forward

We need to turn on /proc/sys/net/ipv4/ip_forward before the
per-interface forwarding setting is useful, hence let's propagate the
per-interface setting once to the system-wide setting.

Due to the unclear ownership rules of that flag, and the fact that
turning it on also has effects on other sysctl flags we try to minimize
changes to the flag, and only turn it on once. There's no logic to
turning it off again, but this should be fairly unproblematic as the
per-interface setting defaults to off anyway.

7 years agoudev: make use of new one_zero() helper where appropriate
Lennart Poettering [Tue, 13 Jan 2015 19:16:39 +0000 (20:16 +0100)]
udev: make use of new one_zero() helper where appropriate

7 years agonetworkd: make IP forwarding for IPv4 and IPv6 individually configurable
Lennart Poettering [Tue, 13 Jan 2015 19:07:13 +0000 (20:07 +0100)]
networkd: make IP forwarding for IPv4 and IPv6 individually configurable

7 years agonetwork: IPMasquerade= implies IPForward=, hence remove it
Lennart Poettering [Tue, 13 Jan 2015 19:03:44 +0000 (20:03 +0100)]
network: IPMasquerade= implies IPForward=, hence remove it

7 years agonetworkd: rename misnamed boolean
Lennart Poettering [Tue, 13 Jan 2015 18:56:13 +0000 (19:56 +0100)]
networkd: rename misnamed boolean

7 years agonetworkd: introduce an AddressFamilyBoolean enum type
Lennart Poettering [Tue, 13 Jan 2015 18:48:19 +0000 (19:48 +0100)]
networkd: introduce an AddressFamilyBoolean enum type

This introduces am AddressFamilyBoolean type that works more or less
like a booleaan, but can optionally turn on/off things for ipv4 and ipv6
independently. THis also ports the DHCP field over to it.

7 years agojournald: allow zero length datagrams again
Lennart Poettering [Tue, 13 Jan 2015 18:43:16 +0000 (19:43 +0100)]
journald: allow zero length datagrams again

This undoes a small part of 13790add4bf648fed816361794d8277a75253410
which was erroneously added, given that zero length datagrams are OK,
and hence zero length reads on a SOCK_DGRAM be no means mean EOF.

7 years agonspawn: add "-n" shortcut for "--network-veth"
Lennart Poettering [Tue, 13 Jan 2015 18:42:02 +0000 (19:42 +0100)]
nspawn: add "-n" shortcut for "--network-veth"

Now that networkd's IP masquerading support means that running
containers with "--network-veth" will provide network access out of the
box for the container, let's add a shortcut "-n" for it, to make it
easily accessible.

7 years agodoc: add cross-references between systemd.{link, netdev, network}
Jan Engelhardt [Mon, 12 Jan 2015 19:43:14 +0000 (20:43 +0100)]
doc: add cross-references between systemd.{link, netdev, network}

7 years agodoc: network - add comment about default prefix size
Tom Gundersen [Tue, 13 Jan 2015 17:23:53 +0000 (18:23 +0100)]
doc: network - add comment about default prefix size

Should hopefully make it clear that this is not some magic value, just the default we picked.

Suggested by Jan Engelhardt.

7 years agofw-util: fix errno typo for !HAVE_LIBIPTC
Daniel Mack [Tue, 13 Jan 2015 14:50:15 +0000 (15:50 +0100)]
fw-util: fix errno typo for !HAVE_LIBIPTC

7 years agoTODO: DHCPv6 Information Request has been implemented
Patrik Flykt [Tue, 13 Jan 2015 12:27:48 +0000 (14:27 +0200)]
TODO: DHCPv6 Information Request has been implemented

7 years agoupdate TODO
Lennart Poettering [Tue, 13 Jan 2015 12:54:19 +0000 (13:54 +0100)]
update TODO

7 years agomachined: refuse certain operation on non-container machines, since they cannot work...
Lennart Poettering [Tue, 13 Jan 2015 12:53:32 +0000 (13:53 +0100)]
machined: refuse certain operation on non-container machines, since they cannot work elsewhere

7 years agoimport: make sure we don't mangle file ownerships with the local passwd database...
Lennart Poettering [Tue, 13 Jan 2015 12:52:49 +0000 (13:52 +0100)]
import: make sure we don't mangle file ownerships with the local passwd database when untarring

7 years agonspawn: add new option "--port=" for exposing container ports on the local host
Lennart Poettering [Tue, 13 Jan 2015 12:51:51 +0000 (13:51 +0100)]
nspawn: add new option "--port=" for exposing container ports on the local host

This exposes an IP port on the container as local port using DNAT.

7 years agonetworkd: add minimal IP forwarding and masquerading support to .network files
Lennart Poettering [Tue, 13 Jan 2015 12:47:08 +0000 (13:47 +0100)]
networkd: add minimal IP forwarding and masquerading support to .network files

This adds two new settings to networkd's .network files:
IPForwarding=yes and IPMasquerade=yes. The former controls the
"forwarding" sysctl setting of the interface, thus controlling whether
IP forwarding shall be enabled on the specific interface. The latter
controls whether a firewall rule shall be installed that exposes traffic
coming from the interface as coming from the local host to all other

This also enables both options by default for container network
interfaces, thus making "systemd-nspawn --network-veth" have network
connectivity out of the box.

7 years agoshared: add minimal firewall manipulation helpers for establishing NAT rules, using...
Lennart Poettering [Tue, 13 Jan 2015 12:44:30 +0000 (13:44 +0100)]
shared: add minimal firewall manipulation helpers for establishing NAT rules, using libiptc

7 years agocore: Fix EACCES check for OOM adjustments
Martin Pitt [Tue, 13 Jan 2015 06:06:31 +0000 (07:06 +0100)]
core: Fix EACCES check for OOM adjustments

Commit 3bd5c3 added a check for EACCES, but missed the minus sign.

7 years agoRemove some fixed items from TODO
Zbigniew Jędrzejewski-Szmek [Tue, 13 Jan 2015 00:15:02 +0000 (19:15 -0500)]
Remove some fixed items from TODO

7 years agozsh-completion: add missing completions for systemd-tmpfiles
Ronny Chevalier [Mon, 12 Jan 2015 21:19:34 +0000 (22:19 +0100)]
zsh-completion: add missing completions for systemd-tmpfiles

7 years agozsh-completion: add missing completions for systemd-run
Ronny Chevalier [Mon, 12 Jan 2015 21:09:29 +0000 (22:09 +0100)]
zsh-completion: add missing completions for systemd-run

7 years agozsh-completion: add missing completions for systemd-analyze
Ronny Chevalier [Mon, 12 Jan 2015 20:43:45 +0000 (21:43 +0100)]
zsh-completion: add missing completions for systemd-analyze

7 years agozsh-completion: add missing -M completion for timedatectl
Ronny Chevalier [Mon, 12 Jan 2015 20:31:45 +0000 (21:31 +0100)]
zsh-completion: add missing -M completion for timedatectl

7 years agozsh-completion: add missing completions for coredumpctl
Ronny Chevalier [Mon, 12 Jan 2015 20:26:27 +0000 (21:26 +0100)]
zsh-completion: add missing completions for coredumpctl

7 years agoTODO: update
David Herrmann [Mon, 12 Jan 2015 17:25:11 +0000 (18:25 +0100)]
TODO: update

7 years agoudev: link_config - modernize a bit and fix leakes
Tom Gundersen [Sat, 10 Jan 2015 00:11:54 +0000 (01:11 +0100)]
udev: link_config - modernize a bit and fix leakes

Not all of the link_config struct was getting freed.

7 years agonetwork-intenal: user _cleanup_ macro in parse_ifname
Tom Gundersen [Fri, 9 Jan 2015 23:33:46 +0000 (00:33 +0100)]
network-intenal: user _cleanup_ macro in parse_ifname

7 years agocore/mount: remove "fail" again
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jan 2015 17:14:59 +0000 (12:14 -0500)]
core/mount: remove "fail" again

deb6120920 'man: there's actually no "fail" fstab option, but only
"nofail" removed it from our documentation, which I missed.
fstab(5) only mentions "auto", "noauto", and "nofail". Stick to
those three.

7 years agosd-bus: sync kdbus.h (API break)
Daniel Mack [Mon, 12 Jan 2015 17:15:18 +0000 (18:15 +0100)]
sd-bus: sync kdbus.h (API break)

Just a simple variable rename, and a dropped flag that sd-bus didn't make
use of.

7 years agocore/mount: use isempty() to check for empty strings
Daniel Mack [Mon, 12 Jan 2015 12:46:39 +0000 (13:46 +0100)]
core/mount: use isempty() to check for empty strings

strempty() will return an empty string in case the input parameter is
a NULL pointer. The correct test to check for an empty string is
isempty(), so use that instead.

This fixes a regression from commit 17a1c59 ("core/mount: filter out
noauto,auto,nofail,fail options").

7 years agoudev: Add builtin/rule to export evdev information as udev properties
Carlos Garnacho [Sun, 11 Jan 2015 19:47:19 +0000 (20:47 +0100)]
udev: Add builtin/rule to export evdev information as udev properties

This rule is only run on tablet/touchscreen devices, and extracts their size
in millimeters, as it can be found out through their struct input_absinfo.

The first usecase is exporting device size from tablets/touchscreens. This
may be useful to separate policy and application at the time of mapping
these devices to the available outputs in windowing environments that don't
offer that information as readily (eg. Wayland). This way the compositor can
stay deterministic, and the mix-and-match heuristics are performed outside.

Conceivably, size/resolution information can be changed through EVIOCSABS
anywhere else, but we're only interested in values prior to any calibration,
this rule is thus only run on "add", and no tracking of changes is performed.
This should only remain a problem if calibration were automatically applied
by an earlier udev rule (read: don't).

  v2: Folded rationale into commit log, made a builtin, set properties
      on device nodes themselves
  v3: Use inline function instead of macro for mm. size calculation,
      use DECIMAL_STR_MAX, other code style issues
  v4: Made rule more selective
  v5: Minor style issues, renamed to a more generic builtin, refined
      rule further.

7 years agocatalog: add pt_BR translation
Rafael Ferreira [Sun, 11 Jan 2015 23:11:42 +0000 (18:11 -0500)]
catalog: add pt_BR translation

7 years agopo: add Brazilian Portuguese translation
Rafael Ferreira [Sat, 10 Jan 2015 15:33:13 +0000 (13:33 -0200)]
po: add Brazilian Portuguese translation

7 years agofstab-util: fix priority parsing and add test
Zbigniew Jędrzejewski-Szmek [Mon, 12 Jan 2015 04:40:46 +0000 (23:40 -0500)]
fstab-util: fix priority parsing and add test

7 years agoshared/util: respect buffer boundary on incomplete escape sequences
Zbigniew Jędrzejewski-Szmek [Sun, 11 Jan 2015 22:21:17 +0000 (17:21 -0500)]
shared/util: respect buffer boundary on incomplete escape sequences

cunescape_length_with_prefix() is called with the length as an
argument, so it cannot rely on the buffer being NUL terminated.
Move the length check before accessing the memory.

When an incomplete escape sequence was given at the end of the
buffer, c_l_w_p() would read past the end of the buffer. Fix this
and add a test.

7 years agocore/load-fragment: avoid allocating 0 bytes when given an invalid command
Zbigniew Jędrzejewski-Szmek [Sun, 11 Jan 2015 21:57:02 +0000 (16:57 -0500)]
core/load-fragment: avoid allocating 0 bytes when given an invalid command

With a command line like "@/something" we would allocate an array with
0 elements. Avoid that, and add a test too.