Commit graph

31614 commits

Author SHA1 Message Date
Yu Watanabe 827d9bf297 core/socket: dump more settings 2017-12-23 19:32:38 +09:00
Yu Watanabe 13ec20d42a dbus-cgroup: merge several blocks which operate almost same tasks 2017-12-23 19:32:36 +09:00
Yu Watanabe d6ff82d37c dbus-execute: use empty_to_null() where it can be applicable 2017-12-23 19:32:34 +09:00
Yu Watanabe f50ab33faf doc: add {Condition,Assert}ControlGroupController= to TRANSIENT-SETTINGS.md
Follow-up for e16647c39d.
2017-12-23 19:32:31 +09:00
Yu Watanabe d9f7305fd7 cgroup: move path checking logic to dbus-cgroup.c 2017-12-23 19:32:29 +09:00
Yu Watanabe 62b749a981 bus-unit-util: simplify bus_append_cgroup_property() 2017-12-23 19:32:27 +09:00
Yu Watanabe eae194a51b bus-unit-util: make dependency settings can take multiple units
This allows people to specify multiple units in dependency settings
e.g. `Requires=foo.service baz.service`.
2017-12-23 19:32:25 +09:00
Yu Watanabe b48e508db3 dbus-socket: move truncation check to bus_socket_set_transient_property() 2017-12-23 19:32:23 +09:00
Yu Watanabe e045e325df basic: introduce socket_protocol_{from,to}_name()
And use them where they can be applicable.
2017-12-23 19:32:04 +09:00
Yu Watanabe 8a211c8edb doc: update TRANSIENT-SETTINGS.md 2017-12-23 18:48:35 +09:00
Yu Watanabe 624dd00973 man: add explanation about transient path or socket units in systemd-run 2017-12-23 18:48:31 +09:00
Yu Watanabe d59ef3e243 run: add support to create transient path and socket unit 2017-12-23 18:48:27 +09:00
Yu Watanabe 89ada3ba08 bus-unit-util: add socket unit related options
Also, split bus_append_unit_property_assignment().
2017-12-23 18:48:16 +09:00
Yu Watanabe 9c0320e7ab core: implement transient socket unit 2017-12-23 18:47:33 +09:00
Yu Watanabe 398ce0bc5a socket-util: add socket_address_type_{from,to}_string() 2017-12-23 18:46:43 +09:00
Yu Watanabe 038ed5a4b6 core/socket: add socket_port_type_from_string() 2017-12-23 18:46:16 +09:00
Yu Watanabe 836bb1cd42 core:socket: fix string in socket_exec_command_table 2017-12-23 18:45:59 +09:00
Yu Watanabe 9ee896d5dd core,seccomp: fix logic to parse RestrictAddressFamilies= in dbus-execute.c
If multiple RestrictAddressFamilies= settings, some of them are
whitelist and the others are blacklist, are sent to bus, then parsing
result was corrupted.
This fixes the parse logic, now it is the same as one used in
load-fragment.c
2017-12-23 18:45:52 +09:00
Yu Watanabe 898748d8b9 core,seccomp: fix logic to parse syscall filter in dbus-execute.c
If multiple SystemCallFilter= settings, some of them are whitelist
and the others are blacklist, are sent to bus, then the parse
result was corrupted.
This fixes the parse logic, now it is the same as one used in
load-fragment.c
2017-12-23 18:45:32 +09:00
Lennart Poettering 7e985c6983 coccinelle: beef up isempty() checks (#7729)
With these additions, coccinelle finds everything fixed by the first
commit in PR #7695. In order not to needlessly conflict with that PR
this PR won't include those fixes, but only the coccinelle changes to
detect them automatically in the future.
2017-12-23 08:47:55 +01:00
Dmitry Rozhkov 5526ac50fe man: fix example config to conform the content of the man page
The config example contains wrong specificator for hostname.
It should be %H instead of %h as documented in the man page.

Use correct specificator for hostname.
2017-12-22 15:35:17 +01:00
Sylvain Plantefève fe25b1496b catalog: update french translation 2017-12-22 15:34:51 +01:00
Mathieu Malaterre 63d00dfb64 shared/seccomp: add mmap handling for powerpc
Also remove the warning:

./src/shared/seccomp-util.c:1414:2: warning: #warning "Consider adding the right mmap() syscall definitions here!" [-Wcpp]
 #warning "Consider adding the right mmap() syscall definitions here!"
2017-12-22 15:30:03 +01:00
Yu Watanabe e1694a752f networkd: show warning on error or cast to void when error is ignored (#7716) 2017-12-21 19:07:23 +01:00
Zbigniew Jędrzejewski-Szmek 4f561ecda9 meson: reuse libsystemd_static for libsystemd
This gets rid of recompilation, making things faster and avoids duplicated warnings.
The result seems to be the same:
$ ls -l build/libsystemd.so.0.20.0 build2/libsystemd.so.0.20.0
-rwxrwxr-x. 1 zbyszek zbyszek 3071312 Dec 19 11:45 build2/libsystemd.so.0.20.0
-rwxrwxr-x. 1 zbyszek zbyszek 3071760 Dec 19 11:11 build/libsystemd.so.0.20.0
$ diff -U1 <(objdump -T build/libsystemd.so.0.20.0|sed -r 's/[0-9a-f]{16}/________________/g') <(objdump -T build2/libsystemd.so.0.20.0|sed -r 's/[0-9a-f]{16}/________________/g')
-build/libsystemd.so.0.20.0:     file format elf64-x86-64
+build2/libsystemd.so.0.20.0:     file format elf64-x86-64
2017-12-21 17:01:23 +01:00
Zbigniew Jędrzejewski-Szmek 37e4d7a855 meson: rename libsystemd_internal to libsystem_static
We already use the "_static" suffix for libshared_static ("shared" is the name
of the library, "static" is the format) and other libs, so let's rename for
consistency.

Also change libsystemd_static_sources to libsystemd_sources, since the same
list is used for both and shorter is better.
2017-12-21 17:01:02 +01:00
Michał 575cfb6227 hwdb: Add accelerometer orientation entry for Lenovo MIIX3-1030 tablet (#7713)
Full dmi/id/modalias:
dmi:bvnLENOVO:bvrB4CN29WW:bd12/04/2015:svnLENOVO:pn80HV:pvrLenovoMIIX3-1030:rvnLENOVO:rnMartini:rvrSDK0G98662WIN:cvnLENOVO:ct11:cvrLenovoMIIX3-1030:

Tested on Lenovo MIIX3 with Debian 9
2017-12-21 14:17:33 +01:00
Susant Sahani 36e6e28bce Fix #7704 and #7708. (#7712)
Init rule variable iif oif and to, from

While foreign rules are added the network part is not attached.
attach manager to rules and use it in routing_policy_rule_free.
2017-12-21 21:27:45 +09:00
Zbigniew Jędrzejewski-Szmek 281bb5c110 network: fix memory leak when an netdev was skipped
In general we'd leak anything that was allocated in the first parsing of
netdev, e.g. netdev name, host name, etc. Use normal netdev_unref to make sure
everything is freed.

--- command ---
/home/zbyszek/src/systemd/build2/test-network
--- stderr ---
/etc/systemd/network/wg0.netdev:3: Failed to parse netdev kind, ignoring: wireguard
/etc/systemd/network/wg0.netdev:5: Unknown section 'WireGuard'. Ignoring.
/etc/systemd/network/wg0.netdev:9: Unknown section 'WireGuardPeer'. Ignoring.
NetDev has no Kind configured in /etc/systemd/network/wg0.netdev. Ignoring
/etc/systemd/network/br0.network:13: Unknown lvalue 'NetDev' in section 'Network'
br0: netdev ready

=================================================================
==11666==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 4 byte(s) in 1 object(s) allocated from:
    #0 0x7f3a314cf238 in __interceptor_strdup (/lib64/libasan.so.4+0x77238)
    #1 0x7f3a30e71ad1 in free_and_strdup ../src/basic/string-util.c:870
    #2 0x7f3a30d34fba in config_parse_ifname ../src/shared/conf-parser.c:981
    #3 0x7f3a30d2f5b0 in next_assignment ../src/shared/conf-parser.c:155
    #4 0x7f3a30d30303 in parse_line ../src/shared/conf-parser.c:273
    #5 0x7f3a30d30dee in config_parse ../src/shared/conf-parser.c:390
    #6 0x7f3a30d310a5 in config_parse_many_files ../src/shared/conf-parser.c:428
    #7 0x7f3a30d3181c in config_parse_many ../src/shared/conf-parser.c:487
    #8 0x55b4200f9b00 in netdev_load_one ../src/network/netdev/netdev.c:634
    #9 0x55b4200fb562 in netdev_load ../src/network/netdev/netdev.c:778
    #10 0x55b4200c607a in manager_load_config ../src/network/networkd-manager.c:1299
    #11 0x55b4200818e0 in test_load_config ../src/network/test-network.c:128
    #12 0x55b42008343b in main ../src/network/test-network.c:254
    #13 0x7f3a305f8889 in __libc_start_main (/lib64/libc.so.6+0x20889)

SUMMARY: AddressSanitizer: 4 byte(s) leaked in 1 allocation(s).
-------
2017-12-20 16:17:29 +01:00
Zbigniew Jędrzejewski-Szmek af126c9623
Merge pull request #7710 from jwrdegoede/hwdb-accel-chuwi-vi8-teclast-x80-pro
hwdb/60-sensor.hwdb: Add entries for the Chuwi vi8 and Teclast x80 pro tablets
2017-12-20 13:57:12 +01:00
Lennart Poettering 28e176cc2d
Merge pull request #7702 from keszybz/reduce-linkage
Some small cleanups and another attempt to reduce linkage of nss modules
2017-12-20 12:08:40 +01:00
Hans de Goede 0611b8f001 hwdb: Add accelerometer orientation entry for Teclast X80 Pro tablet
Add an accelerometer orientation entry for the Teclast X80 Pro tablet.
2017-12-20 11:32:05 +01:00
Hans de Goede 016d5f6f76 hwdb: Add accelerometer orientation entry for Chuwi Vi8 (CWI506) tablet
Add an accelerometer orientation entry for the Chuwi Vi8 (CWI506) tablet.
2017-12-20 11:32:05 +01:00
Alan Jenkins 5e0aff564c man: User=, Group= *never* work for mount units (#7602)
Old text:

> Note that the User= and
> Group= options are not particularly useful for mount units specifying a
> "Type=" option or using configuration not specified in /etc/fstab;
> mount(8) will refuse options that are not listed in /etc/fstab if it is
> not run as UID 0.

However I recently learnt the following:

> The mount program does not read the /etc/fstab file if both device
> and dir are specified.

Therefore, if both device and dir are specified, the `user` or `users`
options in `fstab` will not have any effect.  Run as a normal user,
you will always see

    mount: only root can do that

Fix the explanation in the man page.

Also make sure to markup User= and Group= with <varname>.
2017-12-19 21:22:05 +01:00
Zbigniew Jędrzejewski-Szmek 07fbf8807c
Merge pull request #7697 from yuwata/fix-man-exec-no-new-priv
man: LockPersonality= implies NoNewPrivileges=
2017-12-19 19:31:55 +01:00
Zbigniew Jędrzejewski-Szmek db7d1dcae6 sd-bus: drop check for selinux before calling getsockopt(SO_PEERSEC)
Quoting Lennart Poettering in
https://github.com/systemd/systemd/pull/6464#issuecomment-319029293:
> If the kernel allows us to query that data we should also be Ok with passing
> it on to our own caller, regardless if selinux is technically on or off...

The advantage is that this allows gcc to be smarter and reduce linkage:
(before)$ ldd build/libnss_systemd.so.2
	linux-vdso.so.1 (0x00007ffeb46ff000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f2f60da6000)
	libcap.so.2 => /lib64/libcap.so.2 (0x00007f2f60ba1000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f2f60978000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2f60759000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f2f60374000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f2f61294000)
	libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007f2f600f0000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f2f5feec000)
(after )$ ldd build/libnss_systemd.so.2
	linux-vdso.so.1 (0x00007ffe5f543000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f427dcaa000)
	libcap.so.2 => /lib64/libcap.so.2 (0x00007f427daa5000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f427d886000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f427d4a1000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f427e196000)

Note that this only works in conjuction with the previous commit: either
of the two commits alone does not have the desired effect on linkage.

Replaces #6464.
2017-12-19 15:24:31 +01:00
Zbigniew Jędrzejewski-Szmek de2e28d87d Move selinux-related stuff from btrfs-util.c to label.c
In preparation for future changes.
2017-12-19 15:22:05 +01:00
Zbigniew Jędrzejewski-Szmek d49a7143fc machine-id-setup: use return log_error… pattern
No functional difference, but this way it's clearer that the original errno
value is returned.
2017-12-19 15:20:38 +01:00
Zbigniew Jędrzejewski-Szmek 5364c68690 bootctl: silence warning about signed/unsigned comparison 2017-12-19 15:20:37 +01:00
John Paul Herold 82a18dcfb2 Add T430 series to list of supported trackpoint (#7699)
Confirmed via `udevadm test /sys/class/input/eventX` that
POINTINGSTICK_* properties were not being set for my T430s trackpoint.
After adding a local entry file (as advised in this file), the same
`udevadm test` command showed properties.

More importantly, the movement of mouse using trackpoint felt much
better. Hard to describe its previous state, but following come to mind:
slippery, hard to control, awkward. Now it feels more consistent and predictable.
A little on the sensitive side with the defaults, but didn't think it warranted
dedicated properties just for this series though as the X230 is same generation
and uses the defaults.

Before local change:

$ udevadm info /dev/input/event5
P: /devices/platform/i8042/serio1/serio2/input/input6/event5
N: input/event5
E: DEVNAME=/dev/input/event5
E: DEVPATH=/devices/platform/i8042/serio1/serio2/input/input6/event5
E: ID_BUS=i8042
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_INPUT_POINTINGSTICK=1
E: LIBINPUT_DEVICE_GROUP=11/2/a:synaptics-pt/serio0
E: MAJOR=13
E: MINOR=69
E: SUBSYSTEM=input
E: USEC_INITIALIZED=38609915

After change:

$ udevadm info /dev/input/event5
P: /devices/platform/i8042/serio1/serio2/input/input6/event5
N: input/event5
E: DEVNAME=/dev/input/event5
E: DEVPATH=/devices/platform/i8042/serio1/serio2/input/input6/event5
E: ID_BUS=i8042
E: ID_INPUT=1
E: ID_INPUT_MOUSE=1
E: ID_INPUT_POINTINGSTICK=1
E: LIBINPUT_DEVICE_GROUP=11/2/a:synaptics-pt/serio0
E: MAJOR=13
E: MINOR=69
E: POINTINGSTICK_CONST_ACCEL=1.0
E: POINTINGSTICK_SENSITIVITY=200
E: SUBSYSTEM=input
E: USEC_INITIALIZED=38609915
2017-12-19 11:22:36 +01:00
Yu Watanabe a51986154f timedatectl: fix status output (#7696)
Follow-up for 3ec530a189.

Fixes #7693.
2017-12-19 11:15:50 +01:00
Jörg Thalheim 2a5fcfae02 more portable perl shebangs (#7701)
same motivation as in #5816:

- distributions have scripts to rewrite shebangs on installation and
  they know what locations to rely on.
- For tests/compilation we should rather rely on the user to have setup
  there PATH correctly.
2017-12-19 11:13:34 +01:00
Zbigniew Jędrzejewski-Szmek dc0a35550e cryptsetup: use uint64_t for keyfile-offset= (#7689)
On 32bit, refuse large offsets. Once https://gitlab.com/cryptsetup/cryptsetup/issues/359
is resolved, we should switch to the new api, whatever it is.

Fixes #7677.
2017-12-19 16:51:12 +09:00
Yu Watanabe 5af1644314 man: note that systemctl show does not overridden value
Fixes #7694.
2017-12-19 16:07:04 +09:00
Yu Watanabe 69b528832a man: LockPersonality= implies NoNewPrivileges= 2017-12-19 12:48:54 +09:00
Yu Watanabe e7bcff4ec4 core: move path_kill_slashes() to manager 2017-12-19 10:44:20 +09:00
Yu Watanabe 5976f1ca76 core: fix wrong validity check 2017-12-19 10:44:04 +09:00
Yu Watanabe 586290017d tree-wide: use !strv_isempty() instead of strv_length() > 0 2017-12-19 10:43:57 +09:00
Zbigniew Jędrzejewski-Szmek bf0e0a4df2 analyze: use normal bus connection for "plot" verb (#7685)
We need to connect to hostnamed, so a private bus connection is no good.
It'd be simpler to use the normal bus connection unconditionally, but
that'd mean that e.g. systemd-analyze set-log-level might not work in
emergency mode. So let's keep trying to use the private connection except
for "plot".

Fixes #7667.
2017-12-18 19:35:03 +01:00
Lennart Poettering bd8fdbcfc5
Merge pull request #7687 from hbakken/work/add-missing-features2
Kernel 3.10 compat
2017-12-18 19:29:00 +01:00