mirror of
https://github.com/morgan9e/systemd
synced 2026-04-15 08:56:15 +09:00
nspawn: don't use strjoina() for user controlled strings
This commit is contained in:
@@ -266,7 +266,7 @@ int allocate_scope(
|
||||
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
|
||||
_cleanup_(bus_wait_for_jobs_freep) BusWaitForJobs *w = NULL;
|
||||
_cleanup_free_ char *scope = NULL;
|
||||
const char *description, *object;
|
||||
const char *object;
|
||||
int r;
|
||||
|
||||
assert(bus);
|
||||
@@ -292,12 +292,14 @@ int allocate_scope(
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
description = strjoina("Container ", machine_name);
|
||||
|
||||
r = bus_append_scope_pidref(m, pid, FLAGS_SET(flags, ALLOCATE_SCOPE_ALLOW_PIDFD));
|
||||
if (r < 0)
|
||||
return bus_log_create_error(r);
|
||||
|
||||
_cleanup_free_ char *description = strjoin("Container ", machine_name);
|
||||
if (!description)
|
||||
return log_oom();
|
||||
|
||||
r = sd_bus_message_append(m, "(sv)(sv)(sv)(sv)(sv)",
|
||||
"Description", "s", description,
|
||||
"Delegate", "b", 1,
|
||||
|
||||
Reference in New Issue
Block a user