From 92698b0f9e34d69bc97e9ed8830eafaa06f41a46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Jan 2022 10:29:13 +0100 Subject: [PATCH 1/8] core/bpf: avoid unnecessary initialization of variables, tighten scope No funtional change. --- src/core/bpf-lsm.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/src/core/bpf-lsm.c b/src/core/bpf-lsm.c index 8af2da0288..8689efb141 100644 --- a/src/core/bpf-lsm.c +++ b/src/core/bpf-lsm.c @@ -105,9 +105,7 @@ static int mac_bpf_use(void) { return 0; } - const char *p = lsm_list; - - for (;;) { + for (const char *p = lsm_list;;) { _cleanup_free_ char *word = NULL; r = extract_first_word(&p, &word, ",", 0); @@ -181,7 +179,7 @@ int lsm_bpf_supported(void) { } int lsm_bpf_setup(Manager *m) { - struct restrict_fs_bpf *obj = NULL; + struct restrict_fs_bpf *obj; _cleanup_(bpf_link_freep) struct bpf_link *link = NULL; int r; @@ -207,7 +205,6 @@ int lsm_bpf_setup(Manager *m) { } int lsm_bpf_unit_restrict_filesystems(Unit *u, const Set *filesystems, bool allow_list) { - int inner_map_fd = -1, outer_map_fd = -1; uint32_t dummy_value = 1, zero = 0; const char *fs; const statfs_f_type_t *magic; @@ -216,7 +213,7 @@ int lsm_bpf_unit_restrict_filesystems(Unit *u, const Set *filesystems, bool allo assert(filesystems); assert(u); - inner_map_fd = sym_bpf_create_map( + int inner_map_fd = sym_bpf_create_map( BPF_MAP_TYPE_HASH, sizeof(uint32_t), sizeof(uint32_t), @@ -225,7 +222,7 @@ int lsm_bpf_unit_restrict_filesystems(Unit *u, const Set *filesystems, bool allo if (inner_map_fd < 0) return log_unit_error_errno(u, errno, "Failed to create inner LSM map: %m"); - outer_map_fd = sym_bpf_map__fd(u->manager->restrict_fs->maps.cgroup_hash); + int outer_map_fd = sym_bpf_map__fd(u->manager->restrict_fs->maps.cgroup_hash); if (outer_map_fd < 0) return log_unit_error_errno(u, errno, "Failed to get BPF map fd: %m"); @@ -266,8 +263,6 @@ int lsm_bpf_unit_restrict_filesystems(Unit *u, const Set *filesystems, bool allo } int lsm_bpf_cleanup(const Unit *u) { - int fd = -1; - assert(u); assert(u->manager); @@ -277,7 +272,7 @@ int lsm_bpf_cleanup(const Unit *u) { if (!u->manager->restrict_fs) return 0; - fd = sym_bpf_map__fd(u->manager->restrict_fs->maps.cgroup_hash); + int fd = sym_bpf_map__fd(u->manager->restrict_fs->maps.cgroup_hash); if (fd < 0) return log_unit_error_errno(u, errno, "Failed to get BPF map fd: %m"); @@ -350,10 +345,10 @@ int lsm_bpf_parse_filesystem( } NULSTR_FOREACH(i, set->value) { - /* Call ourselves again, for the group to parse. Note that we downgrade logging here (i.e. take - * away the FILESYSTEM_PARSE_LOG flag) since any issues in the group table are our own problem, - * not a problem in user configuration data and we shouldn't pretend otherwise by complaining - * about them. */ + /* Call ourselves again, for the group to parse. Note that we downgrade logging here + * (i.e. take away the FILESYSTEM_PARSE_LOG flag) since any issues in the group table + * are our own problem, not a problem in user configuration data and we shouldn't + * pretend otherwise by complaining about them. */ r = lsm_bpf_parse_filesystem(i, filesystems, flags &~ FILESYSTEM_PARSE_LOG, unit, filename, line); if (r < 0) return r; @@ -363,16 +358,10 @@ int lsm_bpf_parse_filesystem( * we want to allow it, then remove it from the list. */ if (!(flags & FILESYSTEM_PARSE_INVERT) == !!(flags & FILESYSTEM_PARSE_ALLOW_LIST)) { r = set_put_strdup(filesystems, name); - if (r < 0) - switch (r) { - case -ENOMEM: - return flags & FILESYSTEM_PARSE_LOG ? log_oom() : -ENOMEM; - case -EEXIST: - /* Already in set, ignore */ - break; - default: - return r; - } + if (r == -ENOMEM) + return flags & FILESYSTEM_PARSE_LOG ? log_oom() : -ENOMEM; + if (r < 0 && r != -EEXIST) /* When already in set, ignore */ + return r; } else free(set_remove(*filesystems, name)); } From b7cba81553d0d958f23182ba9ab1739842ff9f5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Jan 2022 11:14:18 +0100 Subject: [PATCH 2/8] core/bpf: tighten handling of return values, improve messages The code was written unidiomatically, using r as a boolean value, and confusing errno and r in some places. AFAICS, there wasn't any actual problem: even in the one place where errno was used instead of r, it would almost certainly be initialized. It seems that some libbpf functions set errno, while others return the error, possibly encoded. Since there are almost no docs, the only way to know is to read the code of the function. To make matters worse, there is a global libbpf_mode which can be set to change the convention. With LIBBPF_STRICT_DIRECT_ERRS in libbpf_mode, some functions set errno while others return a negative error, and the only way to know is to read the code, except that the split is now different. We currently don't set LIBBPF_STRICT_DIRECT_ERRS, but even the possibility makes everything harder to grok. This is all very error-prone. Let's at least add some asserts to make sure that the returned values are as expected. --- src/core/bpf-lsm.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/src/core/bpf-lsm.c b/src/core/bpf-lsm.c index 8689efb141..79d17b0751 100644 --- a/src/core/bpf-lsm.c +++ b/src/core/bpf-lsm.c @@ -64,10 +64,10 @@ static int prepare_restrict_fs_bpf(struct restrict_fs_bpf **ret_obj) { /* TODO Maybe choose a number based on runtime information? */ r = sym_bpf_map__resize(obj->maps.cgroup_hash, CGROUP_HASH_SIZE_MAX); - if (r != 0) - return log_error_errno(r, - "Failed to resize BPF map '%s': %m", - sym_bpf_map__name(obj->maps.cgroup_hash)); + assert(r <= 0); + if (r < 0) + return log_error_errno(r, "Failed to resize BPF map '%s': %m", + sym_bpf_map__name(obj->maps.cgroup_hash)); /* Dummy map to satisfy the verifier */ inner_map_fd = sym_bpf_create_map(BPF_MAP_TYPE_HASH, sizeof(uint32_t), sizeof(uint32_t), 128, 0); @@ -75,11 +75,13 @@ static int prepare_restrict_fs_bpf(struct restrict_fs_bpf **ret_obj) { return log_error_errno(errno, "Failed to create BPF map: %m"); r = sym_bpf_map__set_inner_map_fd(obj->maps.cgroup_hash, inner_map_fd); + assert(r <= 0); if (r < 0) return log_error_errno(r, "Failed to set inner map fd: %m"); r = restrict_fs_bpf__load(obj); - if (r) + assert(r <= 0); + if (r < 0) return log_error_errno(r, "Failed to load BPF object"); *ret_obj = TAKE_PTR(obj); @@ -99,9 +101,8 @@ static int mac_bpf_use(void) { r = read_one_line_file("/sys/kernel/security/lsm", &lsm_list); if (r < 0) { - if (errno != ENOENT) - log_debug_errno(r, "Failed to read /sys/kernel/security/lsm, ignoring: %m"); - + if (r != -ENOENT) + log_notice_errno(r, "Failed to read /sys/kernel/security/lsm, assuming bpf is unavailable: %m"); return 0; } @@ -110,21 +111,17 @@ static int mac_bpf_use(void) { r = extract_first_word(&p, &word, ",", 0); if (r == 0) - break; + return 0; if (r == -ENOMEM) return log_oom(); if (r < 0) { - log_debug_errno(r, "Failed to parse /sys/kernel/security/lsm, ignoring: %m"); + log_notice_errno(r, "Failed to parse /sys/kernel/security/lsm, assuming bpf is unavailable: %m"); return 0; } - if (streq(word, "bpf")) { - cached_use = 1; - break; - } + if (streq(word, "bpf")) + return cached_use = 1; } - - return cached_use; } int lsm_bpf_supported(void) { From 333cf6c6ae8860477e0f37cb0af1e074d678f33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Jan 2022 11:29:22 +0100 Subject: [PATCH 3/8] test-job-type: modernize code a bit --- src/test/test-job-type.c | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/src/test/test-job-type.c b/src/test/test-job-type.c index 024d976a75..0a9b6dc249 100644 --- a/src/test/test-job-type.c +++ b/src/test/test-job-type.c @@ -6,27 +6,24 @@ #include "unit.h" int main(int argc, char *argv[]) { - JobType a, b, c, ab, bc, ab_c, bc_a, a_bc; const ServiceState test_states[] = { SERVICE_DEAD, SERVICE_RUNNING }; - unsigned i; - bool merged_ab; - /* fake a unit */ - static Service s = { - .meta.load_state = UNIT_LOADED, - .type = SERVICE_SIMPLE, - }; - Unit *u = UNIT(&s); + for (size_t i = 0; i < ELEMENTSOF(test_states); i++) { + /* fake a unit */ + Service s = { + .meta.load_state = UNIT_LOADED, + .type = SERVICE_SIMPLE, + .state = test_states[i], + }; + Unit *u = UNIT(&s); - for (i = 0; i < ELEMENTSOF(test_states); i++) { - s.state = test_states[i]; printf("\nWith collapsing for service state %s\n" "=========================================\n", service_state_to_string(s.state)); - for (a = 0; a < _JOB_TYPE_MAX_MERGING; a++) { - for (b = 0; b < _JOB_TYPE_MAX_MERGING; b++) { + for (JobType a = 0; a < _JOB_TYPE_MAX_MERGING; a++) { + for (JobType b = 0; b < _JOB_TYPE_MAX_MERGING; b++) { - ab = a; - merged_ab = (job_type_merge_and_collapse(&ab, b, u) >= 0); + JobType ab = a; + bool merged_ab = job_type_merge_and_collapse(&ab, b, u) >= 0; if (!job_type_is_mergeable(a, b)) { assert_se(!merged_ab); @@ -37,7 +34,7 @@ int main(int argc, char *argv[]) { assert_se(merged_ab); printf("%s + %s = %s\n", job_type_to_string(a), job_type_to_string(b), job_type_to_string(ab)); - for (c = 0; c < _JOB_TYPE_MAX_MERGING; c++) { + for (JobType c = 0; c < _JOB_TYPE_MAX_MERGING; c++) { /* Verify transitivity of mergeability of job types */ assert_se(!job_type_is_mergeable(a, b) || @@ -53,18 +50,18 @@ int main(int argc, char *argv[]) { * either a or b is not mergeable with c either. */ assert_se(job_type_is_mergeable(ab, c) || !job_type_is_mergeable(a, c) || !job_type_is_mergeable(b, c)); - bc = b; + JobType bc = b; if (job_type_merge_and_collapse(&bc, c, u) >= 0) { /* Verify associativity */ - ab_c = ab; + JobType ab_c = ab; assert_se(job_type_merge_and_collapse(&ab_c, c, u) == 0); - bc_a = bc; + JobType bc_a = bc; assert_se(job_type_merge_and_collapse(&bc_a, a, u) == 0); - a_bc = a; + JobType a_bc = a; assert_se(job_type_merge_and_collapse(&a_bc, bc, u) == 0); assert_se(ab_c == bc_a); From 606309d55469eb7b935c0b65ca39ba10dd4b98de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Jan 2022 14:33:35 +0100 Subject: [PATCH 4/8] test-bpf-lsm: drop some parens --- src/test/test-bpf-lsm.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/test-bpf-lsm.c b/src/test/test-bpf-lsm.c index 258c2e575e..3022767295 100644 --- a/src/test/test-bpf-lsm.c +++ b/src/test/test-bpf-lsm.c @@ -51,13 +51,11 @@ static int test_restrict_filesystems(Manager *m, const char *unit_name, const ch } cld_code = SERVICE(u)->exec_command[SERVICE_EXEC_START]->exec_status.code; - if (cld_code != CLD_EXITED) { + if (cld_code != CLD_EXITED) return log_error_errno(-SYNTHETIC_ERRNO(EBUSY), "ExecStart didn't exited, code='%s'", sigchld_code_to_string(cld_code)); - } - if (SERVICE(u)->state != SERVICE_DEAD) { + if (SERVICE(u)->state != SERVICE_DEAD) return log_error_errno(-SYNTHETIC_ERRNO(EBUSY), "Service is not dead"); - } return 0; } From 3c7af1af7dfc79b6f95814a1cb704be90c74de69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Tue, 28 Dec 2021 15:47:08 +0100 Subject: [PATCH 5/8] basic: adjust wording and wrapping of comments --- src/basic/path-util.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 4c952d863c..42fae3d992 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -1237,8 +1237,6 @@ char *file_in_same_dir(const char *path, const char *filename) { } bool hidden_or_backup_file(const char *filename) { - const char *p; - assert(filename); if (filename[0] == '.' || @@ -1248,24 +1246,25 @@ bool hidden_or_backup_file(const char *filename) { endswith(filename, "~")) return true; - p = strrchr(filename, '.'); - if (!p) + const char *dot = strrchr(filename, '.'); + if (!dot) return false; - /* Please, let's not add more entries to the list below. If external projects think it's a good idea to come up - * with always new suffixes and that everybody else should just adjust to that, then it really should be on - * them. Hence, in future, let's not add any more entries. Instead, let's ask those packages to instead adopt - * one of the generic suffixes/prefixes for hidden files or backups, possibly augmented with an additional - * string. Specifically: there's now: + /* Please, let's not add more entries to the list below. If external projects think it's a good idea + * to come up with always new suffixes and that everybody else should just adjust to that, then it + * really should be on them. Hence, in future, let's not add any more entries. Instead, let's ask + * those packages to instead adopt one of the generic suffixes/prefixes for hidden files or backups, + * possibly augmented with an additional string. Specifically: there's now: * * The generic suffixes "~" and ".bak" for backup files * The generic prefix "." for hidden files * - * Thus, if a new package manager "foopkg" wants its own set of ".foopkg-new", ".foopkg-old", ".foopkg-dist" - * or so registered, let's refuse that and ask them to use ".foopkg.new", ".foopkg.old" or ".foopkg~" instead. + * Thus, if a new package manager "foopkg" wants its own set of ".foopkg-new", ".foopkg-old", + * ".foopkg-dist" or so registered, let's refuse that and ask them to use ".foopkg.new", + * ".foopkg.old" or ".foopkg~" instead. */ - return STR_IN_SET(p + 1, + return STR_IN_SET(dot + 1, "rpmnew", "rpmsave", "rpmorig", @@ -1287,15 +1286,16 @@ bool hidden_or_backup_file(const char *filename) { bool is_device_path(const char *path) { - /* Returns true on paths that likely refer to a device, either by path in sysfs or to something in /dev */ + /* Returns true for paths that likely refer to a device, either by path in sysfs or to something in + * /dev. */ return PATH_STARTSWITH_SET(path, "/dev/", "/sys/"); } bool valid_device_node_path(const char *path) { - /* Some superficial checks whether the specified path is a valid device node path, all without looking at the - * actual device node. */ + /* Some superficial checks whether the specified path is a valid device node path, all without + * looking at the actual device node. */ if (!PATH_STARTSWITH_SET(path, "/dev/", "/run/systemd/inaccessible/")) return false; @@ -1309,8 +1309,8 @@ bool valid_device_node_path(const char *path) { bool valid_device_allow_pattern(const char *path) { assert(path); - /* Like valid_device_node_path(), but also allows full-subsystem expressions, like DeviceAllow= and DeviceDeny= - * accept it */ + /* Like valid_device_node_path(), but also allows full-subsystem expressions like those accepted by + * DeviceAllow= and DeviceDeny=. */ if (STARTSWITH_SET(path, "block-", "char-")) return true; @@ -1401,8 +1401,8 @@ bool dot_or_dot_dot(const char *path) { bool empty_or_root(const char *path) { - /* For operations relative to some root directory, returns true if the specified root directory is redundant, - * i.e. either / or NULL or the empty string or any equivalent. */ + /* For operations relative to some root directory, returns true if the specified root directory is + * redundant, i.e. either / or NULL or the empty string or any equivalent. */ if (isempty(path)) return true; From df1f621bda3b082bcdb0454f8b0138e3aaf2764b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 23 Dec 2021 21:25:31 +0100 Subject: [PATCH 6/8] docs: update branch names Also use --atomic when pushing multiple items with git; adjust some external URLs. --- docs/CODE_QUALITY.md | 8 ++++---- docs/CONTAINER_INTERFACE.md | 22 +++++++++++----------- docs/CONTRIBUTING.md | 2 +- docs/JOURNAL_NATIVE_PROTOCOL.md | 2 +- docs/RELEASE.md | 2 +- docs/UIDS-GIDS.md | 2 +- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docs/CODE_QUALITY.md b/docs/CODE_QUALITY.md index 4b76a1055e..b1f7dd109e 100644 --- a/docs/CODE_QUALITY.md +++ b/docs/CODE_QUALITY.md @@ -51,8 +51,8 @@ available functionality: 9. There are multiple CI systems in use that run on every github PR submission. -10. [Coverity](https://scan.coverity.com/) is analyzing systemd master in - regular intervals. The reports are available +10. [Coverity](https://scan.coverity.com/) is analyzing systemd `main` branch + in regular intervals. The reports are available [online](https://scan.coverity.com/projects/systemd). 11. [oss-fuzz](https://oss-fuzz.com/) is continuously fuzzing the @@ -65,7 +65,7 @@ available functionality: 13. When building systemd from a git checkout the build scripts will automatically enable a git commit hook that ensures whitespace cleanliness. -14. [LGTM](https://lgtm.com/) analyzes every commit pushed to master. The list +14. [LGTM](https://lgtm.com/) analyzes every commit pushed to `main`. The list of active alerts can be found [here](https://lgtm.com/projects/g/systemd/systemd/alerts/?mode=list). @@ -75,7 +75,7 @@ available functionality: for more information. 16. Fossies provides [source code misspelling reports](https://fossies.org/features.html#codespell). - The systemd report can be found [here](https://fossies.org/linux/test/systemd-master.tar.gz/codespell.html). + The systemd report can be found [here](https://fossies.org/linux/misc/systemd/codespell.html). Access to Coverity and oss-fuzz reports is limited. Please reach out to the maintainers if you need access. diff --git a/docs/CONTAINER_INTERFACE.md b/docs/CONTAINER_INTERFACE.md index 7caa9eeea9..57036e622e 100644 --- a/docs/CONTAINER_INTERFACE.md +++ b/docs/CONTAINER_INTERFACE.md @@ -37,18 +37,18 @@ manager, please consider supporting the following interfaces. in this context.) 3. Pre-mount `/dev/` as (container private) `tmpfs` for the container and bind - mount some suitable TTY to `/dev/console`. If this is a pty, make sure to not - close the controlling pty master during systemd's lifetime. PID1 will close + mount some suitable TTY to `/dev/console`. If this is a pty, make sure to + not close the controlling pty during systemd's lifetime. PID1 will close ttys, to avoid being killed by SAK. It only opens ttys for the time it - actually needs to print something. Also, make sure to create device - nodes for `/dev/null`, `/dev/zero`, `/dev/full`, `/dev/random`, - `/dev/urandom`, `/dev/tty`, `/dev/ptmx` in `/dev/`. It is not necessary to - create `/dev/fd` or `/dev/stdout`, as systemd will do that on its own. Make - sure to set up a `BPF_PROG_TYPE_CGROUP_DEVICE` BPF program — on cgroupv2 — - or the `devices` cgroup controller — on cgroupv1 — so that no other devices - but these may be created in the container. Note that many systemd services - use `PrivateDevices=`, which means that systemd will set up a private - `/dev/` for them for which it needs to be able to create these device nodes. + actually needs to print something. Also, make sure to create device nodes + for `/dev/null`, `/dev/zero`, `/dev/full`, `/dev/random`, `/dev/urandom`, + `/dev/tty`, `/dev/ptmx` in `/dev/`. It is not necessary to create `/dev/fd` + or `/dev/stdout`, as systemd will do that on its own. Make sure to set up a + `BPF_PROG_TYPE_CGROUP_DEVICE` BPF program — on cgroupv2 — or the `devices` + cgroup controller — on cgroupv1 — so that no other devices but these may be + created in the container. Note that many systemd services use + `PrivateDevices=`, which means that systemd will set up a private `/dev/` + for them for which it needs to be able to create these device nodes. Dropping `CAP_MKNOD` for containers is hence generally not advisable, but see below. diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 67ebcf3b96..ebfc31aa20 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -31,7 +31,7 @@ See [reporting of security vulnerabilities](SECURITY.md). ## Posting Pull Requests -* Make sure to post PRs only relative to a very recent git master. +* Make sure to post PRs only relative to a very recent git tip. * Follow our [Coding Style](CODING_STYLE.md) when contributing code. This is a requirement for all code we merge. * Please make sure to test your change before submitting the PR. See the [Hacking guide](HACKING.md) for details on how to do this. * Make sure to run the test suite locally, before posting your PR. We use a CI system, meaning we don't even look at your PR, if the build and tests don't pass. diff --git a/docs/JOURNAL_NATIVE_PROTOCOL.md b/docs/JOURNAL_NATIVE_PROTOCOL.md index 657eca25a0..855f6acf30 100644 --- a/docs/JOURNAL_NATIVE_PROTOCOL.md +++ b/docs/JOURNAL_NATIVE_PROTOCOL.md @@ -185,7 +185,7 @@ took place for the current program. If you are looking for alternative implementations of this protocol (besides systemd's own in `sd_journal_print()`), consider -[GLib's](https://gitlab.gnome.org/GNOME/glib/-/blob/master/glib/gmessages.c) or +[GLib's](https://gitlab.gnome.org/GNOME/glib/-/blob/main/glib/gmessages.c) or [`dbus-broker`'s](https://github.com/bus1/dbus-broker/blob/main/src/util/log.c). And that's already all there is to it. diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 168f957c70..c5da09b62c 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -21,4 +21,4 @@ SPDX-License-Identifier: LGPL-2.1-or-later 12. "Draft" a new release on github (https://github.com/systemd/systemd/releases/new), mark "This is a pre-release" if appropriate. 13. Check that announcement to systemd-devel, with a copy&paste from NEWS, was sent. This should happen automatically. 14. Update IRC topic (`/msg chanserv TOPIC #systemd Version NNN released`) -15. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable origin/master:master origin/master:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches). +15. [FINAL] Push commits to stable, create an empty -stable branch: `git push systemd-stable --atomic origin/main:main origin/main:refs/heads/${version}-stable`, and change the default branch to latest release (https://github.com/systemd/systemd-stable/settings/branches). diff --git a/docs/UIDS-GIDS.md b/docs/UIDS-GIDS.md index ea7ec63965..d3b7c2fe9e 100644 --- a/docs/UIDS-GIDS.md +++ b/docs/UIDS-GIDS.md @@ -81,7 +81,7 @@ available during earliest boot, including in the initial RAM disk). above). However, it does define some special group/GID assignments, which are primarily used for `systemd-udevd`'s device management. The precise list of the currently defined groups is found in this `sysusers.d` snippet: -[basic.conf](https://raw.githubusercontent.com/systemd/systemd/master/sysusers.d/basic.conf.in) +[basic.conf](https://raw.githubusercontent.com/systemd/systemd/main/sysusers.d/basic.conf.in) It's strongly recommended that downstream distributions include these groups in their default group databases. From b36c5e958708a9c53252c9f574f192152ec7e7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Jan 2022 21:15:06 +0100 Subject: [PATCH 7/8] various: fix three spelling issues found by fossies --- .clang-format | 2 +- .github/workflows/run_mkosi.sh | 4 ++-- src/boot/efi/console.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.clang-format b/.clang-format index 651249c701..8d50be42e7 100644 --- a/.clang-format +++ b/.clang-format @@ -1,7 +1,7 @@ # This configuration file can be used to auto-format the code base. # Not all guidelines specified in CODING_STYLE are followed, so the # result MUST NOT be committed indiscriminately, but each automated -# change should be reviewed and only the appropriate ones commited. +# change should be reviewed and only the appropriate ones committed. # # The easiest way to apply the formatting to your changes ONLY, # is to use the git-clang-format script (usually installed with clang-format). diff --git a/.github/workflows/run_mkosi.sh b/.github/workflows/run_mkosi.sh index e8803239aa..980fa1a96c 100755 --- a/.github/workflows/run_mkosi.sh +++ b/.github/workflows/run_mkosi.sh @@ -13,7 +13,7 @@ for ((i = 0; i < 5; i++)); do EC=0 (sudo python3 -m mkosi "$@") |& tee "$TEMPFILE" || EC=$? if [[ $EC -eq 0 ]]; then - # The command passed - let's return immediatelly + # The command passed — let's return immediately break fi @@ -23,7 +23,7 @@ for ((i = 0; i < 5; i++)); do exit $EC fi - # The command failed due to the dissect-related timeout - let's try again + # The command failed due to the dissect-related timeout — let's try again sleep 1 done diff --git a/src/boot/efi/console.c b/src/boot/efi/console.c index 89fbd94258..86cd15a235 100644 --- a/src/boot/efi/console.c +++ b/src/boot/efi/console.c @@ -32,7 +32,7 @@ static inline void EventClosep(EFI_EVENT *event) { * Also, multiple input protocols can be backed by the same device, but they can be out of * sync. Falling back on a different protocol can end up with double input. * - * Therefore, we will perferrably use TextInputEx for ConIn if that is available. Additionally, + * Therefore, we will preferably use TextInputEx for ConIn if that is available. Additionally, * we look for the first TextInputEx device the firmware gives us as a fallback option. It * will replace ConInEx permanently if it ever reports a key press. * Lastly, a timer event allows us to provide a input timeout without having to call into From acee2a25530aff0615900c2ec05c100913595b26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 3 Jan 2022 21:19:06 +0100 Subject: [PATCH 8/8] po: drop Project-Id-Version from header template Since they were pretty inconsistent anyway, let's assume that they don't matter. --- po/be.po | 1 - po/be@latin.po | 1 - po/bg.po | 1 - po/ca.po | 1 - po/cs.po | 1 - po/da.po | 1 - po/de.po | 1 - po/el.po | 1 - po/es.po | 1 - po/fi.po | 1 - po/fr.po | 1 - po/gl.po | 1 - po/hr.po | 1 - po/hu.po | 1 - po/id.po | 1 - po/it.po | 1 - po/ja.po | 1 - po/kab.po | 1 - po/ko.po | 1 - po/lt.po | 1 - po/nl.po | 1 - po/pa.po | 1 - po/pl.po | 1 - po/pt.po | 1 - po/pt_BR.po | 1 - po/ro.po | 1 - po/ru.po | 1 - po/si.po | 1 - po/sk.po | 1 - po/sr.po | 1 - po/sv.po | 1 - po/systemd.pot | 1 - po/tr.po | 1 - po/uk.po | 1 - po/zh_CN.po | 1 - po/zh_TW.po | 1 - 36 files changed, 36 deletions(-) diff --git a/po/be.po b/po/be.po index f34c0f8c56..e143fb7587 100644 --- a/po/be.po +++ b/po/be.po @@ -7,7 +7,6 @@ # Zmicer Turok , 2020, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-01-10 18:36+0000\n" diff --git a/po/be@latin.po b/po/be@latin.po index 28654885b1..394bff8f0d 100644 --- a/po/be@latin.po +++ b/po/be@latin.po @@ -6,7 +6,6 @@ # Viktar Vaŭčkievič , 2015, 2016. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2016-06-09 19:50+0300\n" diff --git a/po/bg.po b/po/bg.po index 3ab13ffa9d..53356397e0 100644 --- a/po/bg.po +++ b/po/bg.po @@ -6,7 +6,6 @@ # msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2016-05-14 13:28+0300\n" diff --git a/po/ca.po b/po/ca.po index 0cb2e497e7..eb33b88474 100644 --- a/po/ca.po +++ b/po/ca.po @@ -5,7 +5,6 @@ # Robert Antoni Buj Gelonch , 2018. #zanata msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2018-02-27 04:18-0500\n" diff --git a/po/cs.po b/po/cs.po index b76d5a1faa..57f06bf589 100644 --- a/po/cs.po +++ b/po/cs.po @@ -4,7 +4,6 @@ # msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2020-10-26 22:48+0100\n" diff --git a/po/da.po b/po/da.po index 7941c6ba25..443b0b0004 100644 --- a/po/da.po +++ b/po/da.po @@ -5,7 +5,6 @@ # scootergrisen , 2020, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-06-02 16:03+0000\n" diff --git a/po/de.po b/po/de.po index e52216bfb7..bb735e9d4a 100644 --- a/po/de.po +++ b/po/de.po @@ -9,7 +9,6 @@ # Christian Wehrli , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-11-08 00:49+0000\n" diff --git a/po/el.po b/po/el.po index 7d992885d4..7a6b6645f3 100644 --- a/po/el.po +++ b/po/el.po @@ -5,7 +5,6 @@ # Dimitris Spingos (Δημήτρης Σπίγγος) , 2014. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2014-04-29 09:17+0300\n" diff --git a/po/es.po b/po/es.po index c7fc862d1c..212ad70a95 100644 --- a/po/es.po +++ b/po/es.po @@ -8,7 +8,6 @@ # Emilio Herrera , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-08-26 18:05+0000\n" diff --git a/po/fi.po b/po/fi.po index 222f5753e6..10ea364df5 100644 --- a/po/fi.po +++ b/po/fi.po @@ -4,7 +4,6 @@ # Jan Kuparinen , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-09-14 19:04+0000\n" diff --git a/po/fr.po b/po/fr.po index 0e791fc577..bee6792a2b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -7,7 +7,6 @@ # Arnaud T. , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-01-14 06:37+0000\n" diff --git a/po/gl.po b/po/gl.po index babdfd25bc..e57925245f 100644 --- a/po/gl.po +++ b/po/gl.po @@ -3,7 +3,6 @@ # Fran Dieguez , 2015. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2019-12-29 22:30+0100\n" diff --git a/po/hr.po b/po/hr.po index f80bf74a5c..d475e6e38c 100644 --- a/po/hr.po +++ b/po/hr.po @@ -6,7 +6,6 @@ # Gogo Gogsi , 2020, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-10-03 16:04+0000\n" diff --git a/po/hu.po b/po/hu.po index 3a1d36dfe0..5044f4ded1 100644 --- a/po/hu.po +++ b/po/hu.po @@ -7,7 +7,6 @@ # Balázs Úr , 2016. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2016-08-23 18:03+0100\n" diff --git a/po/id.po b/po/id.po index 79d2482ed8..3957a03bc1 100644 --- a/po/id.po +++ b/po/id.po @@ -4,7 +4,6 @@ # Andika Triwidada , 2014, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-09-24 11:05+0000\n" diff --git a/po/it.po b/po/it.po index 42156d5a1d..8fb83112ab 100644 --- a/po/it.po +++ b/po/it.po @@ -5,7 +5,6 @@ # Daniele Medri , 2013-2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-01-08 17:51+0100\n" diff --git a/po/ja.po b/po/ja.po index a4d519a6c2..56a30b790b 100644 --- a/po/ja.po +++ b/po/ja.po @@ -5,7 +5,6 @@ # Takuro Onoue , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-09-09 03:04+0000\n" diff --git a/po/kab.po b/po/kab.po index 528eb479fd..0d6fb12bf0 100644 --- a/po/kab.po +++ b/po/kab.po @@ -4,7 +4,6 @@ # Slimane Selyan Amiri , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-10-03 16:04+0000\n" diff --git a/po/ko.po b/po/ko.po index 8f5e1e6a90..48f9d3d173 100644 --- a/po/ko.po +++ b/po/ko.po @@ -6,7 +6,6 @@ # simmon , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-06-22 10:04+0000\n" diff --git a/po/lt.po b/po/lt.po index c8eac85909..2a9b62a708 100644 --- a/po/lt.po +++ b/po/lt.po @@ -3,7 +3,6 @@ # Moo, 2018. #zanata msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2019-04-08 22:01+0300\n" diff --git a/po/nl.po b/po/nl.po index b02f6c43bf..6285450d6d 100644 --- a/po/nl.po +++ b/po/nl.po @@ -4,7 +4,6 @@ # Pjotr Vertaalt , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-03-24 09:16+0000\n" diff --git a/po/pa.po b/po/pa.po index 892a8e105b..4a71ddaf2f 100644 --- a/po/pa.po +++ b/po/pa.po @@ -3,7 +3,6 @@ # A S Alam , 2020, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-01-24 16:38+0000\n" diff --git a/po/pl.po b/po/pl.po index a4251187fa..e165003256 100644 --- a/po/pl.po +++ b/po/pl.po @@ -4,7 +4,6 @@ # msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2020-10-18 13:10+0200\n" diff --git a/po/pt.po b/po/pt.po index f8aea6f87b..e97b7ec6bf 100644 --- a/po/pt.po +++ b/po/pt.po @@ -4,7 +4,6 @@ # Hugo Carvalho , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-09-16 18:04+0000\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index 89d8467e97..9da6cebc8d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -7,7 +7,6 @@ # Gustavo Costa , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-08-17 07:04+0000\n" diff --git a/po/ro.po b/po/ro.po index 1dd04fc210..d3fb332ac4 100644 --- a/po/ro.po +++ b/po/ro.po @@ -6,7 +6,6 @@ # Vlad , 2020, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-01-12 17:36+0000\n" diff --git a/po/ru.po b/po/ru.po index e3cd42a621..1009a85a11 100644 --- a/po/ru.po +++ b/po/ru.po @@ -8,7 +8,6 @@ # Alexey Rubtsov , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-07-02 09:04+0000\n" diff --git a/po/si.po b/po/si.po index 8c9e870cfa..c7ceb1ecc5 100644 --- a/po/si.po +++ b/po/si.po @@ -4,7 +4,6 @@ # Hela Basa , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-08-19 07:04+0000\n" diff --git a/po/sk.po b/po/sk.po index 5d9d28c4ee..044c4ac47f 100644 --- a/po/sk.po +++ b/po/sk.po @@ -5,7 +5,6 @@ # Frantisek Sumsal , 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-02-22 20:21+0000\n" diff --git a/po/sr.po b/po/sr.po index df2f59d46f..de47076b0d 100644 --- a/po/sr.po +++ b/po/sr.po @@ -4,7 +4,6 @@ # Frantisek Sumsal , 2021. msgid "" msgstr "" -"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-02-23 22:40+0000\n" diff --git a/po/sv.po b/po/sv.po index 5d141c2741..af80c0e7ec 100644 --- a/po/sv.po +++ b/po/sv.po @@ -8,7 +8,6 @@ # Luna Jernberg , 2020. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-02-10 15:40+0000\n" diff --git a/po/systemd.pot b/po/systemd.pot index 8e900b0d7c..c1f0066e46 100644 --- a/po/systemd.pot +++ b/po/systemd.pot @@ -3,7 +3,6 @@ #, fuzzy msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" diff --git a/po/tr.po b/po/tr.po index df901f16d8..8a752aa81e 100644 --- a/po/tr.po +++ b/po/tr.po @@ -7,7 +7,6 @@ # Muhammet Kara , 2015-2020. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2020-11-28 13:35+0000\n" diff --git a/po/uk.po b/po/uk.po index 6343db3a8f..37fec88f87 100644 --- a/po/uk.po +++ b/po/uk.po @@ -6,7 +6,6 @@ # Yuri Chornoivan , 2019, 2020, 2021. msgid "" msgstr "" -"Project-Id-Version: systemd master\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-01-09 10:51+0000\n" diff --git a/po/zh_CN.po b/po/zh_CN.po index 2b5f3969aa..b283b90afb 100644 --- a/po/zh_CN.po +++ b/po/zh_CN.po @@ -8,7 +8,6 @@ # Whired Planck , 2020. msgid "" msgstr "" -"Project-Id-Version: systemd\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-03-01 09:40+0000\n" diff --git a/po/zh_TW.po b/po/zh_TW.po index 4b297aa43d..68ade44f80 100644 --- a/po/zh_TW.po +++ b/po/zh_TW.po @@ -5,7 +5,6 @@ # pan93412 , 2019. msgid "" msgstr "" -"Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-01-08 17:48+0100\n" "PO-Revision-Date: 2021-08-10 11:36+0800\n"