From: Michael Biebl Date: Fri, 23 Jul 2021 19:42:53 +0000 (+0200) Subject: New upstream version 249.2 X-Git-Tag: debian/252.11-1_deb12u1~427^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=cb578090e169300dc4ecb867e073937c58f298e3;p=systemd.git New upstream version 249.2 --- diff --git a/hwdb.d/60-keyboard.hwdb b/hwdb.d/60-keyboard.hwdb index 9a787b52f..2e0614369 100644 --- a/hwdb.d/60-keyboard.hwdb +++ b/hwdb.d/60-keyboard.hwdb @@ -1303,7 +1303,6 @@ evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMICRO-STAR*:pnU90/U100:* # Keymaps MSI Prestige And MSI Modern FnKeys and Special keys evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Prestige*:* evdev:atkbd:dmi:bvn*:bvr*:bd*:svnMicro-Star*:pn*Modern*:* - KEYBOARD_KEY_56=backslash # Secondary backslash key KEYBOARD_KEY_f1=f20 # Fn+F5 Micmute KEYBOARD_KEY_76=f21 # Fn+F4 Toggle touchpad, sends meta+ctrl+toggle KEYBOARD_KEY_91=prog1 # Fn+F7 Creation Center, sometime F7 diff --git a/man/nss-myhostname.xml b/man/nss-myhostname.xml index 98eb0ec77..f9d0ff43f 100644 --- a/man/nss-myhostname.xml +++ b/man/nss-myhostname.xml @@ -73,13 +73,17 @@ To activate the NSS modules, add myhostname to the line starting with hosts: in /etc/nsswitch.conf. - It is recommended to place myhostname either between resolve - and "traditional" modules like dns, or after them. In the first version, well-known - names like localhost and the machine hostname are given higher priority than the - external configuration. This is recommended when the external DNS servers and network are not absolutely - trusted. In the second version, external configuration is given higher priority and - nss-myhostname only provides a fallback mechanism. This might be suitable in closely - controlled networks, for example on a company LAN. + It is recommended to place myhostname after file and before dns. + This resolves well-known hostnames like localhost + and the machine hostnames locally. It is consistent with the behaviour + of nss-resolve, and still allows overriding via + /etc/hosts. + + Please keep in mind that nss-myhostname (and nss-resolve) also resolve + in the other direction — from locally attached IP adresses to + hostnames. If you rely on that lookup being provided by DNS, you might + want to order things differently. + @@ -95,10 +99,7 @@ shadow: compat systemd gshadow: files systemd -# Either (untrusted network, see above): hosts: mymachines resolve [!UNAVAIL=return] files myhostname dns -# Or (only trusted networks): -hosts: mymachines resolve [!UNAVAIL=return] files dns myhostname networks: files protocols: db files diff --git a/man/nss-resolve.xml b/man/nss-resolve.xml index 97c376810..4f9e1f9c5 100644 --- a/man/nss-resolve.xml +++ b/man/nss-resolve.xml @@ -52,6 +52,12 @@ it is still recommended (see examples below) to keep nss-myhostname configured in /etc/nsswitch.conf, to keep those names resolveable if systemd-resolved is not running. + + Please keep in mind that nss-myhostname (and nss-resolve) also resolve + in the other direction — from locally attached IP adresses to + hostnames. If you rely on that lookup being provided by DNS, you might + want to order things differently. + diff --git a/src/core/main.c b/src/core/main.c index da6c50a1c..b32a19a1d 100644 --- a/src/core/main.c +++ b/src/core/main.c @@ -1720,9 +1720,50 @@ static void update_numa_policy(bool skip_setup) { log_warning_errno(r, "Failed to set NUMA memory policy: %m"); } +static void filter_args(const char* dst[], unsigned *pos, char **src, int argc) { + assert(dst); + assert(pos); + + /* Copy some filtered arguments into the dst array from src. */ + for (int i = 1; i < argc; i++) { + if (STR_IN_SET(src[i], + "--switched-root", + "--system", + "--user")) + continue; + + if (startswith(src[i], "--deserialize=")) + continue; + if (streq(src[i], "--deserialize")) { + i++; /* Skip the argument too */ + continue; + } + + /* Skip target unit designators. We already acted upon this information and have queued + * appropriate jobs. We don't want to redo all this after reexecution. */ + if (startswith(src[i], "--unit=")) + continue; + if (streq(src[i], "--unit")) { + i++; /* Skip the argument too */ + continue; + } + + if (startswith(src[i], + in_initrd() ? "rd.systemd.unit=" : "systemd.unit=")) + continue; + + if (runlevel_to_target(src[i])) + continue; + + /* Seems we have a good old option. Let's pass it over to the new instance. */ + dst[*pos] = src[i]; + (*pos)++; + } +} + static void do_reexecute( int argc, - char *argv[], + char* argv[], const struct rlimit *saved_rlimit_nofile, const struct rlimit *saved_rlimit_memlock, FDSet *fds, @@ -1730,7 +1771,7 @@ static void do_reexecute( const char *switch_root_init, const char **ret_error_message) { - unsigned i, j, args_size; + unsigned i, args_size; const char **args; int r; @@ -1760,11 +1801,11 @@ static void do_reexecute( log_error_errno(r, "Failed to switch root, trying to continue: %m"); } - args_size = MAX(6, argc+1); + args_size = argc + 6; args = newa(const char*, args_size); if (!switch_root_init) { - char sfd[DECIMAL_STR_MAX(int) + 1]; + char sfd[DECIMAL_STR_MAX(int)]; /* First try to spawn ourselves with the right path, and with full serialization. We do this only if * the user didn't specify an explicit init to spawn. */ @@ -1774,8 +1815,9 @@ static void do_reexecute( xsprintf(sfd, "%i", fileno(arg_serialization)); - i = 0; - args[i++] = SYSTEMD_BINARY_PATH; + i = 1; /* Leave args[0] empty for now. */ + filter_args(args, &i, argv, argc); + if (switch_root_dir) args[i++] = "--switched-root"; args[i++] = arg_system ? "--system" : "--user"; @@ -1793,8 +1835,9 @@ static void do_reexecute( */ valgrind_summary_hack(); + args[0] = SYSTEMD_BINARY_PATH; (void) execv(args[0], (char* const*) args); - log_debug_errno(errno, "Failed to execute our own binary, trying fallback: %m"); + log_debug_errno(errno, "Failed to execute our own binary %s, trying fallback: %m", args[0]); } /* Try the fallback, if there is any, without any serialization. We pass the original argv[] and envp[]. (Well, @@ -1807,9 +1850,9 @@ static void do_reexecute( /* Reopen the console */ (void) make_console_stdio(); - for (j = 1, i = 1; j < (unsigned) argc; j++) + i = 1; /* Leave args[0] empty for now. */ + for (int j = 1; j <= argc; j++) args[i++] = argv[j]; - args[i++] = NULL; assert(i <= args_size); /* Re-enable any blocked signals, especially important if we switch from initial ramdisk to init=... */ @@ -1820,7 +1863,7 @@ static void do_reexecute( if (switch_root_init) { args[0] = switch_root_init; (void) execve(args[0], (char* const*) args, saved_env); - log_warning_errno(errno, "Failed to execute configured init, trying fallback: %m"); + log_warning_errno(errno, "Failed to execute configured init %s, trying fallback: %m", args[0]); } args[0] = "/sbin/init"; diff --git a/src/systemd/sd-bus-vtable.h b/src/systemd/sd-bus-vtable.h index 75f884836..35c942b16 100644 --- a/src/systemd/sd-bus-vtable.h +++ b/src/systemd/sd-bus-vtable.h @@ -75,6 +75,9 @@ struct sd_bus_vtable { uint64_t features; const unsigned *vtable_format_reference; } start; + struct { + size_t reserved; + } end; struct { const char *member; const char *signature; @@ -185,7 +188,11 @@ struct sd_bus_vtable { { \ .type = _SD_BUS_VTABLE_END, \ .flags = 0, \ - .x = { { 0 } }, \ + .x = { \ + .end = { \ + .reserved = 0, \ + }, \ + }, \ } #define _SD_ECHO(X) X