summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2015-11-16Merge pull request #1919 from martinpitt/masterDavid Herrmann
siphash42: add tests with unaligned input pointers
2015-11-16Merge pull request #1918 from dvdhrm/user3David Herrmann
login: allow re-using users (v3)
2015-11-16siphash42: add tests with unaligned input pointersMartin Pitt
Add test case for calling siphash24 with unaligned input pointers, as we commonly get with calling it on the result on basename() or similar. This provides a test for PR #1916, rescued from the superseded PR #1911. Thanks to Steve Langasek for the test!
2015-11-16login: ignore JobRemoved of old jobsDavid Herrmann
If we requeue jobs, we are no longer interested in old jobs. Hence, we better ignore any JobRemoved signals for old jobs and concentrate on our replacements.
2015-11-16Merge pull request #1916 from zonque/alignTom Gundersen
siphash: alignment
2015-11-16Merge pull request #1915 from poettering/btrfs-root-subvolDavid Herrmann
tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subv…
2015-11-16login: make sure to replace existing unitsDavid Herrmann
When queuing unit jobs, we should rather replace existing units than fail. This is especially important when we queued a user-shutdown and a new login is encountered. In this case, we better raplce the shutdown jobs. systemd takes care of everything else.
2015-11-16login: fix re-use of usersDavid Herrmann
If the last reference to a user is released, we queue stop-jobs for the user-service and slice. Only once those are finished, we drop the user-object. However, if a new session is opened before the user object is fully dropped, we currently incorrectly re-use the object. This has the effect, that we get stale sessions without a valid "systemd --user" instance. Fix this by properly allowing user_start() to be called, even if user->stopping is true.
2015-11-16login: group static fields in "struct User"David Herrmann
Make sure to put static fields together in "struct User". This makes it easier to figure out the lifetime of each field.
2015-11-16login: make user->service staticDavid Herrmann
Just like user->slice, there is no reason to store the unit name in /run, nor should we allocate it dynamically on job instantiation/removal. Just keep it statically around at all times and rely on user->started || user->stopping to figure out whether the unit exists or not.
2015-11-16login: make user_new() and user_free() follow coding-styleDavid Herrmann
Few changes to user_new() and user_free(): - Use _cleanup_(user_freep) in constructor - return 'int' from user_new() - make user_free() deal with partially initialized objects - keep reverse-order in user_free() compared to user_new() - make user_free() return NULL - make user_free() accept NULL as no-op
2015-11-16login: keep user->slice constantDavid Herrmann
Currently, we allocate user->slice when starting a slice, but we never release it. This is incompatible if we want to re-use a user object once it was stopped. Hence, make sure user->slice is allocated statically on the user object and use "u->started || u->stopping" as an indication whether the slice is actually available on pid1 or not.
2015-11-16login: simply XDG_RUNTIME_DIR managementDavid Herrmann
Lets not pretend we support changing XDG_RUNTIME_DIR via logind state files. There is no reason to ever write the string into /run, as we allocate it statically based on the UID, anyway. Lets stop that and just allocate the runtime_path in "struct User" at all times. We keep writing it into the /run state to make sure pam_systemd of previous installs can still read it. However, pam_systemd is now fixed to allocate it statically as well, so we can safely remove that some time in the future. Last but not least: If software depends on systemd, they're more than free to assume /run/user/$uid is their runtime dir. Lets not require sane applications to query the environment to get their runtime dir. As long as applications know their login-UID, they should be safe to deduce the runtime dir.
2015-11-16tmpfiles: create subvolumes for "v", "q", and "Q" only if / is a subvolumeLennart Poettering
It's not a good idea to create subvolumes for parts of the OS tree (such as /home, or /var) if the root directory is not a subvolume too. We shouldn't assume control of "heavier" objects such as subvolumes, if the originating object (the root directory) is a "light-weight" object, i.e. a plain directory. Effectively this means that chroot() environments that are run on a plain directory do not have to deal with problems around systemd creating subvolumes that cannot be removed with a simple "rm" anymore. However, if the chroot manager creates a proper subvolume for such an environment it will also get further subvolumes placed in there, under the assumption that the manager understands the concept of subvolumes in that case.
2015-11-16siphash24: change result argument to uint64_tMartin Pitt
Change the "out" parameter from uint8_t[8] to uint64_t. On architectures which enforce pointer alignment this fixes crashes when we previously cast an unaligned array to uint64_t*, and on others this should at least improve performance as the compiler now aligns these properly. This also simplifies the code in most cases by getting rid of typecasts. The only place which we can't change is struct duid's en.id, as that is _packed_ and public API, so we can't enforce alignment of the "id" field and have to use memcpy instead.
2015-11-16siphash24: fix memory alignmentDaniel Mack
Use unaligned_read_le64() to access input buffer when reading complete 64-bit words. This should fix memory traps on platforms with strict aliasing.
2015-11-16basic: add unaligned macros for little endianDaniel Mack
Also add test code for that.
2015-11-16Merge pull request #1886 from poettering/tasks-maxDavid Herrmann
Enable TasksMax by default for all units
2015-11-16virt: sort #includes alphabeticallyMartin Pitt
nitpick from PR #1910
2015-11-16Merge pull request #1908 from phomes/network-memleakDavid Herrmann
network: dhcp6 - fix mem leak
2015-11-16Merge pull request #1906 from poettering/pid-checkDavid Herrmann
machined,logind: be more careful when accepting PIDs and UIDs from clients
2015-11-16nspawn: set TasksMax= for containers to 8192 by defaultLennart Poettering
2015-11-16logind: change default to UserTasksMax= to 4096Lennart Poettering
2015-11-16core: enable TasksMax= for all services by default, and set it to 512Lennart Poettering
Also, enable TasksAccounting= for all services by default, too. See: http://lists.freedesktop.org/archives/systemd-devel/2015-November/035006.html
2015-11-16virt: add missing #includesMartin Pitt
src/basic/virt.c: In function 'detect_vm_device_tree': src/basic/virt.c:117:17: error: unknown type name '_cleanup_closedir_' _cleanup_closedir_ DIR *dir = NULL; src/basic/virt.c:128:17: error: implicit declaration of function 'FOREACH_DIRENT' [-Werror=implicit-function-declaration] FOREACH_DIRENT(dent, dir, return -errno)
2015-11-15network: dhcp6 - fix mem leakThomas Hindoe Paaboel Andersen
from 7a695d8e CID#1338679
2015-11-15machined,logind: be more careful when accepting PIDs and UIDs from clientsLennart Poettering
Always validate first before we start processing the data.
2015-11-15firstboot: log on take_etc_passwd_lock error tooEvgeny Vereshchagin
2015-11-15install: don't mix state and type enumsThomas Hindoe Paaboel Andersen
from 0ec0deaa
2015-11-13core: now that .snapshot unit are gone, we don't need the per-type .no_gc ↵Lennart Poettering
bool anymore
2015-11-13core: simplify scope unit GC checking code a bitLennart Poettering
2015-11-13logind: add a new UserTasksMax= setting to logind.confLennart Poettering
This new setting configures the TasksMax= field for the slice objects we create for each user. This alters logind to create the slice unit as transient unit explicitly instead of relying on implicit generation of slice units by simply starting them. This also enables us to set a friendly description for slice units that way.
2015-11-13logind: don't assert if the slice is missingLennart Poettering
After all, we don't actually really need the slice to work, it's just nice to have it.
2015-11-13core: enable transient unit support for slice unitsLennart Poettering
2015-11-13util-lib: when parsing time values, accept "M" as short for "month"Lennart Poettering
nginx defines an uppercase "M" that way (in contrast to the lowercase "m" for "minute"), and it sounds like an OK logic to follow, so that we understand a true superset of time values nginx understands. http://nginx.org/en/docs/syntax.html
2015-11-13btrfs: properly handle the case when a subvol has no parentLennart Poettering
Don't be confused by subvols without parent. This is after all how the root subvol is set up.
2015-11-13core: add new DefaultTasksMax= setting for system.confLennart Poettering
This allows initializing the TasksMax= setting of all units by default to some fixed value, instead of leaving it at infinity as before.
2015-11-13core: make sure DefaultLimitCPU= and DefaultLimitRTTIME= understand time ↵Lennart Poettering
units, too We added this for the per-unit setting, hence let's enable this for the global default settings too.
2015-11-13Merge pull request #1878 from hbrueckner/for-upstreamKay Sievers
udev/path_id: improve and enhance bus detection for Linux on z Systems
2015-11-13Merge pull request #1881 from michich/analyze-dotLennart Poettering
analyze: dot graph missing Requisite, superfluous ConflictedBy
2015-11-13networkd: check explicit state rather than link->networkTom Gundersen
When deserializing we can now have an attached network without the various clients yet having been configured. Hence, don't misused the link->network as a check to determine if a link is ready to be used, but check the state explicitly.
2015-11-13analyze: do not draw ConflictedBy dependencies in dot graphMichal Schmidt
We already draw Conflicts. I see no reason for having every red line in the graph duplicated in the opposite direction.
2015-11-13networkd: dhcp6 - don't log about losing a lease we never hadTom Gundersen
2015-11-13analyze: show Requisite dependencies in the dot graph againMichal Schmidt
We lost them a long time ago with commit 048ecf5b843.
2015-11-13Merge pull request #1879 from poettering/networkd-forwardTom Gundersen
stop managing per-interface IP forwarding settings
2015-11-13Merge pull request #1869 from poettering/kill-overridableMichal Schmidt
Remove support for RequiresOverridable= and RequisiteOverridable=
2015-11-13networkd: stop managing per-interface IP forwarding settingsLennart Poettering
As it turns out the kernel does not support per-interface IPv6 packet forwarding controls (unlike as it does for IPv4), but only supports a global option (#1597). Also, the current per-interface management of the setting isn't really useful, as you want it to propagate to at least one more interface than the one you configure it on. This created much grief (#1411, #1808). Hence, let's roll this logic back and simplify this again, so that we can expose the same behaviour on IPv4 and IPv6 and things start to work automatically again for most folks: if a network with this setting set is set up we propagate the setting into the global setting, but this is strictly one-way: we never reset it again, and we do nothing for network interfaces where this setting is not enabled. Fixes: #1808, #1597.
2015-11-13networkd: rearrange checks when to write something into sysctl a bitLennart Poettering
Move check whether ipv6 is available into link_ipv6_privacy_extensions() to keep it as internal and early as possible. Always check if there's a network attached to a link before we apply sysctls. We do this for most of the sysctl functions already, with this change we do it for all.
2015-11-13networkd: fix a couple of format string typesLennart Poettering
We really should use %i for ints, and %u for unsigneds, and be careful what we pick depending on the type we want to print.
2015-11-13util-lib: optionally, when writing a string to a file, verify string on failureLennart Poettering
With this change, the idiom: r = write_string_file(p, buf, 0); if (r < 0) { if (verify_one_line_file(p, buf) > 0) r = 0; } gets reduced to: r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE); i.e. when writing the string fails and the new flag WRITE_STRING_FILE_VERIFY_ON_FAILURE is specified we'll not return a failure immediately, but check the contents of the file. If it matches what we wanted to write we suppress the error and exit cleanly.