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

Compare commits

...

17 Commits

Author SHA1 Message Date
Luca Boccassi
bf1868c8d7
Merge pull request #18254 from keszybz/trivial-cleanups
Assorted small cleanups
2021-01-15 14:00:06 +00:00
Lennart Poettering
061e9fc5f1
Merge pull request #18214 from elmarco/vsock
udev: allow kvm group to access vhost net and vsock devices
2021-01-15 11:43:15 +01:00
Zbigniew Jędrzejewski-Szmek
0a219363bf
Merge pull request #18197 from weblate/weblate-systemd-master
Translations update from Weblate
2021-01-15 11:10:43 +01:00
Zbigniew Jędrzejewski-Szmek
3b41c4dfbc
Merge pull request #18244 from anitazha/systemctledit
systemctl-edit fixes
2021-01-15 11:07:02 +01:00
Zbigniew Jędrzejewski-Szmek
5b935a388c basic/env-util: modernization 2021-01-15 10:33:29 +01:00
Zbigniew Jędrzejewski-Szmek
d2b99ed7c5 nspawn: minor modernization 2021-01-15 10:33:29 +01:00
Zbigniew Jędrzejewski-Szmek
0c659eb805 sysctl.d: shorten comment
The grammar was a bit suspect in a few places...
2021-01-15 10:33:29 +01:00
Zbigniew Jędrzejewski-Szmek
8b273a478d man: s/dash/mdash/ 2021-01-15 10:33:28 +01:00
Anita Zhang
e4d22a9f32 systemctl-edit: Add missing ret_dropin_paths argument in retry path
find_paths_to_edit() makes 2 calls to unit_find_paths(), one of which is
a retry client-side. ret_dropin_paths should be passed the same in
both cases.
2021-01-14 15:05:30 -08:00
Anita Zhang
98199724cb systemctl-edit: fix abort in find_paths_to_edit()
After 85c5d313b5c92115f5c77663e736bcf21e99f02f, if you, for example,
create a drop-in for -.slice without a corresponding -.slice file, you will
get the following:

  # put some valid stuff in /etc/systemd/system/-.slice.d/override.conf

  [root@image ~]# systemctl daemon-reload
  [root@image ~]# systemctl edit -- -.slice
  Assertion 'path' failed at src/systemctl/systemctl-edit.c:425, function
  find_paths_to_edit(). Aborting.
  Aborted

The aforementioned commit sets the ret_dropin_paths argument for
unit_find_paths(). Thus, unit_find_paths() returns 1 in the example above
because it finds a relevant drop-in. However find_paths_to_edit() was written
to expect 1 only if the unit file itself exists (it does not in this example).

To make this behave more like the version of `systemctl edit` prior to
this commit, add an additional check so the code enters the
"unit file not found" code branch.
2021-01-14 15:05:27 -08:00
Julien Humbert
c42b6ec4d7 Translated using Weblate (French)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Julien Humbert <julroy67@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/fr/
Translation: systemd/master
2021-01-14 07:37:59 +01:00
Vlad
a61d1201c7 Translated using Weblate (Romanian)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Vlad <milovlad@outlook.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/ro/
Translation: systemd/master
2021-01-14 07:37:59 +01:00
Weblate
081c63c99e Update translation files
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/
Translation: systemd/master
2021-01-14 07:37:59 +01:00
Zmicer Turok
fe04aa94c6 Translated using Weblate (Belarusian)
Currently translated at 100.0% (189 of 189 strings)

Co-authored-by: Zmicer Turok <nashtlumach@gmail.com>
Translate-URL: https://translate.fedoraproject.org/projects/systemd/master/be/
Translation: systemd/master
2021-01-14 07:37:59 +01:00
Marc-André Lureau
f65efddd1c udev: allow kvm group to access vhost-net device
/dev/vhost-net is a host accelerator for virtio net devices. It has been
long available and used, thus should be safe to all KVM users.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-01-13 13:12:26 +04:00
Marc-André Lureau
c78939d565 udev: allow kvm group to access vhost-vsock device
/dev/vhost-vsock allows to setup a guest CID and running
state (VHOST_VSOCK_SET_GUEST_CID, VHOST_VSOCK_SET_RUNNING)

All this should be legitimate and safe for KVM users.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-01-13 13:10:19 +04:00
Marc-André Lureau
c4446798fa udev: make /dev/vsock 0666
/dev/vsock supports only ioctl (the only ioctl supported is
IOCTL_VM_SOCKETS_GET_LOCAL_CID), so 0666 should be okay, or 0664 if in
the future we will implement some kind of write support exposed only to
user/group.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2021-01-13 12:59:43 +04:00
10 changed files with 48 additions and 87 deletions

View File

@ -94,7 +94,7 @@
<row>
<entry><varname>powervm</varname></entry>
<entry>IBM PowerVM hypervisor - comes as firmware with some IBM POWER servers</entry>
<entry>IBM PowerVM hypervisor comes as firmware with some IBM POWER servers</entry>
</row>
<row>

View File

@ -4,13 +4,13 @@
#
#
# Viktar Vaŭčkievič <victorenator@gmail.com>, 2015, 2016.
# Zmicer Turok <nashtlumach@gmail.com>, 2020.
# Zmicer Turok <nashtlumach@gmail.com>, 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: 2020-10-16 06:30+0000\n"
"PO-Revision-Date: 2021-01-10 18:36+0000\n"
"Last-Translator: Zmicer Turok <nashtlumach@gmail.com>\n"
"Language-Team: Belarusian <https://translate.fedoraproject.org/projects/"
"systemd/master/be/>\n"
@ -20,7 +20,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
"X-Generator: Weblate 4.2.2\n"
"X-Generator: Weblate 4.4\n"
#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
@ -308,22 +308,17 @@ msgstr ""
"ноўтбука, патрабуецца аўтэнтыфікацыя."
#: src/login/org.freedesktop.login1.policy:117
#, fuzzy
#| msgid "Allow applications to inhibit system handling of the power key"
msgid "Allow applications to inhibit system handling of the reboot key"
msgstr "Дазволіць праграмам перашкаджаць сістэме апрацоўваць кнопку выключэння"
msgstr ""
"Дазволіць праграмам перашкаджаць сістэме апрацоўваць кнопку перазапуску"
#: src/login/org.freedesktop.login1.policy:118
#, fuzzy
#| msgid ""
#| "Authentication is required for an application to inhibit system handling "
#| "of the power key."
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the reboot key."
msgstr ""
"Для таго, каб дазволіць праграмам перашкаджаць сістэме апрацоўваць кнопку "
"выключэння, патрабуецца аўтэнтыфікацыя."
"перазапуску, патрабуецца аўтэнтыфікацыя."
#: src/login/org.freedesktop.login1.policy:128
msgid "Allow non-logged-in user to run programs"

View File

@ -10,8 +10,8 @@ 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-09 10:48+0000\n"
"Last-Translator: Arnaud T. <listes.00@gmail.com>\n"
"PO-Revision-Date: 2021-01-14 06:37+0000\n"
"Last-Translator: Julien Humbert <julroy67@gmail.com>\n"
"Language-Team: French <https://translate.fedoraproject.org/projects/systemd/"
"master/fr/>\n"
"Language: fr\n"
@ -19,7 +19,7 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=n > 1;\n"
"X-Generator: Weblate 4.4\n"
"X-Generator: Weblate 4.4.1\n"
#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
@ -324,24 +324,18 @@ msgstr ""
"gestion par le système du rabat de lécran."
#: src/login/org.freedesktop.login1.policy:117
#, fuzzy
#| msgid "Allow applications to inhibit system handling of the power key"
msgid "Allow applications to inhibit system handling of the reboot key"
msgstr ""
"Permet aux applications dempêcher la gestion du bouton dalimentation du "
"Permet aux applications dempêcher la gestion du bouton de redémarrage du "
"système"
#: src/login/org.freedesktop.login1.policy:118
#, fuzzy
#| msgid ""
#| "Authentication is required for an application to inhibit system handling "
#| "of the power key."
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the reboot key."
msgstr ""
"Authentification requise pour permettre à une application dempêcher la "
"gestion du bouton dalimentation du système."
"gestion du bouton de redémarrage du système."
#: src/login/org.freedesktop.login1.policy:128
msgid "Allow non-logged-in user to run programs"

View File

@ -3,13 +3,13 @@
# Romanian translation for systemd.
# va511e <va511e@yahoo.com>, 2015.
# Daniel Șerbănescu <daniel [at] serbanescu [dot] dk>, 2015, 2017.
# Vlad <milovlad@outlook.com>, 2020.
# Vlad <milovlad@outlook.com>, 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: 2020-12-26 08:36+0000\n"
"PO-Revision-Date: 2021-01-12 17:36+0000\n"
"Last-Translator: Vlad <milovlad@outlook.com>\n"
"Language-Team: Romanian <https://translate.fedoraproject.org/projects/"
"systemd/master/ro/>\n"
@ -19,7 +19,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=n==1 ? 0 : (n==0 || (n%100 > 0 && n%100 < "
"20)) ? 1 : 2;\n"
"X-Generator: Weblate 4.3.2\n"
"X-Generator: Weblate 4.4\n"
#: src/core/org.freedesktop.systemd1.policy.in:22
msgid "Send passphrase back to system"
@ -333,24 +333,18 @@ msgstr ""
"comutatorului din capacul sistemului."
#: src/login/org.freedesktop.login1.policy:117
#, fuzzy
#| msgid "Allow applications to inhibit system handling of the power key"
msgid "Allow applications to inhibit system handling of the reboot key"
msgstr ""
"Permite aplicațiilor să împiedice administrarea butonului de pornire a "
"Permite aplicațiilor să împiedice administrarea butonului de repornire a "
"sistemului"
#: src/login/org.freedesktop.login1.policy:118
#, fuzzy
#| msgid ""
#| "Authentication is required for an application to inhibit system handling "
#| "of the power key."
msgid ""
"Authentication is required for an application to inhibit system handling of "
"the reboot key."
msgstr ""
"Autentificarea este necesară pentru ca o aplicație să împiedice "
"administrarea butonului de pornire a sistemului."
"administrarea butonului de repornire a sistemului."
#: src/login/org.freedesktop.login1.policy:128
msgid "Allow non-logged-in user to run programs"

View File

@ -85,6 +85,11 @@ KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse"
# The static_node is required on s390x and ppc (they are using MODULE_ALIAS)
KERNEL=="kvm", GROUP="kvm", MODE="@DEV_KVM_MODE@", OPTIONS+="static_node=kvm"
KERNEL=="vsock", MODE="0666"
KERNEL=="vhost-vsock", GROUP="kvm", MODE="@DEV_KVM_MODE@", OPTIONS+="static_node=vhost-vsock"
KERNEL=="vhost-net", GROUP="kvm", MODE="@DEV_KVM_MODE@", OPTIONS+="static_node=vhost-net"
KERNEL=="udmabuf", GROUP="kvm"
SUBSYSTEM=="ptp", ATTR{clock_name}=="KVM virtual PTP", SYMLINK += "ptp_kvm"

View File

@ -22,8 +22,6 @@
"_"
static bool env_name_is_valid_n(const char *e, size_t n) {
const char *p;
if (!e)
return false;
@ -41,7 +39,7 @@ static bool env_name_is_valid_n(const char *e, size_t n) {
if (n > (size_t) sysconf(_SC_ARG_MAX) - 2)
return false;
for (p = e; p < e + n; p++)
for (const char *p = e; p < e + n; p++)
if (!strchr(VALID_BASH_ENV_NAME_CHARS, *p))
return false;
@ -189,14 +187,14 @@ static int env_append(char **r, char ***k, char **a) {
char **strv_env_merge(size_t n_lists, ...) {
_cleanup_strv_free_ char **ret = NULL;
size_t n = 0, i;
size_t n = 0;
char **l, **k;
va_list ap;
/* Merges an arbitrary number of environment sets */
va_start(ap, n_lists);
for (i = 0; i < n_lists; i++) {
for (size_t i = 0; i < n_lists; i++) {
l = va_arg(ap, char**);
n += strv_length(l);
}
@ -210,7 +208,7 @@ char **strv_env_merge(size_t n_lists, ...) {
k = ret;
va_start(ap, n_lists);
for (i = 0; i < n_lists; i++) {
for (size_t i = 0; i < n_lists; i++) {
l = va_arg(ap, char**);
if (env_append(ret, &k, l) < 0) {
va_end(ap);
@ -276,10 +274,8 @@ char **strv_env_delete(char **x, size_t n_lists, ...) {
return NULL;
STRV_FOREACH(k, x) {
size_t v;
va_start(ap, n_lists);
for (v = 0; v < n_lists; v++) {
for (size_t v = 0; v < n_lists; v++) {
char **l, **j;
l = va_arg(ap, char**);
@ -310,7 +306,6 @@ char **strv_env_delete(char **x, size_t n_lists, ...) {
}
char **strv_env_unset(char **l, const char *p) {
char **f, **t;
if (!l)

View File

@ -48,9 +48,7 @@ CustomMount* custom_mount_add(CustomMount **l, size_t *n, CustomMountType t) {
}
void custom_mount_free_all(CustomMount *l, size_t n) {
size_t i;
for (i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
CustomMount *m = l + i;
free(m->source);
@ -94,7 +92,6 @@ static bool source_path_is_valid(const char *p) {
}
static char *resolve_source_path(const char *dest, const char *source) {
if (!source)
return NULL;
@ -129,7 +126,6 @@ static int allocate_temporary_source(CustomMount *m) {
}
int custom_mount_prepare_all(const char *dest, CustomMount *l, size_t n) {
size_t i;
int r;
/* Prepare all custom mounts. This will make source we know all temporary directories. This is called in the
@ -141,7 +137,7 @@ int custom_mount_prepare_all(const char *dest, CustomMount *l, size_t n) {
/* Order the custom mounts, and make sure we have a working directory */
typesafe_qsort(l, n, custom_mount_compare);
for (i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
CustomMount *m = l + i;
/* /proc we mount in the inner child, i.e. when we acquired CLONE_NEWPID. All other mounts we mount
@ -588,10 +584,9 @@ int mount_all(const char *dest,
bool ro = FLAGS_SET(mount_settings, MOUNT_APPLY_APIVFS_RO);
bool in_userns = FLAGS_SET(mount_settings, MOUNT_IN_USERNS);
bool tmpfs_tmp = FLAGS_SET(mount_settings, MOUNT_APPLY_TMPFS_TMP);
size_t k;
int r;
for (k = 0; k < ELEMENTSOF(mount_table); k++) {
for (size_t k = 0; k < ELEMENTSOF(mount_table); k++) {
_cleanup_free_ char *where = NULL, *options = NULL, *prefixed = NULL;
bool fatal = FLAGS_SET(mount_table[k].mount_settings, MOUNT_FATAL);
const char *o;
@ -688,7 +683,6 @@ int mount_all(const char *dest,
}
static int parse_mount_bind_options(const char *options, unsigned long *mount_flags, char **mount_opts) {
const char *p = options;
unsigned long flags = *mount_flags;
char *opts = NULL;
int r;
@ -698,7 +692,7 @@ static int parse_mount_bind_options(const char *options, unsigned long *mount_fl
for (;;) {
_cleanup_free_ char *word = NULL;
r = extract_first_word(&p, &word, ",", 0);
r = extract_first_word(&options, &word, ",", 0);
if (r < 0)
return log_error_errno(r, "Failed to extract mount option: %m");
if (r == 0)
@ -708,11 +702,9 @@ static int parse_mount_bind_options(const char *options, unsigned long *mount_fl
flags |= MS_REC;
else if (streq(word, "norbind"))
flags &= ~MS_REC;
else {
else
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Invalid bind mount option: %s",
word);
}
"Invalid bind mount option: %s", word);
}
*mount_flags = flags;
@ -789,7 +781,6 @@ static int mount_bind(const char *dest, CustomMount *m) {
}
static int mount_tmpfs(const char *dest, CustomMount *m, uid_t uid_shift, const char *selinux_apifs_context) {
const char *options;
_cleanup_free_ char *buf = NULL, *where = NULL;
int r;
@ -927,13 +918,11 @@ int mount_custom(
uid_t uid_shift,
const char *selinux_apifs_context,
MountSettingsMask mount_settings) {
size_t i;
int r;
assert(dest);
for (i = 0; i < n; i++) {
for (size_t i = 0; i < n; i++) {
CustomMount *m = mounts + i;
if (FLAGS_SET(mount_settings, MOUNT_IN_USERNS) != m->in_userns)
@ -979,20 +968,14 @@ int mount_custom(
}
bool has_custom_root_mount(const CustomMount *mounts, size_t n) {
size_t i;
for (i = 0; i < n; i++) {
const CustomMount *m = mounts + i;
if (path_equal(m->destination, "/"))
for (size_t i = 0; i < n; i++)
if (path_equal(mounts[i].destination, "/"))
return true;
}
return false;
}
static int setup_volatile_state(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) {
_cleanup_free_ char *buf = NULL;
const char *p, *options;
int r;
@ -1021,7 +1004,6 @@ static int setup_volatile_state(const char *directory, uid_t uid_shift, const ch
}
static int setup_volatile_yes(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) {
bool tmpfs_mounted = false, bind_mounted = false;
char template[] = "/tmp/nspawn-volatile-XXXXXX";
_cleanup_free_ char *buf = NULL, *bindir = NULL;
@ -1109,7 +1091,6 @@ fail:
}
static int setup_volatile_overlay(const char *directory, uid_t uid_shift, const char *selinux_apifs_context) {
_cleanup_free_ char *buf = NULL, *escaped_directory = NULL, *escaped_upper = NULL, *escaped_work = NULL;
char template[] = "/tmp/nspawn-volatile-XXXXXX";
const char *upper, *work, *options;

View File

@ -398,16 +398,14 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) {
/* If loading of the unit failed server side complete, then the server won't tell us
* the unit file path. In that case, find the file client side. */
log_debug_errno(r, "Unit '%s' was not loaded correctly, retrying client-side.", *name);
r = unit_find_paths(bus, *name, &lp, true, &cached_name_map, &cached_id_map, &path, NULL);
r = unit_find_paths(bus, *name, &lp, true, &cached_name_map, &cached_id_map, &path, &unit_paths);
}
if (r == -ERFKILL)
return log_error_errno(r, "Unit '%s' masked, cannot edit.", *name);
if (r < 0)
return r;
if (r == 0) {
assert(!path);
if (!path) {
if (!arg_force) {
log_info("Run 'systemctl edit%s --force --full %s' to create a new unit.",
arg_scope == UNIT_FILE_GLOBAL ? " --global" :
@ -422,8 +420,6 @@ static int find_paths_to_edit(sd_bus *bus, char **names, char ***paths) {
arg_full ? NULL : ".d/override.conf",
NULL, &new_path, &tmp_path);
} else {
assert(path);
unit_name = basename(path);
/* We follow unit aliases, but we need to propagate the instance */
if (unit_name_is_valid(*name, UNIT_NAME_INSTANCE) &&

View File

@ -15,15 +15,14 @@
# See systemd-coredump(8) and core(5).
kernel.core_pattern=|@rootlibexecdir@/systemd-coredump %P %u %g %s %t %c %h
# Allow that 16 coredumps are dispatched in parallel by the kernel. We want to
# be able to collect process metadata from /proc/%P/ while processing
# coredumps, and thus need to make sure the crashed processes are not reaped
# until we finished collecting what we need. The kernel default for this sysctl
# is "0" which means the kernel doesn't wait for userspace processes to finish
# processing before reaping the crashed processes — by setting this higher the
# kernel will delay reaping until we are done, but only for the specified
# number of crashes in parallel. The value of 16 is chosen to match
# systemd-coredump.socket's MaxConnections= value.
# Allow 16 coredumps to be dispatched in parallel by the kernel.
# We collect metadata from /proc/%P/, and thus need to make sure the crashed
# processes are not reaped until we have finished collecting what we need. The
# kernel default for this sysctl is "0" which means the kernel doesn't wait for
# userspace to finish processing before reaping the crashed processes. With a
# higher setting the kernel will delay reaping until we are done, but only for
# the specified number of crashes in parallel. The value of 16 is chosen to
# match systemd-coredump.socket's MaxConnections= value.
kernel.core_pipe_limit=16
# Also dump processes executing a set-user-ID/set-group-ID program that is

View File

@ -15,3 +15,5 @@ z /dev/loop-control 0660 - disk -
z /dev/net/tun 0666 - - -
z /dev/fuse 0666 - - -
z /dev/kvm @DEV_KVM_MODE@ - kvm -
z /dev/vhost-net @DEV_KVM_MODE@ - kvm -
z /dev/vhost-vsock @DEV_KVM_MODE@ - kvm -