1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 11:55:44 +03:00
Commit Graph

26079 Commits

Author SHA1 Message Date
Zbigniew Jędrzejewski-Szmek
b27b4b51c6 tree-wide: remove newlines from unit_write_drop_in
This reverts part of #3329, but all for a good cause.
2016-05-28 16:29:42 -04:00
Zbigniew Jędrzejewski-Szmek
2a9a6f8ac0 core/unit: append newline when writing drop ins
unit_write_drop_in{,_private}{,_format} are all affected.

We already append a header to the file (and section markers), so those functions
can only be used to write a whole file at once. Including the newline at
the end feels natural.

After this commit newlines will be duplicated. They will be removed in
subsequent commit.

Also, rewrap the "autogenerated" header to fit within 80 columns.
2016-05-28 16:17:54 -04:00
Zbigniew Jędrzejewski-Szmek
662c7e5073 Merge pull request #3326 from tomty89/update-2
networkd: IPv6 fixes
2016-05-28 15:28:51 -04:00
Zbigniew Jędrzejewski-Szmek
ccf1c70800 Merge pull request #3360 from glaubitz/master
Fix multiple unaligned accesses in test-dns-packet and sd-dhcp-server.
2016-05-28 15:02:05 -04:00
Zbigniew Jędrzejewski-Szmek
0053598f36 Typo fix: s/advertisment/advertisement/ 2016-05-28 11:50:37 -04:00
Zbigniew Jędrzejewski-Szmek
be8386a3e5 systemctl: remove empty line between comment and action
It's harder to miss the comment without the newline ;)
See https://github.com/systemd/systemd/pull/3336#issuecomment-221749423
for context.
2016-05-28 11:48:59 -04:00
Zbigniew Jędrzejewski-Szmek
16690d0e15 Merge pull request #3328 from poettering/ipv4ll-ipv4acd-fixes
various sd-Ipv4ll/sd-ipv4acd fixes
2016-05-28 11:48:37 -04:00
Zbigniew Jędrzejewski-Szmek
6f79340136 Merge pull request #3336 from eworm-de/systemctl-set-default
systemctl: return success for set-default, add-wants, add-requires...
2016-05-28 10:52:06 -04:00
Michael Biebl
ac3608cdbc login: Fix policy for org.freedesktop.login1.set-self-linger (#3365) (#3373)
We need to explicitly define authorizations for allow_inactive and
allow_active. Otherwise one is getting "Access denied" when run from a
local console:

$ loginctl enable-linger
Could not enable linger: Access denied
2016-05-28 11:03:03 +02:00
Tom Yan
2b00a4e03d networkd: disable IPv6 for bridge slave
If an interface is managed as a bridge slave, we don't want any IP configuration for it. Therefore, disable IPv6 in such case.
2016-05-28 13:35:01 +08:00
Tom Yan
2b2d8603ce networkd: unset master if not enslaved with networkd
When we manage an interface with networkd but not as a slave (i.e. no `Bridge=` or `Bond=` set in its .network), we do not want it to remain slaved.
2016-05-28 13:31:41 +08:00
John Paul Adrian Glaubitz
9ae8424410 networkd/sd-dhcp-server: Fix unaligned access in parse_request(). 2016-05-27 22:40:16 +02:00
Tejun Heo
da4d897e75 core: add cgroup memory controller support on the unified hierarchy (#3315)
On the unified hierarchy, memory controller implements three control knobs -
low, high and max which enables more useable and versatile control over memory
usage.  This patch implements support for the three control knobs.

* MemoryLow, MemoryHigh and MemoryMax are added for memory.low, memory.high and
  memory.max, respectively.

* As all absolute limits on the unified hierarchy use "max" for no limit, make
  memory limit parse functions accept "max" in addition to "infinity" and
  document "max" for the new knobs.

* Implement compatibility translation between MemoryMax and MemoryLimit.

v2:

- Fixed missing else's in config_parse_memory_limit().
- Fixed missing newline when writing out drop-ins.
- Coding style updates to use "val > 0" instead of "val".
- Minor updates to documentation.
2016-05-27 18:10:18 +02:00
Lennart Poettering
ffe54bf4bf Merge pull request #3329 from htejun/dbus-cgroup-fixes
dbus-cgroup fixes
2016-05-27 18:06:18 +02:00
Tejun Heo
83afa09d97 core: fix missing newline when writing drop-in for WorkingDirectory (#3337) 2016-05-27 17:41:45 +02:00
Lennart Poettering
694fe5d45e Merge pull request #3356 from OpenDZ/tixxdz/nspawn-quick-v1
nspawn: filesystem uid patching fixes and other minor improvments
2016-05-27 17:37:19 +02:00
Christian Hesse
85b78539c9 systemctl: fix code path (and memory leak) on error 2016-05-27 09:33:27 +02:00
Christian Hesse
5f056378b0 systemctl: fix return values on success 2016-05-27 09:32:41 +02:00
Christian Hesse
7f30799ade systemctl: remove extra comma 2016-05-27 09:21:02 +02:00
John Paul Adrian Glaubitz
aa91232040 resolve/test-dns-packet: Fix unaligned access in test_packet_from_file(). 2016-05-26 23:32:25 +02:00
Djalal Harouni
520e0d541f nspawn: rename arg_retain to arg_caps_retain
The argument is about capabilities.
2016-05-26 22:43:34 +02:00
Djalal Harouni
f011b0b87a nspawn: split out seccomp call into nspawn-seccomp.[ch]
Split seccomp into nspawn-seccomp.[ch]. Currently there are no changes,
but this will make it easy in the future to share or use the seccomp logic
from systemd core.
2016-05-26 22:42:29 +02:00
Djalal Harouni
231bfb1b02 nspawn: rename is_procfs_sysfs_or_suchlike() to is_fs_fully_userns_compatible()
Rename is_procfs_sysfs_or_suchlike() to is_fs_fully_userns_compatible()
to give it the real meaning. This may prevent future modifications that
may introduce bugs.
2016-05-26 22:39:34 +02:00
Djalal Harouni
87c05f365d nspawn: a bench of special fileystems that should not be shifted
Add some special filesystems that should not be shifted, most of them
relate to the host and not to containers.
2016-05-26 22:38:25 +02:00
Christian Hesse
acc0269cad {machine,system}ctl: always pass &changes and &n_changes (#3350)
We have to pass addresses of changes and n_changes to
bus_deserialize_and_dump_unit_file_changes(). Otherwise we are hit by
missing information (subsequent calls to unit_file_changes_add() to
not add anything).

Also prevent null pointer dereference in
bus_deserialize_and_dump_unit_file_changes() by asserting.

Fixes #3339
2016-05-26 15:57:37 +02:00
Lennart Poettering
ae06d1be4e ipv4ll: shorten some checks by using IN_SET a bit
As suggested:

https://github.com/systemd/systemd/pull/3328#discussion-diff-64285764
2016-05-26 15:34:43 +02:00
Lennart Poettering
9c4f6ccb70 sd-ndisc: small coding style fixes
Let's use usec_t internally always, when dealing with time values.

Let's use uint8_t* pointers if we are dealing with generic byte pointers.
2016-05-26 15:34:43 +02:00
Lennart Poettering
79b490b796 sd-ndisc: add more whitespace
Whitespace doesn't hurt and helps structuring things.
2016-05-26 15:34:43 +02:00
Lennart Poettering
b9e7b1cf06 sd-ndisc: stop discovery properly when something fails 2016-05-26 15:34:43 +02:00
Lennart Poettering
901c983b6d sd-ndisc: rework size checking in ndisc_ra_parse()
Let's better check the size before we subtract. Also, let's change the size
argument to size_t, as it cannot be signed anyway.

Finally, use EBADMSG for indicating invalid packets, like we do everywhere
else.
2016-05-26 15:34:43 +02:00
Lennart Poettering
745c5152c2 sd-ndisc: simplify clamping of router "pref" parameter 2016-05-26 15:34:43 +02:00
Lennart Poettering
3e261cfd3c sd-ndisc: append "event_source" to event source objects stored in structures
Otherwise it gets too confusing whether "timeout" refers to an event source or
just a timeout time specification.
2016-05-26 15:34:43 +02:00
Lennart Poettering
ad2998abd5 sd-ndisc: add log_ndisc_errno() macro, to complement log_ndisc() like elsewhere
Also make use of it where appropriate.
2016-05-26 15:34:43 +02:00
Lennart Poettering
b3dfcf6a76 sd-ndisc: use the right object to pass to log_ndisc()
There's no "client" object, in both cases. There's only "nd".

This wasn't noticed before, as the context object is currently not actually
used by the log macros.
2016-05-26 15:34:43 +02:00
Lennart Poettering
d54b734adc sd-ndisc: Typo fix: s/advertisment/advertisement/ 2016-05-26 15:34:43 +02:00
Lennart Poettering
b24ef0493a ipv4acd: rename "ll" parameter to "acd" everywhere
Appears to be a (confusing) left-over from copy/paste when this still was
ipv4ll code.
2016-05-26 15:34:43 +02:00
Lennart Poettering
703945c1dc sd-ipv4ll: add a bit of logging to IPv4LL too 2016-05-26 15:34:43 +02:00
Lennart Poettering
3aacc173e9 sd-ipv4acd: drop IPV4ACD_NETWORK definition
Appears to be a copy/paste mistake from sd-ipv4ll. Let's get rid of this.
2016-05-26 15:34:43 +02:00
Lennart Poettering
96a7979f3d ipv4acd: rework how we pick ipv4ll addresses
Let's make the seed actually work as stable seed, and use siphash24 to generate
the series of addresses, instead of the opaque libc random_r().

This not only makes the seed truly work as stable, portable seed, but also
makes the code quite a bit shorter, and removes a couple of memory allocations.
2016-05-26 15:34:43 +02:00
Lennart Poettering
38958cd66e ipv4ll: change "seed" parameter to be uint64_t
Let's make clear this always has the same size, since otherwise it's not useful
for reproducible runs, which this is really about however.
2016-05-26 15:34:43 +02:00
Lennart Poettering
ff0c5ebd4a ipv4acd: make sure our event handler callbacks never check uninitialized "r" for errors 2016-05-26 15:34:42 +02:00
Lennart Poettering
e3f4eedba1 ipv4acd: normalize time types to usec_t
We try to stick to usec_t for encoding time information, do that here too. In
particular, get rid of "int" second specifications, since signed timespans are
a weird thing.
2016-05-26 15:34:42 +02:00
Lennart Poettering
d63458452d ipv4acd: in case the state engine is reused, reset n_conflict timer to 0 2016-05-26 15:34:42 +02:00
Lennart Poettering
d914f7a563 ipv4acd: no need to memcpy() where assignment suffices 2016-05-26 15:34:42 +02:00
Lennart Poettering
c9e458a419 ipv4acd: introduce new "started" state
This state is active immediately after the state engine was started, but before
the first timer hits.

This way multiple _start() invocations on the same object are always detected
correctly.
2016-05-26 15:34:42 +02:00
Lennart Poettering
d246e77a43 ipv4acd: rename ipv4acd_stop() → ipv4acd_reset()
This is much less confusing, since there's also sd_ipv4acd_stop(), which was
idfferent from ipv4acd_stop().

After renaming it, let's also use the funciton when destroying ipv4acd objects,
as the code is pretty much the same for that.
2016-05-26 15:34:42 +02:00
Lennart Poettering
4dbf7b3a93 ipv4acd: add "_event_source" suffix to event source objects
Otherwise the field "receive_message" is a bit too confusing, as it suggests it
actually stores a message object of some kind.
2016-05-26 15:34:42 +02:00
Lennart Poettering
784cdc2d0b ipv4acd: make the iteration and conflict fields unsigned
They are counters after all, and can never go below zero, hence don't pretend
with the chose type that they could.

Also, prefix their name with "n_", to indicate that they are counters.
2016-05-26 15:34:42 +02:00
Lennart Poettering
73e94c0dcb ipv4l-{acd,ll}: make sure ipv4 addresses are unsigned
And some other minor fixes.
2016-05-26 15:34:42 +02:00
Lennart Poettering
a48fc60a33 ipv4acd: library code should never log
Or actually, not at any level higher than debug.
2016-05-26 15:34:42 +02:00