summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-12-20 09:09:07 -0500
committerAnthony G. Basile <blueness@gentoo.org>2014-12-20 09:09:07 -0500
commitb0c70c543db0b9e2f3e8884ee6806b4ed01d5a20 (patch)
treef877f4346b2c23d22f3b9a56c8744ac82b64e2c3 /src/shared
parent12586b6a8a082e712c16c893e9cd727353816f06 (diff)
src/shared/util.c: follow upstream on tempfn_xxxxxx()
Upstream change the behaviour of tempfn_xxxxxx() to make the following work: # systemd-nspawn -xb -D / -M foobar in commit c4e34a612c81266773cf8358cb38a43d2e43474e. We have no reason not to follow that change even though eudev has nothing to do with nspawn. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/util.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/shared/util.c b/src/shared/util.c
index 633cf437e3..3fa616b788 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -1576,12 +1576,20 @@ char *tempfn_xxxxxx(const char *p) {
if (!t)
return NULL;
+ /*
+ * Turns this:
+ * /foo/bar/waldo
+ *
+ * Into this:
+ * /foo/bar/.waldoXXXXXX
+ */
+
fn = basename(p);
k = fn - p;
strcpy(stpcpy(stpcpy(mempcpy(t, p, k), "."), fn), "XXXXXX");
- *ret = t;
+ *ret = path_kill_slashes(t);
return 0;
}