1
0
mirror of https://github.com/systemd/systemd synced 2025-12-26 19:04:45 +01:00

Compare commits

..

No commits in common. "3b493d94ae78efcab4caa3678ed160a05cb2d527" and "26a63b81322a3bd8b9fbd43f75897c391708de2c" have entirely different histories.

13 changed files with 18 additions and 22 deletions

View File

@ -274,8 +274,7 @@ static int create_disk(
const char *device,
const char *password,
const char *keydev,
const char *options,
const char *source) {
const char *options) {
_cleanup_free_ char *n = NULL, *d = NULL, *u = NULL, *e = NULL,
*keydev_mount = NULL, *keyfile_timeout_value = NULL,
@ -344,7 +343,7 @@ static int create_disk(
if (r < 0)
return r;
r = generator_write_cryptsetup_unit_section(f, source);
r = generator_write_cryptsetup_unit_section(f, arg_crypttab);
if (r < 0)
return r;
@ -541,7 +540,7 @@ static int parse_proc_cmdline_item(const char *key, const char *value, void *dat
if (proc_cmdline_value_missing(key, value))
return 0;
d = get_crypto_device(startswith(value, "luks-") ?: value);
d = get_crypto_device(startswith(value, "luks-") ? value+5 : value);
if (!d)
return log_oom();
@ -681,7 +680,7 @@ static int add_crypttab_devices(void) {
if (r < 0)
return r;
r = create_disk(name, device, keyfile, keydev, (d && d->options) ? d->options : options, arg_crypttab);
r = create_disk(name, device, keyfile, keydev, (d && d->options) ? d->options : options);
if (r < 0)
return r;
@ -716,8 +715,7 @@ static int add_proc_cmdline_devices(void) {
device,
d->keyfile ?: arg_default_keyfile,
d->keydev,
d->options ?: arg_default_options,
"/proc/cmdline");
d->options ?: arg_default_options);
if (r < 0)
return r;
}

View File

@ -176,7 +176,7 @@ int loop_device_make(
.fd = fd,
.info = {
/* Use the specified flags, but configure the read-only flag from the open flags, and force autoclear */
.lo_flags = (loop_flags & ~LO_FLAGS_READ_ONLY) | ((open_flags & O_ACCMODE) == O_RDONLY ? LO_FLAGS_READ_ONLY : 0) | LO_FLAGS_AUTOCLEAR,
.lo_flags = (loop_flags & ~LO_FLAGS_READ_ONLY) | ((loop_flags & O_ACCMODE) == O_RDONLY ? LO_FLAGS_READ_ONLY : 0) | LO_FLAGS_AUTOCLEAR,
.lo_offset = offset,
.lo_sizelimit = size == UINT64_MAX ? 0 : size,
},
@ -198,7 +198,7 @@ int loop_device_make(
if (loop < 0) {
/* Somebody might've gotten the same number from the kernel, used the device,
* and called LOOP_CTL_REMOVE on it. Let's retry with a new number. */
if (!IN_SET(errno, ENOENT, ENXIO))
if (errno != ENOENT)
return -errno;
} else {
r = loop_configure(loop, &config);

View File

@ -644,8 +644,8 @@ int mount_verbose_full(
log_debug("Moving mount %s → %s (%s \"%s\")...",
what, where, strnull(fl), strempty(o));
else
log_debug("Mounting %s (%s) on %s (%s \"%s\")...",
strna(what), strna(type), where, strnull(fl), strempty(o));
log_debug("Mounting %s on %s (%s \"%s\")...",
strna(type), where, strnull(fl), strempty(o));
if (follow_symlink)
r = mount(what, where, type, f, o) < 0 ? -errno : 0;

View File

@ -318,7 +318,7 @@ static void test_protect_sysctl(void) {
if (pid == 0) {
#if defined __NR__sysctl && __NR__sysctl >= 0
assert_se(syscall(__NR__sysctl, NULL) < 0);
assert_se(IN_SET(errno, EFAULT, ENOSYS));
assert_se(errno == EFAULT);
#endif
assert_se(seccomp_protect_sysctl() >= 0);

View File

@ -76,4 +76,4 @@ test_setup_cleanup() {
cleanup_initdir
}
do_test "$@" 24
do_test "$@" 02

View File

@ -60,4 +60,4 @@ check_result_qemu() {
return $_ret
}
do_test "$@" 02
do_test "$@" 24

View File

@ -7,7 +7,7 @@ if [ $# -gt 0 ]; then
else
args="setup run clean-again"
fi
args_no_clean=$(sed -r 's/\bclean\b//g' <<<$args)
args_no_clean=$(sed -r 's/(^| )clean($| )/ /g' <<<$args)
do_clean=$( [ "$args" = "$args_no_clean" ]; echo $? )
ninja -C "$BUILD_DIR"
@ -26,8 +26,6 @@ if [ $do_clean = 1 ]; then
for TEST in TEST-??-* ; do
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean )
done
[ -n "$args_no_clean" ] || exit 0
fi
pass_blacklist() {

View File

@ -1,7 +1,8 @@
[Unit]
Description=TEST-02-UNITTESTS
Description=TEST-02-CRYPTSETUP
After=multi-user.target
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
ExecStart=sh -x -e -c 'mountpoint /var; systemctl --state=failed --no-legend --no-pager >/failed; echo OK >/testok'
Type=oneshot

View File

@ -1,8 +1,7 @@
[Unit]
Description=TEST-24-CRYPTSETUP
After=multi-user.target
Description=TEST-24-UNIT-TESTS
[Service]
ExecStartPre=rm -f /failed /testok
ExecStart=sh -x -e -c 'mountpoint /var; systemctl --state=failed --no-legend --no-pager >/failed; echo OK >/testok'
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
Type=oneshot