1
0
mirror of https://github.com/systemd/systemd synced 2025-10-02 18:24:46 +02:00

Compare commits

..

No commits in common. "584e9ba962bfa3e19e54320cedc8f38fad59f7c5" and "9c274488a9168f8284dc99882856ca79ce2aa132" have entirely different histories.

6 changed files with 28 additions and 29 deletions

5
NEWS
View File

@ -20,11 +20,6 @@ CHANGES WITH 248:
The SYSEXT_LEVEL= field in os-release(5) may be used to specify the
supported system extension level.
* A new ExtensionImages= unit setting can be used to apply the same
system extension image concept from systemd-sysext to the namespaced
file hierarchy of specific services, following the same rules and
constraints.
* A new configuration file /etc/veritytab may be used to configure
dm-verity integrity protection for block devices. Each line is in the
format "volume-name data-device hash-device roothash options",

3
TODO
View File

@ -20,9 +20,6 @@ Janitorial Clean-ups:
Features:
* whenever we receive fds via SCM_RIGHTS make sure none got dropped due to the
reception limit the kernel silently enforces.
* add an Open= setting to service unit files that can open arbitrary file
system paths at service startup time and pass them to the service process via
our usual socket activation protocol. If passed path refers to AF_UNIX

View File

@ -813,9 +813,11 @@ int getenv_path_list(const char *name, char ***ret_paths) {
assert(name);
assert(ret_paths);
*ret_paths = NULL;
e = secure_getenv(name);
if (!e)
return -ENXIO;
return 0;
r = strv_split_full(&l, e, ":", EXTRACT_DONT_COALESCE_SEPARATORS);
if (r < 0)
@ -840,5 +842,5 @@ int getenv_path_list(const char *name, char ***ret_paths) {
"No paths specified, refusing.");
*ret_paths = TAKE_PTR(l);
return 1;
return 0;
}

View File

@ -1554,12 +1554,9 @@ static int apply_mounts(
* /proc. For example, this is the case with the option: 'InaccessiblePaths=/proc'. */
proc_self_mountinfo = fopen("/proc/self/mountinfo", "re");
if (!proc_self_mountinfo) {
r = -errno;
if (error_path)
*error_path = strdup("/proc/self/mountinfo");
return log_debug_errno(r, "Failed to open /proc/self/mountinfo: %m");
return log_debug_errno(errno, "Failed to open /proc/self/mountinfo: %m");
}
/* First round, establish all mounts we need */

View File

@ -1631,6 +1631,10 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
return log_error_errno(r, "Failed to parse argument: %m");
STRV_FOREACH_PAIR(first, second, l) {
/* Format is either 'root:foo' or 'foo' (root is implied) */
if (!isempty(*second) && partition_designator_from_string(*first) < 0)
return bus_log_create_error(-EINVAL);
r = sd_bus_message_append(m, "(ss)",
!isempty(*second) ? *first : "root",
!isempty(*second) ? *second : *first);
@ -1679,14 +1683,14 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_first_word(&p, &tuple, NULL, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE);
if (r < 0)
return log_error_errno(r, "Failed to parse MountImages= property: %s", eq);
return r;
if (r == 0)
break;
q = tuple;
r = extract_many_words(&q, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS, &first, &second, NULL);
if (r < 0)
return log_error_errno(r, "Failed to parse MountImages= property: %s", eq);
return r;
if (r == 0)
continue;
@ -1718,7 +1722,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_many_words(&q, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS, &partition, &mount_options, NULL);
if (r < 0)
return log_error_errno(r, "Failed to parse MountImages= property: %s", eq);
return r;
if (r == 0)
break;
/* Single set of options, applying to the root partition/single filesystem */
@ -1730,6 +1734,9 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
break;
}
if (partition_designator_from_string(partition) < 0)
return bus_log_create_error(-EINVAL);
r = sd_bus_message_append(m, "(ss)", partition, mount_options);
if (r < 0)
return bus_log_create_error(r);
@ -1785,14 +1792,14 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_first_word(&p, &tuple, NULL, EXTRACT_UNQUOTE|EXTRACT_RETAIN_ESCAPE);
if (r < 0)
return log_error_errno(r, "Failed to parse ExtensionImages= property: %s", eq);
return r;
if (r == 0)
break;
q = tuple;
r = extract_first_word(&q, &source, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS);
if (r < 0)
return log_error_errno(r, "Failed to parse ExtensionImages= property: %s", eq);
return r;
if (r == 0)
continue;
@ -1819,7 +1826,7 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
r = extract_many_words(&q, ":", EXTRACT_CUNESCAPE|EXTRACT_UNESCAPE_SEPARATORS, &partition, &mount_options, NULL);
if (r < 0)
return log_error_errno(r, "Failed to parse ExtensionImages= property: %s", eq);
return r;
if (r == 0)
break;
/* Single set of options, applying to the root partition/single filesystem */
@ -1831,6 +1838,9 @@ static int bus_append_execute_property(sd_bus_message *m, const char *field, con
break;
}
if (partition_designator_from_string(partition) < 0)
return bus_log_create_error(-EINVAL);
r = sd_bus_message_append(m, "(ss)", partition, mount_options);
if (r < 0)
return bus_log_create_error(r);

View File

@ -79,18 +79,16 @@ int extension_release_validate(
}
int parse_env_extension_hierarchies(char ***ret_hierarchies) {
_cleanup_free_ char **l = NULL;
int r;
r = getenv_path_list("SYSTEMD_SYSEXT_HIERARCHIES", &l);
if (r == -ENXIO) {
/* Default when unset */
l = strv_new("/usr", "/opt");
if (!l)
r = getenv_path_list("SYSTEMD_SYSEXT_HIERARCHIES", ret_hierarchies);
if (r < 0)
return log_debug_errno(r, "Failed to parse SYSTEMD_SYSEXT_HIERARCHIES environment variable : %m");
if (!*ret_hierarchies) {
*ret_hierarchies = strv_new("/usr", "/opt");
if (!*ret_hierarchies)
return -ENOMEM;
} else if (r < 0)
return r;
}
*ret_hierarchies = TAKE_PTR(l);
return 0;
}