summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/basic/missing.h4
-rw-r--r--src/machine/machine-dbus.c8
-rw-r--r--src/machine/machinectl.c16
-rw-r--r--units/systemd-bus-proxyd.service.m4.in1
-rw-r--r--units/user/systemd-bus-proxyd.service.in1
5 files changed, 24 insertions, 6 deletions
diff --git a/src/basic/missing.h b/src/basic/missing.h
index ed6cd80c75..34ab0254dd 100644
--- a/src/basic/missing.h
+++ b/src/basic/missing.h
@@ -977,7 +977,11 @@ static inline int raw_clone(unsigned long flags, void *child_stack) {
}
static inline pid_t raw_getpid(void) {
+#if defined(__alpha__)
+ return (pid_t) syscall(__NR_getxpid);
+#else
return (pid_t) syscall(__NR_getpid);
+#endif
}
#if !HAVE_DECL_RENAMEAT2
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index dc42ffdc52..7658d7146d 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -825,13 +825,13 @@ int bus_machine_method_copy(sd_bus_message *message, void *userdata, sd_bus_erro
if (r < 0)
return r;
- if (!path_is_absolute(src) || !path_is_safe(src))
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Source path must be absolute and not contain ../.");
+ if (!path_is_absolute(src))
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Source path must be absolute.");
if (isempty(dest))
dest = src;
- else if (!path_is_absolute(dest) || !path_is_safe(dest))
- return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Destination path must be absolute and not contain ../.");
+ else if (!path_is_absolute(dest))
+ return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Destination path must be absolute.");
r = bus_verify_polkit_async(
message,
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 7cb6ce77ac..66ed41087c 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -1073,6 +1073,8 @@ static int terminate_machine(int argc, char *argv[], void *userdata) {
static int copy_files(int argc, char *argv[], void *userdata) {
_cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
+ _cleanup_free_ char *abs_host_path = NULL;
+ char *dest, *host_path, *container_path;
sd_bus *bus = userdata;
bool copy_from;
int r;
@@ -1082,6 +1084,16 @@ static int copy_files(int argc, char *argv[], void *userdata) {
polkit_agent_open_if_enabled();
copy_from = streq(argv[0], "copy-from");
+ dest = argv[3] ?: argv[2];
+ host_path = copy_from ? dest : argv[2];
+ container_path = copy_from ? argv[2] : dest;
+
+ if (!path_is_absolute(host_path)) {
+ abs_host_path = path_make_absolute_cwd(host_path);
+ if (!abs_host_path)
+ return log_oom();
+ host_path = abs_host_path;
+ }
r = sd_bus_call_method(
bus,
@@ -1093,8 +1105,8 @@ static int copy_files(int argc, char *argv[], void *userdata) {
NULL,
"sss",
argv[1],
- argv[2],
- argv[3]);
+ copy_from ? container_path : host_path,
+ copy_from ? host_path : container_path);
if (r < 0) {
log_error("Failed to copy: %s", bus_error_message(&error, -r));
return r;
diff --git a/units/systemd-bus-proxyd.service.m4.in b/units/systemd-bus-proxyd.service.m4.in
index ffaf0bdc87..64f5ac7d17 100644
--- a/units/systemd-bus-proxyd.service.m4.in
+++ b/units/systemd-bus-proxyd.service.m4.in
@@ -10,6 +10,7 @@ Description=Legacy D-Bus Protocol Compatibility Daemon
[Service]
ExecStart=@rootlibexecdir@/systemd-bus-proxyd --address=kernel:path=/sys/fs/kdbus/0-system/bus
+ExecReload=@bindir@/busctl --address=unix:path=/run/dbus/system_bus_socket call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ReloadConfig
NotifyAccess=main
CapabilityBoundingSet=CAP_IPC_OWNER CAP_SETUID CAP_SETGID CAP_SETPCAP m4_ifdef(`HAVE_SMACK', CAP_MAC_ADMIN )
PrivateTmp=yes
diff --git a/units/user/systemd-bus-proxyd.service.in b/units/user/systemd-bus-proxyd.service.in
index e1e399dc32..6f79707b46 100644
--- a/units/user/systemd-bus-proxyd.service.in
+++ b/units/user/systemd-bus-proxyd.service.in
@@ -10,4 +10,5 @@ Description=Legacy D-Bus Protocol Compatibility Daemon
[Service]
ExecStart=@rootlibexecdir@/systemd-bus-proxyd --address=kernel:path=/sys/fs/kdbus/%U-user/bus
+ExecReload=@bindir@/busctl --address=unix:path=/run/user/%U/bus call org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus ReloadConfig
NotifyAccess=main