diff options
author | Zeal Jagannatha <zealjagannatha@gmail.com> | 2017-11-13 23:11:41 -0800 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-14 08:11:41 +0100 |
commit | ab0fc8711b5021c82a1c6c04d24a0805319afea4 (patch) | |
tree | 1ce4eaec2f53cc418f1cce17eb8677bdfe527809 | |
parent | 861f16d2679eeda79e8185057cef24653913e300 (diff) | |
download | systemd-ab0fc8711b5021c82a1c6c04d24a0805319afea4.tar.gz |
Fix error message when binding files (#7196)
If you use machinectl to bind a file into a container, it responds with a confusing error message about a temporary directory not being a directory.
I just swapped it to error with the source that was passed, rather than the tmpdir.
It would also be nice to be able to bind files, but that's a separate issue (#7195).
Before the change:
root@epona /var/lib/sandbox $ cat bar/foo
Hello world!
root@epona /var/lib/sandbox $ machinectl bind testing /var/lib/sandbox/bar/foo /foo
Failed to bind mount: Failed to overmount /tmp/propagate.W5TNsj/mount: Not a directory
After the change:
root@epona /var/lib/sandbox $ machinectl bind testing /var/lib/sandbox/bar/foo /foo
Failed to bind mount: Failed to overmount /var/lib/sandbox/bar/foo: Not a directory
-rw-r--r-- | src/machine/machine-dbus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c index 36568b65ef..3cb90be67d 100644 --- a/src/machine/machine-dbus.c +++ b/src/machine/machine-dbus.c @@ -927,7 +927,7 @@ int bus_machine_method_bind_mount(sd_bus_message *message, void *userdata, sd_bu mount_tmp_created = true; if (mount(src, mount_tmp, NULL, MS_BIND, NULL) < 0) { - r = sd_bus_error_set_errnof(error, errno, "Failed to overmount %s: %m", mount_tmp); + r = sd_bus_error_set_errnof(error, errno, "Failed to mount %s: %m", src); goto finish; } |