Age | Commit message (Collapse) | Author |
|
|
|
|
|
Tests for the functions defined in src/basic/parse-util.c. Reorder them
to match the order in which the functions are defined in the source
file. Adjusted the list of include files to remove the ones no longer
needed in test-util.c.
Tested that `make check` still passes as expected. Also checked the
number of lines removed from test-util.c matches the expected, as an
additional verification that no tests were dropped or duplicated in the
move.
|
|
Tests for the functions defined in src/basic/extract-word.c.
Tested that `make check` still passes as expected.
|
|
test-execute: check if nobody exists before running some tests
|
|
|
|
Tested CPUAffinity ranges on both a service unit and in system.conf and
confirmed they work as expected (by inspecting /proc/PID/status, for the
main pid of the service and for pid 1). Also mixed ranges with both
spaces, commas, trailing commas and spaces.
Added new tests to increase coverage of ranges and prevent regressions.
|
|
This function will be useful for CPUAffinity settings that involve
ranges of CPUs.
Make it generic and include test coverage to prevent regressions.
|
|
Tested CPUAffinity settings on both a service unit and in system.conf
and confirmed they work as expected.
Added a new test to confirm that trailing commas and spaces work and to
prevent any regressions in that area.
|
|
In order to match the other get_process_xyz() calls.
|
|
|
|
|
|
|
|
|
|
|
|
capability-util.[ch]
The files are named too generically, so that they might conflict with
the upstream project headers. Hence, let's add a "-util" suffix, to
clarify that this are just our utility headers and not any official
upstream headers.
|
|
|
|
|
|
|
|
Also, move a couple of more path-related functions to path-util.c.
|
|
|
|
|
|
|
|
|
|
|
|
We don't need two functions that do essentialy the same, hence drop
path_get_parent(), and stick to dirname_malloc(), but move it to
path-util.[ch].
|
|
|
|
|
|
So far we had two pretty much identical calls in user-util.[ch]:
lookup_uid() and uid_to_name(). Get rid of the former, in favour of the
latter, and while we are at it, rewrite it, to use getpwuid_r()
correctly, inside an allocation loop, as POSIX intended.
|
|
|
|
|
|
On Oct 25 2015 in EET/EEST there is a UTC+3->UTC+2 transition. This
means that the representation of "today UTC" as local time is ambiguous.
|
|
There are more than enough to deserve their own .c file, hence move them
over.
|
|
string-util.[ch]
There are more than enough calls doing string manipulations to deserve
its own files, hence do something about it.
This patch also sorts the #include blocks of all files that needed to be
updated, according to the sorting suggestions from CODING_STYLE. Since
pretty much every file needs our string manipulation functions this
effectively means that most files have sorted #include blocks now.
Also touches a few unrelated include files.
|
|
This really deserves its own file, given how much code this is now.
|
|
Modernize the code a bit:
- Get rid of FOREACH_WORD_SEPARATOR() loop in favour of a
extract_first_word() loop.
- Remove find_binary()'s "local" flag. It's not reasonably possible to
look for binaries on remote systems, we hence should not pretend we
could.
- When we cannot find a suitable binary, return the last error returned
from access() rather than ENOENT unconditionally.
- Rework fsck_exists() and mkfs_exists() to return 1 on success, 0 if
the implementation is missing and negative on real errors. This is
more like we do it in other functions.
- Make sure we also detect direct fsck symlinks to "true", rather than
just absolute ones to /bin/true.
|
|
btrfs quota beef up and various other unrelated changes
|
|
extract_first_word understands "\'string" but doesn't understand "\"string"
fixed this inconsistency.
|
|
With this change we understand more than just leaf quota groups for
btrfs file systems. Specifically:
- When we create a subvolume we can now optionally add the new subvolume
to all qgroups its parent subvolume was member of too. Alternatively
it is also possible to insert an intermediary quota group between the
parent's qgroups and the subvolume's leaf qgroup, which is useful for
a concept of "subtree" qgroups, that contain a subvolume and all its
children.
- The remove logic for subvolumes has been updated to optionally remove
any leaf qgroups or "subtree" qgroups, following the logic above.
- The snapshot logic for subvolumes has been updated to replicate the
original qgroup setup of the source, if it follows the "subtree"
design described above. It will not cover qgroup setups that introduce
arbitrary qgroups, especially those orthogonal to the subvolume
hierarchy.
This also tries to be more graceful when setting up /var/lib/machines as
btrfs. For example, if mkfs.btrfs is missing we don't even try to set it
up as loopback device.
Fixes #1559
Fixes #1129
|
|
|
|
|
|
cache harddisk passwords in the kernel keyring
|
|
The way to escape a literal dollar sign is to write "$$". But this does
not work right if it's at the beginning of the argument. Fix it.
|
|
This adds support for caching harddisk passwords in the kernel keyring
if it is available, thus supporting caching without Plymouth being
around.
This is also useful for hooking up "gdm-auto-login" with the collected
boot-time harddisk password, in order to support gnome keyring
passphrase unlocking via the HDD password, if it is the same.
Any passwords added to the kernel keyring this way have a timeout of
2.5min at which time they are purged from the kernel.
|
|
Make the API of the new helpers more similar to the old wrapper.
In particular we now return the hash as a byte string to avoid
any endianness problems.
|
|
The purpose of testing with the crippled hash function is to cover
the otherwise very unlikely codepath in bucket_calculate_dib() where
it has to fall back to recomputing the hash value.
This unlikely path was not covered by test-hashmap anymore after
57217c8f "test: hashmap - cripple the hash function by truncating the
input rather than the output".
Restore the test coverage by increasing the number of entries in the test.
The number was determined empirically by checking with lcov.
|
|
hashmap/siphash24: refactor hash functions
|
|
Add support for naming fds for socket activation and more
|
|
This adds support for naming file descriptors passed using socket
activation. The names are passed in a new $LISTEN_FDNAMES= environment
variable, that matches the existign $LISTEN_FDS= one and contains a
colon-separated list of names.
This also adds support for naming fds submitted to the per-service fd
store using FDNAME= in the sd_notify() message.
This also adds a new FileDescriptorName= setting for socket unit files
to set the name for fds created by socket units.
This also adds a new call sd_listen_fds_with_names(), that is similar to
sd_listen_fds(), but also returns the names of the fds.
systemd-activate gained the new --fdname= switch to specify a name for
testing socket activation.
This is based on #1247 by Maciej Wereski.
Fixes #1247.
|
|
All our hash functions are based on siphash24(), factor out
siphash_init() and siphash24_finalize() and pass the siphash
state to the hash functions rather than the hash key.
This simplifies the hash functions, and in particular makes
composition simpler as calling siphash24_compress() repeatedly
on separate chunks of input has the same effect as first
concatenating the input and then calling siphash23_compress()
on the result.
|