Commit graph

23506 commits

Author SHA1 Message Date
Lennart Poettering d1fcdcd87a sysctl: use %P instead of %p in core pattern
That way we'll get the PID on the host, rather than the one in a PID
namespace. Which should make the coredump handler less confusing.

Fixes #1930.
2015-11-17 17:32:49 +01:00
Martin Pitt 92939fc4c0 Merge pull request #1920 from teg/networkd-fixes
networkd fixes
2015-11-17 17:01:32 +01:00
Martin Pitt 0b3209b531 Merge pull request #1932 from teg/networkd-ndisc-timeout
networkd: ndisc timeout
2015-11-17 15:59:46 +01:00
Tom Gundersen 962b064729 networkd: ndisc - consider configured on timeout
Don't block indefinitely, when control has been passed on from NDisc to DHCPv6.
In this case there is likely no IPv6 support on the local link, so otherwise
this would block indefinitely.
2015-11-17 15:39:27 +01:00
Tom Gundersen c601ebf79f sd-dhcp6-client: bind to link-local address
This ensures that several DHCPv6 clients can run on separate interfaces
simultaneously.
2015-11-17 14:17:41 +01:00
Tom Gundersen fb84d8966e networkd: ndisc - fix token support
Fixes CID#1338680. Thanks to Thomas Andersen.
2015-11-17 13:26:51 +01:00
Tom Gundersen 6506063f8f sd-dhcp6-client: allow multiple clients on host
We need to enable SO_REUSEADDR in order for several sockets to be allowed
to bind to the same port (even on different links).
2015-11-17 13:26:51 +01:00
Tom Gundersen 62379e884e networkd: ndisc - always configure dhcp6 client
The ndisc client may trigger the dhcpv6 client to be started (this is the common case),
so we should allocate the dhcpv6 client whenever we allocate the ndisc one.
2015-11-17 13:26:46 +01:00
Lennart Poettering 233f353a22 Merge pull request #1909 from keszybz/filetriggers-v2
Move daemon-reload from package %post scripts to file triggers
2015-11-17 12:30:44 +01:00
Lennart Poettering e492fa402c Merge pull request #1925 from evverx/fix-pam-systemd-user
tests: copy /etc/pam.d/systemd-user from the host on Debian, Ubuntu
2015-11-17 12:16:57 +01:00
Daniel Mack a57246551a Merge pull request #1926 from phomes/include-order-libudev
tree-wide: group include of libudev.h with sd-*
2015-11-17 09:36:25 +01:00
Daniel Mack f21bb7537a Merge pull request #1927 from evverx/no-entries-in-quiet-mode
journalctl: don't print -- No entries -- in quiet mode
2015-11-17 09:34:58 +01:00
Daniel Mack bf7e619b3b Merge pull request #1924 from poettering/some-fixes-2
casting fixes, another siphash24 alignment fix, and more
2015-11-17 09:33:59 +01:00
Evgeny Vereshchagin bfcb7c5f53 journalctl: don't print -- No entries -- in quiet mode 2015-11-17 06:07:18 +00:00
Thomas Hindoe Paaboel Andersen b4bbcaa9c4 tree-wide: group include of libudev.h with sd-* 2015-11-17 07:06:08 +01:00
Lennart Poettering f1f8a5a5e1 Some additions to NEWS 2015-11-17 01:31:42 +01:00
Evgeny Vereshchagin 417491f122 tests: copy /etc/pam.d/systemd-user from the host on Debian, Ubuntu
Fixes:
systemd-testsuite systemd[34]: PAM _pam_load_conf_file: unable to open /etc/pam.d/system-auth
systemd-testsuite systemd[34]: PAM _pam_load_conf_file: unable to open /etc/pam.d/system-auth
systemd-testsuite systemd[34]: user@0.service: Failed at step PAM spawning /lib/systemd/systemd: Operation not permitted
...
on Debian, Ubuntu
2015-11-17 00:09:28 +00:00
Lennart Poettering 6059dab889 siphash: minor coding style fixes and modernizations
Only cosmetics really, doesn't change any actual logic.
2015-11-17 01:08:44 +01:00
Lennart Poettering 4de91d7eaf siphash: fix another alignment issue 2015-11-17 00:56:05 +01:00
Lennart Poettering 23e096cc60 tree-wide: make macros for converting fds to pointers and back generic and use them everywhere 2015-11-17 00:52:10 +01:00
Lennart Poettering b16fee15ff remount-fs: modernize coding style a bit
a) Use _cleanup_ where it makes sense

b) Uniformly use negative errno-style errors internally, convert to
   EXIT_FAILURE/EXIT_SUCCESS only when actually exiting.

c) Use log_oom() where appropriate

d) Fix minor memory leak in hashmap addition error path.

e) Don't pretend we could continue sensibly on OOM or fork() failure

f) Use PR_SET_PDEATHSIG to make sure clients we don't kill on error are
   cleaned up.

g) Make use of STRV_MAKE() where it's pretty to do so.

h) Simplify error paths.
2015-11-17 00:52:10 +01:00
Lennart Poettering 0c28d28834 sd-ipv4ll: fix error path if sd-ipv4acd allocation fails
Let's make sure the destructor cannot hit the n_ref == 0 case.
2015-11-17 00:52:10 +01:00
Lennart Poettering 65c1d46b09 journald: trivial simplification 2015-11-17 00:52:10 +01:00
Lennart Poettering c292d9e953 coredump: modernize error logging a bit 2015-11-17 00:52:10 +01:00
Lennart Poettering 077ba06eaa core: don't generate warnings when write access to the cgroup fs fails in --user due to EACCES
After all, in the classic hierarchy that's pretty much the default case.
2015-11-17 00:52:10 +01:00
Lennart Poettering 4a0b58c4a3 tree-wide: use right cast macros for UIDs, GIDs and PIDs 2015-11-17 00:52:10 +01:00
Lennart Poettering 357bc17975 Merge pull request #1923 from zonque/siphash
siphash24: let siphash24_finalize() and siphash24() return the result…
2015-11-17 00:32:06 +01:00
Daniel Mack 8702319e11 Merge pull request #1922 from phomes/sort-includes
Sort includes
2015-11-16 23:41:22 +01:00
Daniel Mack 933f9caeeb siphash24: let siphash24_finalize() and siphash24() return the result directly
Rather than passing a pointer to return the result, return it directly
from the function calls.

Also, return the result in native endianess, and let the callers care
about the conversion. For hash tables and bloom filters, we don't care,
but in order to keep MAC addresses and DHCP client IDs stable, we
explicitly convert to LE.
2015-11-16 23:17:52 +01:00
Thomas Hindoe Paaboel Andersen cf0fbc49e6 tree-wide: sort includes
Sort the includes accoding to the new coding style.
2015-11-16 22:09:36 +01:00
Thomas Hindoe Paaboel Andersen ab5dfda78f tree-wide: add missing includes
Add a few includes that we rely on to be include already.
2015-11-16 22:08:33 +01:00
Tom Gundersen 63348d13fa networkd: ndisc/dhcpv6 - handle starting running clients
The clients may be triggered to be started repeatedly without being stopped first,
simply swallow the error rather than failing the link.
2015-11-16 19:14:22 +01:00
David Herrmann 5cd6491b71 Merge pull request #1919 from martinpitt/master
siphash42: add tests with unaligned input pointers
2015-11-16 16:47:07 +01:00
David Herrmann f7eb988333 Merge pull request #1918 from dvdhrm/user3
login: allow re-using users (v3)
2015-11-16 16:28:25 +01:00
Martin Pitt 69b98e71b4 siphash42: add tests with unaligned input pointers
Add test case for calling siphash24 with unaligned input pointers, as we
commonly get with calling it on the result on basename() or similar.

This provides a test for PR #1916, rescued from the superseded PR #1911.

Thanks to Steve Langasek for the test!
2015-11-16 16:24:56 +01:00
David Herrmann 2f157acdae login: ignore JobRemoved of old jobs
If we requeue jobs, we are no longer interested in old jobs. Hence, we
better ignore any JobRemoved signals for old jobs and concentrate on our
replacements.
2015-11-16 16:15:42 +01:00
Tom Gundersen f5ed8d4a51 Merge pull request #1916 from zonque/align
siphash: alignment
2015-11-16 15:50:13 +01:00
David Herrmann 920a726221 Merge pull request #1915 from poettering/btrfs-root-subvol
tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subv…
2015-11-16 15:48:21 +01:00
David Herrmann 79ee4ad108 login: make sure to replace existing units
When queuing unit jobs, we should rather replace existing units than
fail. This is especially important when we queued a user-shutdown and a
new login is encountered. In this case, we better raplce the shutdown
jobs. systemd takes care of everything else.
2015-11-16 15:43:18 +01:00
David Herrmann a832ab6f99 login: fix re-use of users
If the last reference to a user is released, we queue stop-jobs for the
user-service and slice. Only once those are finished, we drop the
user-object. However, if a new session is opened before the user object is
fully dropped, we currently incorrectly re-use the object. This has the
effect, that we get stale sessions without a valid "systemd --user"
instance.

Fix this by properly allowing user_start() to be called, even if
user->stopping is true.
2015-11-16 15:34:41 +01:00
David Herrmann 090d92bd6f login: group static fields in "struct User"
Make sure to put static fields together in "struct User". This makes it
easier to figure out the lifetime of each field.
2015-11-16 15:34:41 +01:00
David Herrmann b690ef12b5 login: make user->service static
Just like user->slice, there is no reason to store the unit name in /run,
nor should we allocate it dynamically on job instantiation/removal. Just
keep it statically around at all times and rely on user->started ||
user->stopping to figure out whether the unit exists or not.
2015-11-16 15:34:41 +01:00
David Herrmann 157f50577f login: make user_new() and user_free() follow coding-style
Few changes to user_new() and user_free():
 - Use _cleanup_(user_freep) in constructor
 - return 'int' from user_new()
 - make user_free() deal with partially initialized objects
 - keep reverse-order in user_free() compared to user_new()
 - make user_free() return NULL
 - make user_free() accept NULL as no-op
2015-11-16 15:34:41 +01:00
David Herrmann 6230bf750a login: keep user->slice constant
Currently, we allocate user->slice when starting a slice, but we never
release it. This is incompatible if we want to re-use a user object once
it was stopped. Hence, make sure user->slice is allocated statically on
the user object and use "u->started || u->stopping" as an indication
whether the slice is actually available on pid1 or not.
2015-11-16 15:34:41 +01:00
David Herrmann f9e4283df3 login: simply XDG_RUNTIME_DIR management
Lets not pretend we support changing XDG_RUNTIME_DIR via logind state
files. There is no reason to ever write the string into /run, as we
allocate it statically based on the UID, anyway. Lets stop that and just
allocate the runtime_path in "struct User" at all times.

We keep writing it into the /run state to make sure pam_systemd of
previous installs can still read it. However, pam_systemd is now fixed to
allocate it statically as well, so we can safely remove that some time in
the future.

Last but not least: If software depends on systemd, they're more than free
to assume /run/user/$uid is their runtime dir. Lets not require sane
applications to query the environment to get their runtime dir. As long as
applications know their login-UID, they should be safe to deduce the
runtime dir.
2015-11-16 15:34:36 +01:00
Lennart Poettering 2904e949f2 tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subvolume
It's not a good idea to create subvolumes for parts of the OS tree (such
as /home, or /var) if the root directory is not a subvolume too. We
shouldn't assume control of "heavier" objects such as subvolumes, if the
originating object (the root directory) is a "light-weight" object, i.e.
a plain directory.

Effectively this means that chroot() environments that are run on a
plain directory do not have to deal with problems around systemd
creating subvolumes that cannot be removed with a simple "rm" anymore.
However, if the chroot manager creates a proper subvolume for such an
environment it will also get further subvolumes placed in there, under
the assumption that the manager understands the concept of subvolumes in
that case.
2015-11-16 15:25:42 +01:00
Martin Pitt dbe81cbd2a siphash24: change result argument to uint64_t
Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which
enforce pointer alignment this fixes crashes when we previously cast an
unaligned array to uint64_t*, and on others this should at least improve
performance as the compiler now aligns these properly.

This also simplifies the code in most cases by getting rid of typecasts. The
only place which we can't change is struct duid's en.id, as that is _packed_
and public API, so we can't enforce alignment of the "id" field and have to
use memcpy instead.
2015-11-16 15:20:29 +01:00
Daniel Mack 8dd85afe76 siphash24: fix memory alignment
Use unaligned_read_le64() to access input buffer when reading complete
64-bit words.

This should fix memory traps on platforms with strict aliasing.
2015-11-16 15:19:23 +01:00
Daniel Mack 7f034e980d basic: add unaligned macros for little endian
Also add test code for that.
2015-11-16 15:13:33 +01:00
David Herrmann 44690833df Merge pull request #1886 from poettering/tasks-max
Enable TasksMax by default for all units
2015-11-16 15:09:55 +01:00