1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-08 11:27:32 +03:00
Commit Graph

12741 Commits

Author SHA1 Message Date
David Herrmann
f36f8f7891 prioq: add introduction comment
Add comment to prioq.c explaining what it does. And more importantly,
mention that we implement a Heap. It's more than annoying having to
figure out what the code actually does, without ever mentioning the word
'heap'.
2015-09-29 12:49:25 +02:00
Thomas Hindoe Paaboel Andersen
19932084d0 sd-bus: va_start should use the last named parameter 2015-09-27 23:11:31 +02:00
Lennart Poettering
8e82b3a271 Merge pull request #1392 from dvdhrm/bus-format2
sd-bus: add sd_bus_path_{encode,decode}_many() (v2)
2015-09-27 15:04:12 +02:00
Martin Pitt
ad1dc5ca46 Merge pull request #1373 from pfl/dhcp6_opportunistic_configuration
networkd: Be opportunistic when declaring link configured
2015-09-27 09:42:06 +02:00
David Herrmann
dfb815c36d sd-bus: add sd_bus_path_{encode,decode}_many()
This introduces two new helpers alongside sd_bus_path_{encode,decode}(),
which work similarly to their counterparts, but accept a format-string as
input. This allows encoding and decoding multiple labels of a format
string at the same time.
2015-09-26 16:57:23 +02:00
Filipe Brandenburger
9d5ca7f882 load-fragment: Use parse_cpu_set in CPUAffinity support
Tested with a dummy service running 'sleep', modifying its CPUAffinity,
restarting the service and checking the ^Cpus_allowed entries in the
/proc/PID/status file.
2015-09-24 19:31:28 -07:00
Filipe Brandenburger
5f05235f13 util: Add test for parse_cpu_set 2015-09-24 18:48:21 -07:00
Filipe Brandenburger
f5c72b739e util: refactor cpu_set parsing into its own function
Use the new code in config_parse_cpu_affinity2.

Tested by modifying CPUAffinity=... setting in /etc/systemd/system.conf
and reloading the daemon, then checking ^Cpus_allowed in /proc/1/status
to confirm the correct CPU mask is in place.
2015-09-24 18:01:36 -07:00
Lennart Poettering
681de8128d Merge pull request #1376 from dvdhrm/hostnamed-argc
hostnamed: drop redundant code
2015-09-24 17:14:57 +02:00
David Herrmann
76c73487d0 hostnamed: drop redundant code
Doing argc checks once is enough enough enough enough.
2015-09-24 16:50:28 +02:00
Patrik Flykt
3ada37a21e networkd: Be opportunistic when declaring link configured
The DHCP variable in the [Network] section of the network configuration
file moves the link to the configured state according to the following:

DHCP=yes   Link is configured when either DHCPv4 or DHCPv6 succeed
DHCP=ipv4  Link is configured only when DHCPv4 succeeds
DHCP=ipv6  Link is configured only when DHCPv6 succeeds
DHCP=no    Neither DHCPv4 or DHCPv6 is attempted

Reported by Martin Pitt.

Fixes https://github.com/systemd/systemd/issues/1368
2015-09-24 15:20:41 +03:00
Hendrik Brueckner
7517f51ef9 s390: add personality support
Introduce personality support for Linux on z Systems to run
particular services with a 64-bit or 31-bit personality.
2015-09-24 13:03:18 +02:00
Lennart Poettering
2e396de8b2 Merge pull request #1366 from pocek/sd-event-fixes
sd-event: fix prepare priority queue comparison function
2015-09-24 11:27:08 +02:00
Tom Gundersen
56c5815983 Merge pull request #1332 from thom311/master
sd-dhcp6: ensure canceling lease timers and refactor setting lease
2015-09-24 00:59:15 +02:00
Tom Gundersen
5fecc33e32 Merge pull request #1356 from pfl/dhcp6_suspend
DHCPv6 suspend fixes
2015-09-24 00:55:49 +02:00
Krzysztof Kotlenga
8046c4576a sd-event: fix prepare priority queue comparison function
Otherwise a disabled event source can get swapped with an enabled one
and cause a severe sd-event malfunction.

http://lists.freedesktop.org/archives/systemd-devel/2015-September/034356.html
2015-09-24 00:48:30 +02:00
Lennart Poettering
97f709186b Merge pull request #1365 from floppym/kcmp
Add fallback for kcmp() in case __NR_kcmp is undefined
2015-09-23 21:09:38 +02:00
Mike Gilbert
75b554579b Add fallback for kcmp() in case __NR_kcmp is undefined
IA64 is missing this syscall as of linux-4.2.
This works around it until the necessary kernel patch gets merged.
2015-09-23 14:41:28 -04:00
Lennart Poettering
1ed11ff659 Merge pull request #1349 from dvdhrm/sync-pam
core: make setup_pam() synchronous
2015-09-23 18:42:41 +02:00
Lennart Poettering
adf344b0ed Merge pull request #1357 from again4you/devel/fix_smack_sd_pam_#2
exec: fix the wrong SMACK labeling of (sd-pam) daemon v3
2015-09-23 16:44:21 +02:00
Lennart Poettering
41b59f264e Merge pull request #1345 from georgmu/fix_accept_ra
Set accept_ra to "2" if enabled in config
2015-09-23 16:42:18 +02:00
Hendrik Brueckner
7bcff8daba mising: add __NR_memfd_create syscall number for s390 2015-09-23 15:46:30 +02:00
Sangjung Woo
b213e1c11d exec: move mac_smack_apply_pid() and setup_pam() to same condition block
This cleans up exec_child() function by moving mac_smack_apply_pid()
and setup_pam() to the same condition block, since both of them have
the same condition (i.e params->apply_permissions). It improves
readability without changing its operation.
2015-09-23 22:11:38 +09:00
Patrik Flykt
18d29550b5 networkd: Wait for DHCPv6 before announcing link configured
Wait until DHCPv6 has acquired an address before announcing the link
to be configured. Log the DHCPv6 lease lost event.
2015-09-23 15:24:04 +03:00
Patrik Flykt
e66040417b sd-dhcp6-client: Properly handle DHCPv6 client restart after resume
Whenever a Router Advertisement is received, dhcp6_configure() will be
called. A Router Advertisment can also instruct DHCPv6 to start acquiring
IPv6 addresses in manged mode, if it previously was handling only other
information. As an Router Advertisment is also received after the DHCPv6
client has resumed from a suspend, fix the function not to assume DHCPv6
is currently running, but instead try to restart it. Handle
sd_dhcp6_start() returning -EALREADY indicating that the DHCPv6 client was
already running.

Collect all client unrefs in one place to unclutter the error handling.

Fixes https://github.com/systemd/systemd/issues/963
2015-09-23 15:24:04 +03:00
Patrik Flykt
44598572da test-dhcp6-client: Update test case due to changed semantics
Update the test case to stop the ongoing Information Request exchange
before unsetting its state. To keep the test case callback verification
simpler, temporarily unset the callback function before stopping.
2015-09-23 15:11:09 +03:00
Patrik Flykt
d7c9c21f18 sd-dhcp6-client: Prevent setting and restarting of DHCPv6 client
Prevent modifications to index, MAC address, DUID and Information
Request while the DHCPv6 client is running.

Require the DHCPv6 client to be stopped first instead of always
unconditionally restarting it if the caller calls
sd_dhcp6_client_start() more than once. With this change, handling
of for example incoming Router Advertisments becomes much easier.
2015-09-23 15:11:09 +03:00
Sangjung Woo
6bf6e43e7e exec: call setup_pam() after SMACK labeling
When 'SmackProcessLabel=' is used in user@.service file, all processes
launched in systemd user session should be labeled as the designated name
of 'SmackProcessLabel' directive. However, if systemd has its own smack
label using '--with-smack-run-label' configuration, '(sd-pam)' is
labeled as the specific name of '--with-smack-run-label'. If
'SmackProcessLabel=' is used in user@.service file without
'--with-smack-run-label' configuration, (sd-pam) is labeled as "_" since
systemd (i.e. pid=1) is labeled as "_".

This is mainly because setup_pam() function is called before applying
smack label to child process. This patch fixes it by calling setup_pam()
after setting the smack label.
2015-09-23 20:41:52 +09:00
Daniel Mack
ce40506ddb Merge pull request #1339 from alkino/master
Hook more properties for transient units
2015-09-23 11:04:34 +02:00
Georg Müller
6a512301bb Set accept_ra to "2" if enabled in config
This causes the kernel to accept router advertisments even if
ip forwarding is enabled for this interface.

This fixes #1340.
2015-09-23 10:27:45 +02:00
Nicolas Cornu
602b83559a Hook more properties for transient units
systemd-run can now launch units with WorkingDirectory, RootDirectory set.
2015-09-23 09:45:50 +02:00
David Herrmann
2d7c6aa20c core: make setup_pam() synchronous
If we spawn a unit with a non-empty 'PAMName=', we fork off a
child-process _inside_ the unit, known as '(sd-pam)', which watches the
session. It waits for the main-process to exit and then finishes it via
pam_close_session(3).

However, the '(sd-pam)' setup is highly asynchronous. There is no
guarantee that process gets spawned before we finish the unit setup.
Therefore, there might be a root-owned process inside of the cgroup of
the unit, thus causing cg_migrate() to error-out with EPERM.

This patch makes setup_pam() synchronous and waits for the '(sd-pam)'
setup to finish before continuing. This guarantees that setresuid(2) was
at least tried before we continue with the child setup of the real unit.
Note that if setresuid(2) fails, we already warn loudly about it. You
really must make sure that you own the passed user if using 'PAMName='.
It seems very plausible to rely on that assumption.
2015-09-23 00:51:20 +02:00
Lennart Poettering
5c781d6b0d Merge pull request #1346 from dvdhrm/user-shutdown
core: fix shutdown of --user
2015-09-23 00:48:02 +02:00
Lars Uebernickel
f6d1e6cbe9 busctl: also monitor messages to SERVICE arguments
Add a 'destination' match rule for every SERVICE argument in addition to
the 'sender' rule. This is consistent with busctl(1), which documents
monitor as dumping "messages to or from this peer".
2015-09-23 00:06:18 +02:00
David Herrmann
8ebfe0cbaa core: fix shutdown of --user
Shutting down a user session currently fails with:

Sep 22 22:35:38 david-t2 systemd[640]: Reached target Shutdown.
Sep 22 22:35:38 david-t2 systemd[640]: Starting Exit the Session...
Sep 22 22:35:38 david-t2 systemd[640]: Received SIGRTMIN+24 from PID 659 (kill).
Sep 22 22:35:38 david-t2 systemd[640]: Shutting down.
Sep 22 22:35:38 david-t2 systemd[640]: Not executed by init (PID 1).
Sep 22 22:35:38 david-t2 systemd[640]: Critical error while doing system shutdown: Operation not permitted

This is a regression from:

    commit 287419c119
    Author: Alban Crequy <alban.crequy@gmail.com>
    Date:   Fri Sep 18 13:37:34 2015 +0200

        containers: systemd exits with non-zero code

Make sure we never ever execute systemd-shutdown from within a
user-manager. Restore the previous behavior by partially reverting given
commit.
2015-09-22 22:56:01 +02:00
Lennart Poettering
68321c9a97 Merge pull request #1338 from kaysievers/pam
pam: systemd-user - call selinux module
2015-09-22 18:19:36 +02:00
Kay Sievers
a6affd88ba udev: ata_id - ATA_ID_SATA_CAPABILITY == 76 2015-09-22 18:00:52 +02:00
Kay Sievers
a13cff19ce pam: systemd-user - call selinux module
https://bugzilla.redhat.com/show_bug.cgi?id=1262933
2015-09-22 17:54:13 +02:00
David Herrmann
840cdfcd81 Merge pull request #1334 from poettering/sd-bus-default-flush-close
sd-bus: introduce new sd_bus_default_flush_close() call
2015-09-22 17:33:58 +02:00
Kay Sievers
c1f330a1f4 Merge pull request #1324 from pugs/master
Fixup WWN bytes for big-endian systems
2015-09-22 17:08:39 +02:00
Daniel Mack
d11885c814 Merge pull request #1335 from poettering/some-fixes
A variety of mostly unrelated fixes
2015-09-22 17:04:38 +02:00
Lennart Poettering
f98f4ace4d Merge pull request #1336 from pszewczyk/functionfs_sockets_v3
core: add support for usb functionfs v3
2015-09-22 16:55:08 +02:00
Lennart Poettering
3be78ab2b8 importd: make sure we don't accidentally close fd 0
Fixes #1330
2015-09-22 16:40:36 +02:00
Pawel Szewczyk
6b7e592310 core: Add FFSDescriptors and FFSStrings service parameters
By using these parameters functionfs service can specify ffs descriptors
and strings which should be written to ep0.
2015-09-22 16:32:16 +02:00
Pawel Szewczyk
602524469e core: Add socket type for usb functionfs endpoints
For handling functionfs endpoints additional socket type is added.
2015-09-22 16:32:16 +02:00
Lennart Poettering
6f2deb8447 notify: sort header files, follow CODING_STYLE 2015-09-22 16:32:04 +02:00
Lennart Poettering
c077529ba6 util: drop UID_IS_INVALID() in favour of uid_is_valid()
No need to keep both functions, settle on uid_is_valid() for everything.
2015-09-22 16:31:32 +02:00
Lennart Poettering
f6c2284ad3 util.h: order includes, as suggested by CODING_STYLE
Of course, because Linux is broken we cannot actually really order it,
and must keep linux/fs.h after sys/mount.h... Yay for Linux!
2015-09-22 16:31:19 +02:00
Lennart Poettering
8c721f2bcb util: clean-ups to enum parsers
Never log when we fail due to OOM when translating enums, let the caller
do that. Translating basic types like enums should be something where
the caller logs, not the translatior functions.

Return -1 when NULL is passed to all enum parser functions.

The non-fallback versions of the enum translator calls already handle
NULL as failure, instead of hitting an assert, and we should do this
here, too.
2015-09-22 16:31:10 +02:00
Lennart Poettering
08edf879ed cgtop: make sure help text doesn't cause main contents to move
Let's always keep space for the full help text. (We used to do that, but
recently another line of help was added which broke this.)
2015-09-22 16:31:02 +02:00