Commit graph

20235 commits

Author SHA1 Message Date
Thomas Hindoe Paaboel Andersen 86ff9f1173 test-libudev: fix leak in error case
CID# 1297428
2015-05-11 21:42:59 +02:00
Thomas Hindoe Paaboel Andersen 12322d4100 swap: avoid null pointer dereference
CID#1297436
2015-05-11 21:03:50 +02:00
Torstein Husebø ff9b60f38b treewide: Correct typos and spell plural of bus consistent 2015-05-11 15:51:30 +02:00
Zbigniew Jędrzejewski-Szmek 4dda4e637e Generate systemd-fsck-root.service in the initramfs
In the initrafms, generate a systemd-fsck-root.service to replace
systemd-fsck@<sysroot-device>.service. This way, after we transition
to the real root, systemd-fsck-root.service is marked as already done.

This introduces an unnecessary synchronization point, because
systemd-fsck@* is ordered after systemd-fsck-root also in the
initramfs. In practice this shouldn't be a problem.

https://bugzilla.redhat.com/show_bug.cgi?id=1201979

C.f. 956eaf2b8d.
2015-05-10 13:17:57 -04:00
Zbigniew Jędrzejewski-Szmek 7703bd4d28 man: fix typos in previous comimt 2015-05-09 19:46:23 -04:00
Zbigniew Jędrzejewski-Szmek 589532d0c6 man: document forwarding to syslog better
https://bugzilla.redhat.com/show_bug.cgi?id=1147651
2015-05-09 17:21:18 -04:00
Cristian Rodríguez 7e273016de buildsys: *_la_CPPFLAGS takes $(AM_CPPFLAGS) not $(AM_CFLAGS) 2015-05-09 19:12:12 +02:00
Thomas Hindoe Paaboel Andersen 74bddd6f19 udevd: remove unused function 2015-05-07 07:27:38 +02:00
Tom Gundersen 020328e197 udevd: don't explicitly count the number of workers
Simply query the size of the hashmap keeping all the worker contexts instead.
2015-05-06 23:45:10 +02:00
Tom Gundersen a505965d95 udevd: keep workers in a hashmap rather than a list
This makes the code somewhat more readable.
2015-05-06 23:45:10 +02:00
Tom Gundersen c6aa11f200 udevd: worker - drop reference counting
Make the worker context have the same life-span as the worker process. It is created on fork()
and free'd on SIGCHLD.

The change means that we can get worker_returned() for a worker context that is no longer around,
this is not a problem and we can just drop the message. The only use for worker_returned() is to
know to reschedule events to workers that are still around, so if the worker has already exited
it is not important to keep track of. We still print a debug statement in this case to be on the
safe side.
2015-05-06 23:45:10 +02:00
Thomas Hindoe Paaboel Andersen 7f629b74c4 device: avoid null pointer dereference 2015-05-06 19:58:03 +02:00
David Herrmann f7e3c6f5f8 udev: fix weird coding-style
Eeeew!
2015-05-06 18:59:03 +02:00
Thomas Hindoe Paaboel Andersen c0c6a4fc1c test-libudev: add error handling
CID#1296244
2015-05-06 18:40:30 +02:00
Tom Gundersen c4fcf70a01 udevd: worker - allow passing NULL to worker_unref() 2015-05-06 18:35:55 +02:00
Tom Gundersen 8b46c3fc48 udevd: worker - use _exit() rather than exit()
Follow the coding style and avoid the exit handlers.
2015-05-06 18:35:55 +02:00
Tom Gundersen 6af5e6a4c9 udevd: modernize error handling
We never return magic exit codes, but just EXIT_FAILUER or EXIT_SUCCESS.
2015-05-06 18:35:55 +02:00
Tom Gundersen 614a823c44 udevd: use kernel cmdline parser 2015-05-06 18:35:55 +02:00
Tom Gundersen 9c2dabd05f udevd: worker - move some fields from the worker to the event 2015-05-06 18:35:55 +02:00
Tom Gundersen 39c19cf13a udevd: worker - introduce worker_attach_event() 2015-05-06 18:35:55 +02:00
Tom Gundersen 3a19b32a67 udevd: worker - make refcounting clearer
Take and drop explicit references where it makes sense.
2015-05-06 18:35:55 +02:00
Tom Gundersen e03c7cc26e udevd: worker - only allocate the worker struct in the main process
This is not used in the worker, so avoid having to free it there.
2015-05-06 18:35:55 +02:00
Tom Gundersen f96a5160c4 udevd: rename worker_new() to worker_spawn() 2015-05-06 18:35:55 +02:00
Tom Gundersen 4914cb2ddc udevd: don't track worker exitcode
We used to use this to track failed events so they could be retriggered,
but that is no longer done, so the code can be dropped.
2015-05-06 18:35:55 +02:00
David Herrmann a44816e94e Update TODO 2015-05-06 18:30:01 +02:00
Susant Sahani 61087906e0 udev: fix coding style 2015-05-06 09:27:46 -07:00
Daniel Buch cafbecf31c systemctl: null-initialize pointer with cleanup attribute 2015-05-06 09:26:20 -07:00
Thomas Hindoe Paaboel Andersen 90615ad791 machinectl: remove unused variable 2015-05-06 18:23:46 +02:00
David Herrmann d79acc3093 bus: don't switch to kdbus if not requested
Whenever systemd is re-executed, it tries to create a system bus via
kdbus. If the system did not have kdbus loaded during bootup, but the
module is loaded later on manually, this will cause two system buses
running (kdbus and dbus-daemon in parallel).

This patch makes sure we never try to create kdbus buses if it wasn't
explicitly requested on the command-line.
2015-05-06 18:21:51 +02:00
Zbigniew Jędrzejewski-Szmek f2bf5007a9 timedated: remove unnecessary goto
Not needed since 99f861310d.
2015-05-06 00:44:52 -04:00
Michael Olbrich f44b28fda0 tmpfiles: try to handle read-only file systems gracefully
On read-only filesystems trying to create the target will not fail with
EEXIST but with EROFS. Handle EROFS by checking if the target already
exists, and if empty when truncating.
This avoids reporting errors if tmpfiles doesn't actually needs to do
anything.

[zj: revert condition to whitelist rather then blacklisting, and add goto
to avoid stat'ting twice.]
2015-05-06 00:10:40 -04:00
Michael Olbrich 3e7f33ada9 shared/utmp-wtmp: fix copy/paste error 2015-05-05 23:41:10 -04:00
Zbigniew Jędrzejewski-Szmek 236e1cc4cf Add audit type generated files to gitignore
They are not currently used, but the Makefile rules don't know that.
It's easier to ignore them, then to special-case creation rules.
2015-05-05 22:41:42 -04:00
Colin Walters cd2eb9e942 lockfile-util.[ch]: Split out from util.[ch]
Continuing the general trend of splitting up util.[ch].  I specifically
want to reuse this code in https://github.com/GNOME/libglnx and
having it split up will make future copy-pasting easier.
2015-05-05 22:35:29 -04:00
Seth Jennings 7e7cddb224 Fix permissions on /run/systemd/nspawn/locks
machined is getting an EACCES when trying to create the lock file for
images because the mode on /run/systemd/nspawn/locks is 0600.

mkdir("/run/systemd/nspawn/locks", 0600) = -1 EEXIST (File exists)
stat("/run/systemd/nspawn/locks", {st_mode=S_IFDIR|0600, st_size=40, ...}) = 0
open("/run/systemd/nspawn/locks/inode-41:256", O_RDWR|O_CREAT|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC, 0600) = -1 EACCES (Permission denied)

This commit adjusts the mode to 0700 to correct the issue.
2015-05-05 22:21:26 -04:00
Torstein Husebø e5f270f5d0 treewide: fix typos 2015-05-05 22:19:28 -04:00
Lennart Poettering d89e647542 update TODO 2015-05-05 15:07:00 -07:00
Lennart Poettering 3fe22bb4b6 man: document that nspawn -x, --template= and machinectl clone leave hostname and machine id unmodified 2015-05-05 15:07:00 -07:00
Lennart Poettering 7de7ee62c5 man: nspawn is used in production these days, admit that
Previously, the man page suggested to only use nspawn for testing,
building, and debugging things. However, it is nowadays used in
production and used as building block for rocket, hence let's just admit
that it's pretty much production ready.
2015-05-05 15:07:00 -07:00
Lennart Poettering 93c474725c core: be more strict when manipulating slices names and unescaping paths from unit names
Let's better be safe then sorry.
2015-05-05 15:06:51 -07:00
Lennart Poettering e05ad7bcc8 core: bus name units should not allow aliases or instances 2015-05-05 15:06:44 -07:00
Lennart Poettering 7410616cd9 core: rework unit name validation and manipulation logic
A variety of changes:

- Make sure all our calls distuingish OOM from other errors if OOM is
  not the only error possible.

- Be much stricter when parsing escaped paths, do not accept trailing or
  leading escaped slashes.

- Change unit validation to take a bit mask for allowing plain names,
  instance names or template names or an combination thereof.

- Refuse manipulating invalid unit name
2015-05-05 15:06:42 -07:00
Lennart Poettering 6442185ab6 util: be a bit safer in path_is_safe()
We should be more strict when verifying paths with path_is_safe() for
potentially dangerous constructs, and that includes lengths of
PATH_MAX-1 and larger. Be more accurate here.
2015-05-05 15:06:35 -07:00
Lennart Poettering e66e5b612a cgroup-util: be more strict when processing slice unit names 2015-05-05 15:06:33 -07:00
Kay Sievers 32fea77178 build-sys: remove left-over 2015-05-05 22:06:04 +02:00
Stephen Gallagher be7d0048dd Add VARIANT as a standard value for /etc/os-release
Some distributions (such as Fedora) are using the VARIANT field to
indicate to select packages which of several default configurations
they should be using. For example, VARIANT=Server provides a
different default firewall configuration (blocking basically
everything but SSH and the management console) whereas
VARIANT=Workstation opens many other ports for application
compatibility.

By adding this patch to the manual pages, we can standardize on a
cross-distribution mechanism for accomplishing this.

Fedora implementation details are available at
https://fedoraproject.org/wiki/Packaging:Per-Product_Configuration

(David: drop double paranthesis)
2015-05-05 21:07:13 +02:00
Zbigniew Jędrzejewski-Szmek 2e8522767e generators: rename add_{root,usr}_mount to add_{sysroot,sysroot_usr}_mount
This makes it obvious that those functions are only usable in the
initramfs.

Also, add a warning when noauto, nofail, or automount is used for the
root fs, instead of silently ignoring. Using those options would be a
sign of significant misconfiguration, and if we bother to check for
them, than let's go all the way and complain.

Other various small cleanups and reformattings elsewhere.
2015-05-04 08:45:07 -04:00
Patrik Flykt be3a09b7ff network: Implement fallback DHCPv6 prefix handling for older kernels
When setting IPv6 addresses acquired by DHCPv6, systemd-networkd sets
the IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. As
the flag and the attribute are present starting with Linux 3.14, older
kernels will need systemd-network to manage prefix route expiry.

By default, DHCPv6 addresses are first assigned setting the
IFA_F_NOPREFIXROUTE flag in the IFA_FLAGS netlink attribute. Should
the address assignment fail, the same assignment is tried without
the IFA_FLAGS attribute. Should also the second attempt fail, an error
is printed and address assignment ends with failure. As successful use
of the IFA_FLAGS netlink attribute is recorded in the Link structure,
the DHCPv6 code will know if the kernel or systemd-network fallback
code handles expiring prefixes.

The prefix expiration and IPv6 address updating fallback code is
resurrected from the parts deleted with commit
47d45d3cde.

This patch can be removed once the minimum kernel requirements are
greater than or equal to 3.14.
2015-05-04 09:42:37 +03:00
Zbigniew Jędrzejewski-Szmek 336b5c615e fstab-generator: fix memleak
filtered was used to store an allocated string twice. The first allocation was
thus lost. The string is not needed for anything, so simply skip the allocation.

Fixup for deb0a77cf0.
2015-05-02 13:01:28 -04:00
Zbigniew Jędrzejewski-Szmek 35c0808fe0 man: use utf-8 in systemd-remount-fs.service(8) 2015-05-02 13:01:28 -04:00