1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 10:51:20 +03:00
Commit Graph

17953 Commits

Author SHA1 Message Date
Lennart Poettering
64e96a194d bus-proxy: check passed parameter signature of all driver method calls 2014-11-27 21:58:07 +01:00
Alin Rauta
be660c371b networkd: fix kernel rtnl receive buffer overrun error
We got the following error when running systemd on a device  with many ports:

"rtnl: kernel receive buffer overrun
Event source 'rtnl-receive-message' returned error, disabling: No buffer space
available"

I think the kernel socket receive buffer queue should be increased. The default
value is taken from:
"/proc/sys/net/core/rmem_default", but we can overwrite it using SO_RCVBUF
socket option.

This is already done in networkd for other sockets.
For example, the bus socket (sd-bus/bus-socket.c) has a receive queue of 8MB.
In our case, the default is 208KB.

Increasing the buffer receive queue for manager socket to 512KB should be enough
to get rid of the above error.

[tomegun: bump the limit even higher to 8M]
2014-11-27 18:59:47 +01:00
Stanisław Pitucha
0e3434aeb1 resolve: reject empty TXT records
TXT records should have at least one character, so enforce this.

Before 0f84a72 parser SIGSEGV'd on ->txt.strings being NULL, but
even if this is fixed we should reject invalid TXT records.
2014-11-27 11:07:43 -05:00
Stanisław Pitucha
59aa582137 resolve: set error code on failure
Set the error code in case of incorrect name. This prevents continuing
and failing an assert(name) later on.
2014-11-27 16:40:11 +01:00
Stanisław Pitucha
c75dbf9bea resolve: fix redirection loops in compressed RR
Loops in RR compression were only detected for the first entry.
Multiple redirections should be allowed, each one checking for an
infinite loop on its own starting point.
Also update the pointer on each redirection to avoid longer loops of
labels and redirections, in names like:
(start) [len=1] "A", [ptr to start]

(David: rename variable to "jump_barrier" and add reference to RFC)
2014-11-27 16:35:56 +01:00
Michal Schmidt
c21b92ffe7 core: fix transaction destructiveness check once more
The previous fix e0312f4db "core: fix check for transaction
destructiveness" broke test-engine (noticed by Zbyszek).
Apparently I had a wrong idea of the intended semantics of --fail.

The manpage says the operation should fail if it "conflicts with a
pending job (more specifically: causes an already pending start job to
be reversed into a stop job or vice versa)".

So let's check job_type_is_conflicting, instead of !is_superset.

This makes both test-engine and TEST-03-JOBS pass again.
2014-11-27 16:14:58 +01:00
David Herrmann
0f84a72e3c resolve: fix NULL deref on strv comparison
A strv might be NULL if it is empty. The txt.strings comparison doesn't
take that into account. Introduce strv_equal() to provide a proper helper
for this and fix resolve to use it.

Thanks to Stanisław Pitucha <viraptor@gmail.com> for reporting this!
2014-11-27 16:10:44 +01:00
David Herrmann
342f3005f5 bus: prefix custom endpoints with "$UID-"
The kdbus module will later get a policy that endpoint-names are
restricted to "<uid>-<name>" just like bus-names. Make sure that systemd
is already compatible to that.
2014-11-27 13:49:41 +01:00
Peter Hutterer
0213a26f65 hwdb: add a new db for the DPI/frequency settings of mice
Pointer acceleration for relative input devices (mice, trackballs, etc.)
applies to the deltas of the device. Alas, those deltas have no physical
reference point - a delta of 10 may be caused by a large movement of a
low-dpi mouse or by a minute movement of a high-dpi mouse.
Which makes pointer acceleration a bit useless and high-dpi devices
essentially unusable.

In an ideal world, we could read the DPI from the device directly and work
with that. In the world we actually live in, we need to compile this list
manually. This patch introduces the database, with the usual match formats
and a single property to be set on a device: MOUSE_DPI

That is either a single value for most mice, or a list of values for mice
that can change resolution at runtime. The exact format is detailed in the
hwdb file.

Note that we're explicitly overshooting the requirements we have for
libinput atm. Frequency could be detected in software and we don't
actually use the list of multiple resolutions (because we can't detect
when they change anyway). However, we might as well collect those values
from the get-go, adding/modifying what will eventually amount to hundreds
of entries is a bit cumbersome.

Note: we rely on the input_id builtin to tag us as mouse first, ordering
of the rules is important.

(David: fixed up typos and moved hwdb file into ./hwdb/)
2014-11-27 12:30:08 +01:00
Ivan Shapovalov
0c124f8b2c unit-name: fix escaping logic in unit_name_mangle_with_suffix()
Make screened character set consistent with unit_name_mangle() by splitting off
the escaping loop into a separate function.

Before this fix, unit names such as `foo@bar.target` would get transformed
into `foo\x40bar.target` when unit_name_mangle_with_suffix() is used.

https://bugs.freedesktop.org/show_bug.cgi?id=86711
2014-11-27 00:24:53 -05:00
Zbigniew Jędrzejewski-Szmek
59059b4a07 coredump: use openat 2014-11-27 00:24:53 -05:00
Andrej Manduch
70af7b8ada journalctl: print all possible lines immediately with --follow + --since
When I tryed to run journalctl with --follow and --since arguments it
behaved very strangely.
First It prints logs from what I specified in --since argument, then
printed 10 lines (as is default in --follow) and when app put something
new in to log journalctl printed everithing from the last printed line.

How to reproduce:
1. run: journalctl -m --since 14:00 --follow
Then you'll see 10 lines of logs since 14:00. After that wait until some
app add something in the journal or just run `systemd-cat echo test`
2. After that journalctl will print every single line since 14:00 and will
follow as expected.

As long as --since and --follow will eventually print all relevant
lines, I seen no reason why not to print them right away and not after
first new message in journal.

Relevant bugzillas:
        https://bugs.freedesktop.org/show_bug.cgi?id=71546
        https://bugs.freedesktop.org/show_bug.cgi?id=64291
2014-11-27 00:24:52 -05:00
Jakub Filak
3f132692e3 coredump: collect all /proc data useful for bug reporting
/proc/[pid]:
- status
- maps
- limits
- cgroup
- cwd
- root
- environ
- fd/ & fdinfo/ joined in open_fds
2014-11-27 00:24:52 -05:00
Jakub Filak
c593bb360e util: add function getting proc environ
On the contrary of env, the added function returns all characters
cescaped, because it improves reproducibility.
2014-11-27 00:24:52 -05:00
Gavin Li
59580681f5 networkd: route - allow routes without a gateway
For IPv6, the kernel returns EINVAL if a route is added with the
RTA_GATEWAY attribute set to in6addr_any (::). A route without a
gateway is useful in some situations, such as layer 3 tunneling
(sit, gre, etc.).

This patch prevents the RTA_GATEWAY attribute from being added
when route.in_addr is ip6addr_any (::).
2014-11-27 00:24:52 -05:00
Łukasz Stelmach
bedd083aae build-sys: do not install tmpfiles and sysusers files by default 2014-11-27 00:24:52 -05:00
Sean Young
7b6288914b timesyncd: do not keep listening socket open forever
This also makes the source port less predicatable.
2014-11-27 00:24:52 -05:00
Josh Triplett
e846102353 logind: Support logind.conf.d directories in the usual search paths
This makes it possible to drop in logind configuration snippets from a
package or other configuration management mechanism.

Add documentation to the header of /etc/logind.conf pointing the user at
/etc/logind.conf.d/*.conf.

Introduce a new helper, conf_parse_many, to parse configuration files in
a search path.
2014-11-26 19:11:37 -05:00
Josh Triplett
7f0a55d432 Introduce CONF_DIRS_NULSTR helper to define standard conf dirs
Several different systemd tools define a nulstr containing a standard
series of configuration file directories, in /etc, /run, /usr/local/lib,
/usr/lib, and (#ifdef HAVE_SPLIT_USR) /lib.  Factor that logic out into
a new helper macro, CONF_DIRS_NULSTR.
2014-11-26 19:11:37 -05:00
Zbigniew Jędrzejewski-Szmek
3d82301321 journald: proceed even if some sockets are unknown
systemd-journald would refuse to start if it received an unknown
socket from systemd. This is annoying, because the failure more for
systemd-journald is unpleasant: systemd will keep restarting journald,
but most likely the same error will occur every time. It is better
to continue. journald will try to open missing sockets on its own,
so things should mostly work.

One question is whether to close the sockets which cannot be parsed or
to keep them open. Either way we might lose some messages. This
failure is most likely for the audit socket (selinux issues), which
can be opened multiple times so this not a problem, so I decided to
keep them open because it makes it easier to debug the issue after the
system is fully started.
2014-11-26 15:17:07 -05:00
Zbigniew Jędrzejewski-Szmek
5607d856b8 swap: restore support for nofail
systemd stops adding automatic dependencies on swap.target to swap
units. If a dependency is required, it has to be added by unit
configuration. fstab-generator did that already, except that now it is
modified to create a Requires or Wants type dependency, depending on
whether nofail is specified in /etc/fstab. This makes .swap units
obey the nofail/noauto options more or less the same as .mount units.

Documentation is extended to clarify that, and to make
systemd.mount(5) and system.swap(5) more similar. The gist is not
changed, because current behaviour actually matches existing
documentation.

https://bugs.freedesktop.org/show_bug.cgi?id=86488
2014-11-26 15:17:07 -05:00
Zbigniew Jędrzejewski-Szmek
cb6531bee6 manager: print fatal errors on the console too
When booting in quiet mode, fatal messages would not be shown at all to the user.

https://bugzilla.redhat.com/show_bug.cgi?id=1155468
2014-11-26 15:17:07 -05:00
Zbigniew Jędrzejewski-Szmek
4104970ef7 manager: log some fatal errors at emergency level
This adds a new log_emergency() function, which is equivalent to
log_error() for non-PID-1, and logs at the highest priority for PID 1.
Some messages which occur before freezing are converted to use it.
2014-11-26 15:16:53 -05:00
Lennart Poettering
278ebf8d26 bus-policy: actually test messages against the newly added test.conf 2014-11-26 21:15:39 +01:00
Lennart Poettering
55e189007c bus-policy: also add in other bus policy tests from dbus1
dbus1 only checks if these files parse correctly so let's do the same for now.
2014-11-26 20:58:34 +01:00
Lennart Poettering
3a9cca1104 bus-policy: steal a test case for prefix ownership from dbus1, and make sure it passes with the bus proxy enforcement 2014-11-26 20:22:22 +01:00
Lennart Poettering
cf226cfc24 sd-bus: make sure that when we connect to the system bus we have enough creds to make security decisions 2014-11-26 18:59:31 +01:00
Lennart Poettering
8fd0019380 core: make sure we have enough information when doing selinux decisions
Let's ask for the security relevant bits in a race-free way, and augment
the rest from /proc.
2014-11-26 18:57:39 +01:00
Lennart Poettering
6dae84cbdd update TODO 2014-11-26 17:27:59 +01:00
Lennart Poettering
dcc2fc01fa sd-bus: update peeking into receieved messages, with recent kernel change we need to FREE them after all 2014-11-26 17:27:59 +01:00
Michal Schmidt
e0312f4db0 core: fix check for transaction destructiveness
When checking if the transaction is destructive, we need to check if the
previously installed job is a superset of the new job (and hence the new
job will fold into the installed one without changing it), not the other
way around.
2014-11-26 16:33:46 +01:00
Michal Schmidt
61da906a74 core: drop now-redundant special-casing of JOB_NOP
job_type_is_conflicting(X, JOB_NOP) correctly gives: false.

job_type_allows_late_merge(JOB_NOP) && job_type_is_superset(X, JOB_NOP)
correctly gives: true.
2014-11-26 16:33:45 +01:00
Michal Schmidt
7e803f5ecf core: fix assertion failure in checking a transaction with a JOB_NOP
Several functions called from transaction_activate() need to correctly
handle the case where a JOB_NOP job is being checked against a unit's
pending job. The assumption that JOB_NOP never merges with other job
types was correct, but since the job_type_is_*() functions are
implemented using the merge lookup, they need to special-case JOB_NOP
to avoid hitting assertion failures.
2014-11-26 16:33:43 +01:00
Michal Schmidt
06c1c4f98c test: add test for crash when adding a JOB_NOP 2014-11-26 16:33:40 +01:00
Lennart Poettering
d108ddf172 sd-bus: update kdbus.h from upstream 2014-11-26 15:43:50 +01:00
Lennart Poettering
68d4c45263 core: reindent mount/kmod tables 2014-11-26 15:43:20 +01:00
Lennart Poettering
0ad68f8743 update TODO 2014-11-26 15:42:54 +01:00
Lennart Poettering
7212c6083a update TODO 2014-11-26 15:01:50 +01:00
Lennart Poettering
e12d81ae80 sd-bus: given that the kernel now passes the auxgroups list as 32bit array to us, no need to convert to uid_t manually
This way, we can save one allocation and avoid copying the array
unnecesarily.
2014-11-26 14:59:12 +01:00
Lennart Poettering
8514b67754 update TODO 2014-11-26 14:14:17 +01:00
Lennart Poettering
b568ef14a7 update TODO 2014-11-26 12:11:39 +01:00
David Herrmann
affc7fe9e1 bus: update kdbus.h (ABI break)
We changed creds to u32, so fix systemd sd-bus to acknowledge that.
2014-11-26 11:11:54 +01:00
Lennart Poettering
279f036675 reorder TODO a bit 2014-11-26 03:23:48 +01:00
Zbigniew Jędrzejewski-Szmek
80877656a5 udevadm trigger: allow matching by device name
This makes udevadm trigger mirror udevadm info, except that multiple
device names can be specified. Instructions in 60-keyboard.hwdb should
now actually work.

udevadm(8) is updated, but it could use a bit more polishing.

https://bugs.freedesktop.org/show_bug.cgi?id=82311
2014-11-25 21:16:47 -05:00
Zbigniew Jędrzejewski-Szmek
d6170d27b2 udevadm: split out find_device helper
The idea is to unify the way that devices can be specified.
2014-11-25 21:16:47 -05:00
Lennart Poettering
6c78f43c7b update TODO 2014-11-26 03:06:50 +01:00
Lennart Poettering
38813cc824 bus-kernel: when installing an activator, ask for any kind of metadata to be attached to incoming messages
We don't know what the activated service might want in the end, hence
enable everything current and future, just to be sure.
2014-11-26 03:06:50 +01:00
Lennart Poettering
8aee3fc7ea sd-bus: don't clobber return values on failure in bus_kernel_open_bus_fd() 2014-11-26 03:06:50 +01:00
Lennart Poettering
fa7796e97b sd-bus: set per-bus attach flag requirement mask to ANY
On the system and user busses we create it's the receiver that chooses
which metadata is attched, not the sender, hence set the requirement
mask to ANY, to allow any current of future credential bit to be
attached.
2014-11-26 03:06:50 +01:00
Lennart Poettering
1dfac061ce update TODO 2014-11-26 02:21:15 +01:00