nspawn: use chase() for creating dev nodes (#43037)
This commit is contained in:
@@ -2123,9 +2123,9 @@ int oci_load(FILE *f, const char *bundle, Settings **ret) {
|
||||
if (!s->bundle)
|
||||
return log_oom();
|
||||
|
||||
r = oci_dispatch(oci, table, 0, s);
|
||||
r = oci_dispatch(oci, table, /* flags= */ 0, s);
|
||||
if (r < 0)
|
||||
return r;
|
||||
return log_error_errno(r, "Failed to parse OCI bundle configuration file '%s': %m", path);
|
||||
|
||||
if (s->properties) {
|
||||
r = sd_bus_message_seal(s->properties, 0, 0);
|
||||
|
||||
+3
-3
@@ -2232,9 +2232,9 @@ static int make_extra_nodes(const char *dest) {
|
||||
FOREACH_ARRAY(node, arg_extra_nodes, arg_n_extra_nodes) {
|
||||
_cleanup_free_ char *path = NULL;
|
||||
|
||||
path = path_join(dest, node->path);
|
||||
if (!path)
|
||||
return log_oom();
|
||||
r = chase(node->path, dest, CHASE_PREFIX_ROOT|CHASE_NONEXISTENT|CHASE_NOFOLLOW, &path, /* ret_fd= */ NULL);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to resolve device node path '%s': %m", node->path);
|
||||
|
||||
dev_t dev = S_ISCHR(node->mode) || S_ISBLK(node->mode) ? makedev(node->major, node->minor) : 0;
|
||||
if (mknod(path, node->mode, dev) < 0)
|
||||
|
||||
Reference in New Issue
Block a user