Commit graph

30023 commits

Author SHA1 Message Date
Daniel Mack 71e5200f94 Add abstraction model for BPF programs
This object takes a number of bpf_insn members and wraps them together with
the in-kernel reference id. Will be needed by the firewall code.
2017-09-22 15:24:54 +02:00
Daniel Mack 3f0c2342c0 build-sys: add new kernel bpf.h drop-in
The defines we need are pretty comprehensive and new, hence copy in the
full header from the kernel.
2017-09-22 15:24:54 +02:00
Lennart Poettering f4912f3a74 in-addr-util: add new helper call in_addr_prefix_from_string_auto()
This is much like in_addr_prefix_from_string(), but automatically
determines whether IPv4 or IPv6 addresses are specified. Also adds a
test for it.
2017-09-22 15:24:54 +02:00
Lennart Poettering 4e2d527361 in-addr-util: prefix return parameters with ret_ 2017-09-22 15:24:54 +02:00
Lennart Poettering 5a941f5f21 in-addr-util: be more systematic with naming our functions
Let's rename all our functions that process IPv4 in_addr structures
in4_addr_xyz(), following the already establishing naming logic for
this.

Leave the in_addr_xyz() prefix for functions that process the IPv4/IPv6
in_addr_union union instead.
2017-09-22 15:24:54 +02:00
Lennart Poettering bd389aa734 manager: initialize timeouts when allocating a naked Manager object
This way we can safely run manager objects from tests and good timeouts
apply. Without this all timeouts are set 0, which means they fire
instantly, when run from tests which do not explicitly configure them
(the way main.c does).
2017-09-22 15:24:54 +02:00
Lennart Poettering 10bd3e2e4c manager: watching the cgroup2 inotify fd is safe in test runs too
Less deviation between test runs and normal runs is always a good idea,
hence enable more stuff that is safe in test runs
2017-09-22 15:24:54 +02:00
Lennart Poettering 7cce4fb7f7 cgroup: always invalidate "cpu" and "cpuacct" together
This doesn't really matter, as we never invalidate cpuacct explicitly,
and there's no real reason to care for it explicitly, however it's
prettier if we always treat cpu and cpuacct as belonging together, the
same way we conisder "io" and "blkio" to belong together.
2017-09-22 15:24:54 +02:00
Lennart Poettering 8b238b13b1 cgroup-util: minor coding style adjustment 2017-09-22 15:24:54 +02:00
Lennart Poettering 18f573aaf9 core: make sure to dump cgroup context when unit_dump() is called for all unit types
For some reason we didn't dump the cgroup context for a number of unit
types, including service units. Not sure how this wasn't noticed
before... Add this in.
2017-09-22 15:24:54 +02:00
Lennart Poettering ec20fe5ffb journald: make maximum size of stream log lines configurable and bump it to 48K (#6838)
This adds a new setting LineMax= to journald.conf, and sets it by
default to 48K. When we convert stream-based stdout/stderr logging into
record-based log entries, read up to the specified amount of bytes
before forcing a line-break.

This also makes three related changes:

- When a NUL byte is read we'll not recognize this as alternative line
  break, instead of silently dropping everything after it. (see #4863)

- The reason for a line-break is now encoded in the log record, if it
  wasn't a plain newline. Specifically, we distuingish "nul",
  "line-max" and "eof", for line breaks due to NUL byte, due to the
  maximum line length as configured with LineMax= or due to end of
  stream. This data is stored in the new implicit _LINE_BREAK= field.
  It's not synthesized for plain \n line breaks.

- A randomized 128bit ID is assigned to each log stream.

With these three changes in place it's (mostly) possible to reconstruct
the original byte streams from log data, as (most) of the context of
the conversion from the byte stream to log records is saved now. (So,
the only bits we still drop are empty lines. Which might be something to
look into in a future change, and which is outside of the scope of this
work)

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=86465
See: #4863
Replaces: #4875
2017-09-22 10:22:24 +02:00
Lennart Poettering d82611c918 Merge pull request #6853 from sourcejedi/GetAll
sd-bus: fix response for GetAll on non-existent objects
2017-09-21 21:41:55 +02:00
Zbigniew Jędrzejewski-Szmek a4041e4f68 Link to the right glibc commit in comment (#6884)
Reported by Marcos Mello.

Fixes #6882.
2017-09-21 20:54:16 +02:00
Jan Synacek f679ed6116 execute: fix typo in error message (#6881) 2017-09-21 10:38:52 +02:00
Lennart Poettering 70b089d7dc Merge pull request #6847 from keszybz/disable-enable-generators
Disable and optionally again enable generators in test mode
2017-09-20 19:51:44 +02:00
Zbigniew Jędrzejewski-Szmek 23115a607e path-lookup: fix minor memleak
Introduced in a1f31f4715.
2017-09-19 20:14:22 +02:00
Zbigniew Jędrzejewski-Szmek 641c0fd14e analyze-verify: add --generators switch to enable generators again 2017-09-19 20:14:22 +02:00
Zbigniew Jędrzejewski-Szmek e0a3da1fd2 Make test_run into a flags field and disable generators again
Now generators are only run in systemd --test mode, where this makes
most sense (how are you going to test what would happen otherwise?).

Fixes #6842.

v2:
- rename test_run to test_run_flags
2017-09-19 20:14:05 +02:00
Susant Sahani 983226f35a networkd: route - support unicast,blackhole,unreachable and prohibited (#6861)
Resolves issues #797 and #967.

Conf

```
[Route]
Type=blackhole
Destination=202.54.1.2
```

ip route

```
blackhole 202.54.1.2 proto static
2017-09-19 16:28:26 +02:00
Michael Biebl 6349cda20f tests: change dbus tests to use user bus (#6845)
This makes it possible to run more dbus tests in a build
environment/chroot where no system bus is available.
To run the dbus test one then can use dbus-run-session.
2017-09-19 14:17:57 +02:00
Ivan Kurnosov 54d3be9772 Added docs for new timezone support added at #6788 (#6865) 2017-09-19 11:23:34 +02:00
Susant Sahani ffa69a04be systemd-link: Add support to configure tx-tcp6-segmentation (#6859)
closes #6854

tcp-segmentation-offload: off
	tx-tcp-segmentation: off
	tx-tcp-ecn-segmentation: off [fixed]
	tx-tcp-mangleid-segmentation: off
	tx-tcp6-segmentation: off <==========================
2017-09-19 10:49:58 +02:00
Lennart Poettering c9f7fb0f3c Merge pull request #6855 from keszybz/more-docs
More docs
2017-09-19 10:38:40 +02:00
Dimitri John Ledkov 22043e4317 networkd: change UseMTU default to true. (#6837)
Typically when DHCP server sets MTU it is a lower one. And a lower than usual
MTU is then thus required on said network to have operational networking. This
makes networkd's dhcp client to work in more similar way to other dhcp-clients
(e.g. isc-dhcp). In particular, in a cloud setting, without this default
instances have resulted in timing out talking to cloud metadata source and
failing to provision.

This does not change this default for the Annonymize code path.
2017-09-19 10:26:17 +02:00
Zbigniew Jędrzejewski-Szmek f2adcd22d5 build-sys: bump xslt maxdepth limit (#6863)
With libxslt-1.30, builds were failing on some recursion depth limit
with systemd.index.xml. Bumping the limit fixes the issue.
2017-09-19 15:04:02 +09:00
Ansgar Burchardt e80f1a7928 typo: chache → cache (#6864) 2017-09-19 06:48:09 +02:00
Alan Jenkins 6cc9a5bf42 man/systemd.special: correct what slices.target pulls in (#6862) 2017-09-18 17:43:19 +02:00
Patrik Flykt f9aa5417d1 sd-radv: Free DNS domain search list on unref (#6858) 2017-09-18 12:09:44 +02:00
Evgeny Vereshchagin 06d92f88d3 Merge pull request #6851 from keszybz/fix-masking-with-empty-files
Fix masking with empty files
2017-09-18 00:07:12 +03:00
Zbigniew Jędrzejewski-Szmek f66137fb67 test-exec-util: add two test cases for scripts masked with empty file
A test for #6831. Fails without the previous commit.

Suggested by Evgeny Vereshchagin.
2017-09-17 21:22:39 +02:00
Zbigniew Jędrzejewski-Szmek 6a4643517b conf-files: fix check for masking with empty files
Fixes #6831.
2017-09-17 21:22:39 +02:00
Zbigniew Jędrzejewski-Szmek f8f1e666a6 man: describe user@host:machine syntax
Fixes #6734.
2017-09-17 21:08:56 +02:00
Zbigniew Jędrzejewski-Szmek 9610fb3814 man: update limits on seat and session identifiers in sd-login(3)
For the session identifier, the code is currently slightly stricter, because it
only uses digits and letters, than the description. This should be OK.

Fixes #6745.
2017-09-17 21:08:56 +02:00
Zbigniew Jędrzejewski-Szmek 0ae42c9b7a man: import "Multi-Seat on Linux" into sd-login(3)
The document on the wiki is partially outdated and not very visible.  Let's
import the gist of it here. The original text is retained, with only grammar
and stylistic and formatting changes.
2017-09-17 21:08:56 +02:00
Alan Jenkins 00590f8268 sd-bus: style nitpick node_vtable_get_userdata()
It's confusing to use a single void* to store data with two different
types, i.e. a userdata value which is safe to pass to ->find(), and a
userdata value which identifies the found object.

Name the latter `found_u`.  This naming treats (!c->find) as a degenerate
case.  (I.e. at that point, we know the object has already been found :).
2017-09-17 17:55:01 +01:00
Alan Jenkins 733e792bc6 sd-bus: fix response for GetAll on non-existent objects
Before this commit, if you run `loginctl user-status` from
debug-shell.service (and you have no login sessions for root), you always
see this output:

0
	Linger: no

because Properties.GetAll is returning success but without any properties,
when the only find() callback had returned 0 to mean "no object found".

After:

Could not get properties: Unknown object:
'/org/freedesktop/login1/user/self'


BTW I have a fix for more user-friendly messages from logind in this case.
It is pending in my local branch for #6829 "fix `loginctl enable-linger`".
2017-09-17 17:54:54 +01:00
Zbigniew Jędrzejewski-Szmek 7db3d9fe9b Merge pull request #6788 from zerkms/TIMER_TIMEZONE
Timezone support for timers
2017-09-17 15:05:35 +02:00
Ivan Kurnosov 2e72b79459 Fix for dst/non-dst timezones
The problem was with the tm.tm_isdst that is set to the current environment
value: either DST or not. While the current state is not relevant to the state
in the desired date.

Hence — it should be reset so that the mktime_or_timegm could normalise it
later.
2017-09-17 13:49:14 +02:00
Lennart Poettering 88ab4a68cc Merge pull request #6846 from keszybz/fix-udev_event_apply_format
Fix udev_event_apply_format()
2017-09-17 12:04:21 +02:00
Zbigniew Jędrzejewski-Szmek a3da4a3d0a test-date: add more logging on error 2017-09-17 11:57:00 +02:00
Lennart Poettering 27cb01b0f0 Merge pull request #6840 from keszybz/more-docs
Some more documentation updates
2017-09-17 11:56:24 +02:00
Zbigniew Jędrzejewski-Szmek a2932a0d1a Simplify the if cases for timezone checking
Just to reduce the indentation a bit.
2017-09-17 09:42:20 +02:00
Ivan Kurnosov 48d26c0164 Added timezone to the CalendarSpec, parser/formatter and the timedatectl 2017-09-17 09:42:20 +02:00
Zbigniew Jędrzejewski-Szmek 61ceaea5c8 Move one space from dbus-execute.c to execute.c
The number of spaces is conserved ;)
2017-09-16 08:45:02 +02:00
Zbigniew Jędrzejewski-Szmek 79a695f24f udev: fix buffer overflow in udev_event_apply_format()
Fixes #6664.
2017-09-16 08:43:26 +02:00
Christian Hesse d75b31837c fix path in btrfs rule (#6844)
Commit 0e8856d2 (assemble multidevice btrfs volumes without external
tools (#6607)) introduced a call to udevadm. That lives in @rootbindir@,
not @rootlibexecdir@. So fix the path.
2017-09-15 21:28:24 +02:00
Zbigniew Jędrzejewski-Szmek 3d7d3cbbda Merge pull request #6832 from poettering/keyring-mode
Add KeyringMode unit property to fix cryptsetup key caching
2017-09-15 21:24:48 +02:00
Zbigniew Jędrzejewski-Szmek a52c016265 Merge pull request #6841 from poettering/doc-exit-codes
document exit codes
2017-09-15 17:26:35 +02:00
Zbigniew Jędrzejewski-Szmek 1245e4132b man: use "filename" not "file name" by default
We settled on "filename" and "file system", so change a couple of places for
consistency. The exception is when there's an adjective before "file" that
binds more strongly then "name": "password file name", "output file name", etc.
Those cases are left intact.
2017-09-15 17:18:29 +02:00
Russell Stuart cd9363b11c man: update udevadm -y/--sysname-match documentation
Fixes #6792.

[zj: reorganize the sentece for grammatical correctness.]
2017-09-15 17:18:29 +02:00