Commit graph

28041 commits

Author SHA1 Message Date
Dmitry Rozhkov 8b4198373b resolved: install answers to mDNS transactions too
Currently resolving mDNS requests doesn't work because in
dns_transaction_process_reply() no answer gets installed into
mDNS transactions.

When receiving a mDNS reply we should not check for query section
equivalence of the request and its corresponsing response. But still
we need to install answers to mDNS transactions to make it possible
to actually resolve mDNS requests.

Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
2017-01-19 11:51:21 +02:00
Djalal Harouni 0819dd72df Merge pull request #5098 from evverx/fix-nspawn-notifications
nspawn: change owner/group of /run/systemd/nspawn/notify to userns-root
2017-01-18 14:36:07 +01:00
Zbigniew Jędrzejewski-Szmek 5b3637b44a Merge pull request #4991 from poettering/seccomp-fix 2017-01-17 23:10:46 -05:00
Zbigniew Jędrzejewski-Szmek 70dd455c8e pid1: provide a more detailed error message when execution fails (#5074)
Fixes #5000.
2017-01-17 22:38:55 -05:00
Lennart Poettering 4d5bd50ab2 seccomp: minor simplifications for is_seccomp_available() 2017-01-17 22:14:27 -05:00
Lennart Poettering 469830d142 seccomp: rework seccomp code, to improve compat with some archs
This substantially reworks the seccomp code, to ensure better
compatibility with some architectures, including i386.

So far we relied on libseccomp's internal handling of the multiple
syscall ABIs supported on Linux. This is problematic however, as it does
not define clear semantics if an ABI is not able to support specific
seccomp rules we install.

This rework hence changes a couple of things:

- We no longer use seccomp_rule_add(), but only
  seccomp_rule_add_exact(), and fail the installation of a filter if the
  architecture doesn't support it.

- We no longer rely on adding multiple syscall architectures to a single filter,
  but instead install a separate filter for each syscall architecture
  supported. This way, we can install a strict filter for x86-64, while
  permitting a less strict filter for i386.

- All high-level filter additions are now moved from execute.c to
  seccomp-util.c, so that we can test them independently of the service
  execution logic.

- Tests have been added for all types of our seccomp filters.

- SystemCallFilters= and SystemCallArchitectures= are now implemented in
  independent filters and installation logic, as they semantically are
  very much independent of each other.

Fixes: #4575
2017-01-17 22:14:27 -05:00
AsciiWolf 542ca7c9d2 man: fix typo (#5093) 2017-01-17 12:09:38 +01:00
Evgeny Vereshchagin 9bcef20646 tests: check that we can write to /run/systemd/nspawn/notify
See https://github.com/systemd/systemd/issues/4944
2017-01-17 08:40:19 +00:00
Evgeny Vereshchagin adc7d9f0da nspawn: change owner/group of /run/systemd/nspawn/notify to userns-root
Fixes #4944
2017-01-17 08:40:05 +00:00
Franck Bui 03b8cfede9 core: make sure to init mount params before calling mount_is_extrinsic() (#5087)
When a new entry appears in /proc/self/mountinfo, mount_setup_unit()
allocated a new mount unit for it and starts initializing it.

mount_setup_unit() is also used to update a mount unit when a change happens in
/proc/self/mountinfo, for example a mountpoint can be remounted with additional
mount options.

This patch introduces 2 separate functions to deal with those 2 cases instead
of mount_setup_unit() dealing with both of them. The common code is small and
doing the split makes the code easier to read and less error prone if extended
later.

It also makes sure to initialize in both functions the mount parameters of the
mount unit before calling mount_is_extrinsic() since this function relies on
them.

Fixes: #4902
2017-01-16 15:19:13 -05:00
Cédric Schieli fe0252e5b8 ndisc: honor IPv6AcceptRA.UseDNS when parsing RA options (#5071)
RDNSS and DNSLL options received in RA are always used, possibly breaking the resolution of private domains hosted on a local DNS server. When setting UseDNS=no in a [IPv6AcceptRA] section of a .network file, both RDNSS and DNSLL options in received RA should be ignored. 

Fixes: #5040
2017-01-16 12:23:26 -05:00
Björn e52b13cfc4 hwdb: add axis range corrections for Lenovo X1 Carbon 4th gen. / X1 Yoga (#5089)
The parameters were calculated on my X1 Yoga using touchpad-edge-detector; As as the device name indicates, the Touchpad is exactly the same as the X1 Carbon 4th gen.
2017-01-16 12:19:04 -05:00
Martin Pitt 8171bcc70f Merge pull request #5085 from keszybz/variables
Fixes for gcc and coverity warnings
2017-01-16 07:56:53 +01:00
Earnestly 74875a56cf hwdb: Include X220 for pointingstick sensitivity (#5083)
Without this the trackpoint is very difficult to manoeuvre until
manually correcting the sysfs serio1/sensitivity entry.
2017-01-15 20:41:59 -05:00
kilian-k da858c3888 hwdb: add Logitech TrackMan Wheel (#5084) 2017-01-15 17:21:33 -05:00
Zbigniew Jędrzejewski-Szmek e0489532fd nspawn: fix memleak
CID #1368262: fn is allocated with new, so it should be freed.
2017-01-15 16:57:57 -05:00
Zbigniew Jędrzejewski-Szmek 402a81c774 shared/install-printf: fix memleak
instance might be "", and that string would be leaked.

CID #1368264.
2017-01-15 13:42:53 -05:00
Zbigniew Jędrzejewski-Szmek a9bd056ad9 systemctl: fix alignment with units in not-found state
A fixed value (6 and later 5) was added back in 4deb3b9391, and
not updated when load_len was added later on.

Also the other 5 with 1 + 1 + 1 + 1 + 1 to make it easier to see
that this is about the column separators.
2017-01-15 13:38:43 -05:00
Zbigniew Jędrzejewski-Szmek 43479f8d21 systemctl: uninitalized variable
CID #1368270.

Easily reproduced with COLUMNS=50 ./systemctl --no-pager.
2017-01-15 13:27:37 -05:00
Zbigniew Jędrzejewski-Szmek c05347807f process-util: rename char *r to ans and add comment
Add a comment about the return value and rename r to ans. r is
nowadays reserved for the integer return value, and char *r is confusing.
2017-01-15 12:41:34 -05:00
Zbigniew Jędrzejewski-Szmek e50412ef19 journalctl: fix memleak
This is harmless, it would only happen if --verify-key is used multiple times.
But let's fix it for correctness.

CID ##1368415.
2017-01-15 12:39:15 -05:00
Zbigniew Jędrzejewski-Szmek 6fefc0eded cryptsetup: fix unitialized variable
CID #1368416.

Coverity web interface is back, yay!
2017-01-15 11:52:53 -05:00
Zbigniew Jędrzejewski-Szmek 42d768790c udev: fix variable assignment
gcc doesn't like &, even though &sbuf and buf are the same things afaiu.

Follow-up for e20a917105.
2017-01-15 11:52:53 -05:00
Lucas Werkmeister 6bae9b2abb journalctl: expunge verification key from argv (#5081)
After parsing the --verify-key argument, overwrite it with null bytes.
This minimizes (but does not completely eliminate) the time frame within
which another process on the system can extract the verification key
from the journalctl command line.
2017-01-14 23:03:00 -05:00
Zbigniew Jędrzejewski-Szmek 6b3d378331 Merge pull request #4879 from poettering/systemd 2017-01-14 21:29:27 -05:00
Mark Stosberg ab8864ebc3 man: provide a basic guide to the systemctl status output (#4950)
- Show example of all `systemctl status` output and documents what possible
   "Loaded:", "Active" and "Enabled" values mean.

 - Documents what different colors of the dot mean.

 - Documents "gotcha" with load-on-demand behavior which will report units as
   "loaded" even if they are only loaded to show their status.
   (From @poettering: https://github.com/systemd/systemd/issues/5063#issuecomment-272115024 )
2017-01-14 17:43:32 -05:00
Lennart Poettering e843b04ee9 Merge pull request #5069 from keszybz/fixlets
Small fixes and enhancements to docs and code
2017-01-12 10:19:30 +01:00
Harald Hoyer fb1baf9218 Merge pull request #5068 from keszybz/kernel-install-process-sub
kernel-install: avoid process substitution
2017-01-12 10:19:07 +01:00
Zbigniew Jędrzejewski-Szmek 13749f5473 rpm triggers: do nothing if systemd is not running (#5065)
If we are running in a chroot/container/..., we would print a useless warning about
not being able to communicate with systemd. Trying to do daemon-reload is pointless
in those cases, so let's just skip all actions in that case.

The check uses /run/system/system, as recommended by sd_booted(3).

https://bugzilla.redhat.com/show_bug.cgi?id=1411299
2017-01-12 10:16:20 +01:00
Franck Bui a69f65dd3d systemctl: remove duplicate entries showed by list-dependencies (#5049)
When a unit is part of several dependency constraints of another
unit, list-dependencies repeats the name of the dependency for each
dep constraint the unit is encountered.

For example:

 $ systemctl cat test-main.target
 # /etc/systemd/system/test-main.target
 [Unit]
 Description=Main Target

 $ systemctl cat test.target
 [Unit]
 Description=Sub target
 PartOf=test-main.target

 [Install]
 WantedBy=test-main.target

 $ systemctl enable test.target
 Created symlink from /etc/systemd/system/test-main.target.wants/test.target to /etc/systemd/system/test.target.

 $ systemctl show test-main.target | grep test.target
 Wants=test.target
 ConsistsOf=test.target
 [...]

 $ systemctl list-dependencies test-main.target
 test-main.target
 ● ├─test.target
 ● └─test.target

With this patch applied, dependencies are shown only once.
2017-01-11 21:37:15 -05:00
Zbigniew Jędrzejewski-Szmek 5aac0be024 Merge pull request #4837 from ddstreet/master
Replace spaces in expanded fields in SYMLINK properties by default.
2017-01-11 16:40:04 -05:00
Zbigniew Jędrzejewski-Szmek 9a4bf1e8d3 man: link to sd-j-{remote,upload} from journalctl(1) 2017-01-11 16:37:35 -05:00
Zbigniew Jędrzejewski-Szmek 99171d2fdf shell-completion: redirect all errors from systemctl to /dev/null
Completion scripts should not generate errors, ever.

https://bugzilla.redhat.com/show_bug.cgi?id=1409649
2017-01-11 16:37:34 -05:00
Zbigniew Jędrzejewski-Szmek 69dc692252 socket-util: drop _pure_ from a function with an output parameter
If it writes to memory, it's not pure, by definition.
Fixup for 882ac6e769.
2017-01-11 16:37:34 -05:00
Zbigniew Jędrzejewski-Szmek da3bddc993 core: add missing "=" in message
For consistency. Also drop "e.g." because it's somewhat redundant with the
ellipsis and the message is pretty long already.

Follow-up for 4d1fe20a58.
2017-01-11 16:37:34 -05:00
Zbigniew Jędrzejewski-Szmek cbd50adce0 networkd: reorder gperf fields
In eb64b435eb ActiveSlave/PrimarySlave were inserted in between
IPv6AcceptRA and IPv6AcceptRouterAdvertisements and the comment then didn't
make sense. It turns out that gperf does not understand C-style comments, and
that there's no comment syntax in the keywords section. The following was
generated:

      {"/* legacy alias for the above */"},
      {"Network.IPv6AcceptRA",                   config_parse_tristate,                          0,                             offsetof(Network, ipv6_accept_ra)},

In practice this wouldn't lead to problems because this fake pattern would be
hard to match, but it seems better to remove the comments altogether.

Readers of the .gperf file will have to look for the repeated output field to
notice legacy options. To make this easier, let's always keep the legacy option
second.
2017-01-11 16:37:13 -05:00
Michal Schmidt db1e2bfc4f kernel-install: avoid process substitution
bash implements process substitution using /dev/fd/N (this is documented
in man bash). We'd like kernel-install to work in chrooted RPM
scriptlets without /dev.

We can use here-strings instead. bash uses temporary files to implement
those.
2017-01-11 15:34:54 -05:00
Zbigniew Jędrzejewski-Szmek 374e692252 Merge pull request #5009 from ian-kelling/ian-mnt-namespace-doc 2017-01-11 15:23:00 -05:00
micah 6539dd7c42 Document how restart actions work (#5052)
When a user is trying to understand what is going on with a restart action, it is useful to explicitly describe how the action is run. It may seem obvious, but it is helpful to be explicit so one knows there isn't a special ExecRestart= or similar option that they could be looking at.
2017-01-11 15:07:35 -05:00
sammynx 07f4efcc8a hwdb: add correct metrics for Lenovo Thinkpad T430 (#5050) 2017-01-11 15:01:55 -05:00
Zbigniew Jędrzejewski-Szmek c65aafbb33 man: add more links to systemd-ask-password and systemd-tty-ask-password-agent
Loosely inspired by https://bugzilla.redhat.com/show_bug.cgi?id=1411134.
2017-01-11 12:11:42 -05:00
nikolaof fc6e082622 hwdb: update micmute YCODE on device node at DELL LATITUDE laptops for mic mute button. (#5012) 2017-01-11 14:35:20 +01:00
Lennart Poettering 84e6712f94 Merge pull request #5046 from stefanha/vsock
Add AF_VSOCK socket activation support
2017-01-11 10:53:59 +01:00
Robert Kreuzer 29b5b0c93d journal-gatewayd: align closing braces (#5060) 2017-01-11 10:50:58 +01:00
Lubomir Rintel dc66f33a16 sparse: avoid clash with __bitwise and __force from 4.10 linux/types.h (#5061)
It also used __bitwise and __force. It seems easier to rename
our versions since they are local to this one single header.

Also, undefine them afteerwards, so that we don't pollute the
preprocessor macro namespace.
2017-01-11 10:50:25 +01:00
Stefan Hajnoczi 359a5bcf78 core: add AF_VSOCK support to socket units
Accept AF_VSOCK listen addresses in socket unit files.  Both guest and
host can now take advantage of socket activation.

The QEMU guest agent has recently been modified to support socket
activation and can run over AF_VSOCK with this patch.
2017-01-10 15:29:04 +00:00
Stefan Hajnoczi 0fc0f14bfd socket-util: add AF_VSOCK address family
The AF_VSOCK address family facilitates guest<->host communication on
VMware and KVM (virtio-vsock).  Adding support to systemd allows guest
agents to be launched through .socket unit files.  Today guest agents
are stand-alone daemons running inside guests that do not take advantage
of systemd socket activation.
2017-01-10 15:29:04 +00:00
Stefan Hajnoczi 882ac6e769 socket-util: introduce port argument in sockaddr_port()
sockaddr_port() either returns a >= 0 port number or a negative errno.
This works for AF_INET and AF_INET6 because port ranges are only 16-bit.

In AF_VSOCK ports are 32-bit so an int cannot represent all port number
and negative errnos.  Separate the port and the return code.
2017-01-10 15:29:04 +00:00
Stefan Hajnoczi 4e0399e69b missing.h: add AF_VSOCK bits
Ubuntu 14.04 (Trusty) kernel header packages ship without
<linux/vm_sockets.h>.  Only struct sockaddr_vm and VMADDR_CID_ANY will
be needed by systemd and they are simple enough to go in missing.h.

CentOS 7 <sys/socket.h> does not define AF_VSOCK.  Define it so the code
can compile although actual socket(2) calls may fail at runtime if the
address family isn't available.
2017-01-10 15:27:00 +00:00
Franck Bui d13489e2be core: make sure to not call device_is_bound_by_mounts() when dev is null (#5033)
device_setup_unit() might be called (when an event happened in
/proc/self/mountinfo for example) with a null 'dev' parameter. This
indicates that the device has been unplugged but the corresponding
mountpoint is still visible in /proc/self/mountinfo.

This patch makes sure we don't call device_is_bound_by_mounts() in
this case.

Fixes: #5025
2017-01-10 09:11:34 +01:00