summaryrefslogtreecommitdiff
path: root/src/core
AgeCommit message (Collapse)Author
2013-10-29strv: introduce new strv_from_stdarg_alloca() macro to generate a string ↵Lennart Poettering
array from stdarg function parameters This allows us to turn lists of strings passed in easily into string arrays without having to allocate memory.
2013-10-22systemd: use unit name in PrivateTmp directoriesZbigniew Jędrzejewski-Szmek
Unit name is used whole in the directory name, so that the unit name can be easily extracted from it, e.g. "/tmp/systemd-abcd.service-DEDBIF1". https://bugzilla.redhat.com/show_bug.cgi?id=957439
2013-10-21silent a few more gcc warningsKay Sievers
2013-10-21build-sys: use -Og instead of -O0 to catch warningsKay Sievers
$ touch src/core/dbus.c; make CFLAGS=-O0 make --no-print-directory all-recursive Making all in . CC src/core/libsystemd_core_la-dbus.lo CCLD libsystemd-core.la $ touch src/core/dbus.c; make CFLAGS=-Og make --no-print-directory all-recursive Making all in . CC src/core/libsystemd_core_la-dbus.lo src/core/dbus.c: In function 'init_registered_system_bus': src/core/dbus.c:798:18: warning: 'id' may be used uninitialized in this function [-Wmaybe-uninitialized] dbus_free(id); ^ CCLD libsystemd-core.la -Og Optimize debugging experience. -Og enables optimizations that do not interfere with debugging. It should be the optimization level of choice for the standard edit-compile-debug cycle, offering a reasonable level of optimization while maintaining fast compilation and a good debugging experience.
2013-10-21bus: initialize variable, now that we might skip debug loggingKay Sievers
2013-10-21bus: remove static introspection file exportKay Sievers
2013-10-19mount/service: drop FsckPassNo supportTom Gundersen
We now treat passno as boleans in the generators, and don't need this any more. fsck itself is able to sequentialize checks on the same local media, so in the common case the ordering is redundant. It is still possible to force an order by using .d fragments, in case that is desired.
2013-10-16macro: clean up usage of gcc attributesLennart Poettering
Always use our own macros, and name all our own macros the same style.
2013-10-14list: make our list macros a bit easier to use by not requring type spec on ↵Lennart Poettering
each invocation We can determine the list entry type via the typeof() gcc construct, and so we should to make the macros much shorter to use.
2013-10-13manager: connect to private bus even if $DBUS_SESSION_BUS_ADDRESS is not setMantas Mikulėnas
Because that's exactly the kind of situation where the private bus is necessary.
2013-10-13Introduce udev object cleanup functionsZbigniew Jędrzejewski-Szmek
2013-10-13Make sure that we don't dereference NULLZbigniew Jędrzejewski-Szmek
The code was actually safe, because b should never be null, because if rvalue is empty, a different branch is taken. But we *do* check for NULL in the loop above, so it's better to also check here for symmetry.
2013-10-13Introduce _cleanup_fdset_free_Zbigniew Jędrzejewski-Szmek
2013-10-13drop-ins: check return valueZbigniew Jędrzejewski-Szmek
If the function failed, nothing serious would happen because unlink would probably return EFAULT, but this would obscure the real error and is a bit sloppy.
2013-10-13ModernizationZbigniew Jędrzejewski-Szmek
Fixes minor leak in error path in device.c.
2013-10-13Never call qsort on potentially NULL arraysZbigniew Jędrzejewski-Szmek
This extends 62678ded 'efi: never call qsort on potentially NULL arrays' to all other places where qsort is used and it is not obvious that the count is non-zero.
2013-10-11smack: minimize ifdef use, and move all labeling to smack-util.cKay Sievers
2013-10-10security: missing header inclusionsLennart Poettering
2013-10-10security: rework selinux, smack, ima, apparmor detection logicLennart Poettering
Always cache the results, and bypass low-level security calls when the respective subsystem is not enabled.
2013-10-09Smack: Test if smack is enabled before mountingAuke Kok
Since on most systems with xattr systemd will compile with Smack support enabled, we still attempt to mount various fs's with Smack-only options. Before mounting any of these Smack-related filesystems with Smack specific mount options, check if Smack is functionally active on the running kernel. If Smack is really enabled in the kernel, all these Smack mounts are now *fatal*, as they should be. We no longer mount smackfs if systemd was compiled without Smack support. This makes it easier to make smackfs mount failures a critical error when Smack is enabled. We no longer mount these filesystems with their Smack specific options inside containers. There these filesystems will be mounted with there non-mount smack options for now.
2013-10-09core: unify the way we denote serialization attributesLennart Poettering
2013-10-07systemd: serialize/deserialize forbid_restart valueSylvia Else
The Service type's forbid_restart field was not preserved by serialization/deserialization, so the fact that the service should not be restarted after stopping was lost. If a systemctl stop foo command has been given, but the foo service has not yet stopped, and then the systemctl --system daemon-reload was given, then when the foo service eventually stopped, systemd would restart it. https://bugs.freedesktop.org/show_bug.cgi?id=69800
2013-10-07Run with a custom SMACK domain (label).Auke Kok
Allows the systemd --system process to change its current SMACK label to a predefined custom label (usually "system") at boot time. This is needed to have a few system-generated folders and sockets automatically be created with the right SMACK label. Without that, processes either cannot communicate with systemd or systemd fails to perform some actions.
2013-10-07Mount /run, /dev/shm usable to tasks when using SMACK.Auke Kok
Once systemd itself is running in a security domain for SMACK, it will fail to start countless tasks due to missing privileges for mounted and created directory structures. For /run and shm specifically, we grant all tasks access. These 2 mounts are allowed to fail, which will happen if the system is not running a SMACK enabled kernel or security=none is passed to the kernel.
2013-10-05core: do not add "what" to RequiresMountsFor for network mountsZbigniew Jędrzejewski-Szmek
For cifs mount like //server/share, we would get RequiresMountsFor=/server/share, which probably isn't harmful, but quite confusing. Unfortunately a bunch of static functions had to be moved up, but patch is really one line.
2013-10-04mount: check for NULL before reading pm->whatDave Reisner
Since a57f7e2c828b85, a mount unit with garbage in it would cause systemd to crash on loading it. ref: https://bugs.freedesktop.org/show_bug.cgi?id=70148
2013-10-04manager: when verifying whether clients may change environment using selinux ↵Lennart Poettering
check for "reload" rather "reboot" This appears to be a copy/paste error.
2013-10-03systemd: order remote mounts from mountinfo before remote-fs.targetZbigniew Jędrzejewski-Szmek
Usually the network is stopped before filesystems are umounted. Ordering network filesystems before remote-fs.target means that their unmounting will be performed earlier, and can terminate sucessfully. https://bugs.freedesktop.org/show_bug.cgi?id=70002
2013-10-03execute: more debugging messagesZbigniew Jędrzejewski-Szmek
2013-10-02execute.c: always set $SHELLZbigniew Jędrzejewski-Szmek
In e6dca81 $SHELL was added to user@.service. Let's instead provide it to all units which have a user.
2013-10-01core: whenever a new PID is passed to us, make sure we watch itLennart Poettering
2013-10-01smack-setup: fix path to Smack/CIPSO mappingsPatrick McCarty
The correct path to the dir with CIPSO mappings is /etc/smack/cipso.d/; /etc/smack/cipso is a file that can include these mappings as well, though it is no longer supported in upstream libsmack.
2013-10-01local: fix memory leak when putting together locale settingsLennart Poettering
Also, we need to use proper strv_env_xyz() calls when putting together the environment array, since otherwise settings won't be properly overriden. And let's get rid of strv_appendf(), is overkill and there was only one user.
2013-10-01main: don't free fds array twiceLennart Poettering
2013-09-27Do not use unitialized variable and remove duplicated lineZbigniew Jędrzejewski-Szmek
2013-09-27swap: properly expose timeout property on the busLennart Poettering
2013-09-27dbus: fix introspection for TimerSlackNSecLennart Poettering
2013-09-26core: drop some out-of-date references to cgroup settingsLennart Poettering
2013-09-26main: set umask before creating any filesMike Gilbert
This avoids a problem when we inherit a non-zero umask from the initramfs. This would cause /run/systemd to be created with the wrong mode.
2013-09-26core: rework how we match mount units against each otherLennart Poettering
Previously to automatically create dependencies between mount units we matched every mount unit agains all others resulting in O(n^2) complexity. On setups with large amounts of mount units this might make things slow. This change replaces the matching code to use a hashtable that is keyed by a path prefix, and points to a set of units that require that path to be around. When a new mount unit is installed it is hence sufficient to simply look up this set of units via its own file system paths to know which units to order after itself. This patch also changes all unit types to only create automatic mount dependencies via the RequiresMountsFor= logic, and this is exposed to the outside to make things more transparent. With this change we still have some O(n) complexities in place when handling mounts, but that's currently unavoidable due to kernel APIs, and still substantially better than O(n^2) as before. https://bugs.freedesktop.org/show_bug.cgi?id=69740
2013-09-26execute.c: little modernizationZbigniew Jędrzejewski-Szmek
2013-09-25cgroup: if we do a cgroup operation then do something on all supported ↵Lennart Poettering
controllers Previously we did operations like attach, trim or migrate only on the controllers that were enabled for a specific unit. With this changes we will now do them for all supproted controllers, and fall back to all possible prefix paths if the specified paths do not exist. This fixes issues if a controller is being disabled for a unit where it was previously enabled, and makes sure that all processes stay as "far down" the tree as groups exist.
2013-09-24support acpi firmware performance data (FPDT)Kay Sievers
Prefer firmware-provided performance data over loader-exported ones; if ACPI data is available, always use it, otherwise try to read the loader data. The firmware-provided variables start at the time the first EFI image is executed and end when the operating system exits the boot services; the (loader) time calculated in systemd-analyze increases.
2013-09-23cgroup: always enable memory.use_hierarchy= for all cgroups in the memory ↵Lennart Poettering
hierarchy The non-hierarchial mode contradicts the whole idea of a cgroup tree so let's not support this. In the future the kernel will only support the hierarchial logic anyway.
2013-09-17Use first partition in /proc/swaps for hibernation testZbigniew Jędrzejewski-Szmek
It seems that the kernel uses the first configured partition for hibernation. If it is too full, hibernation will fail. Test that directly.
2013-09-17cgroup: get rid of MemorySoftLimit=Lennart Poettering
The cgroup attribute memory.soft_limit_in_bytes is unlikely to stay around in the kernel for good, so let's not expose it for now. We can readd something like it later when the kernel guys decided on a final API for this.
2013-09-17Make tmpdir removal asynchronousZbigniew Jędrzejewski-Szmek
https://bugs.freedesktop.org/show_bug.cgi?id=68232
2013-09-17man: add a list of environment variablesZbigniew Jędrzejewski-Szmek
2013-09-17specifier: rework specifier calls to return proper error messageLennart Poettering
Previously the specifier calls could only indicate OOM by returning NULL. With this change they will return negative errno-style error codes like everything else.
2013-09-16transaction.c: do not point users to logs when unit not foundZbigniew Jędrzejewski-Szmek
The logs are unlikely to contain any useful information in this case. Also, change "walked on cycle path" to "found dependency on", which is less technical and indicates the direction. With the old message, I was never sure if prior units depended on later ones, or vice versa. https://bugzilla.redhat.com/show_bug.cgi?id=996133 https://bugzilla.redhat.com/show_bug.cgi?id=997082