summaryrefslogtreecommitdiff
path: root/src/core/execute.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-09-23 16:17:03 +0900
committerAdrian Szyndela <adrian.s@samsung.com>2020-03-26 16:28:06 +0100
commit5978f91ad3d8159b6e3ff4f349c755a4dcfcf357 (patch)
treefef7086874bdea1841e400b79f4ee68572704cad /src/core/execute.c
parent58ff64cdf05ad234674389e04fbe449e8895a071 (diff)
downloadsystemd-5978f91ad3d8159b6e3ff4f349c755a4dcfcf357.tar.gz
systemd-5978f91ad3d8159b6e3ff4f349c755a4dcfcf357.tar.bz2
systemd-5978f91ad3d8159b6e3ff4f349c755a4dcfcf357.zip
(backport) fs-util: make symlink_idempotent() optionally create relative link
Change-Id: I24d38ca9a7e0f63095cd8fdf33b9686206ebf6a5
Diffstat (limited to 'src/core/execute.c')
-rw-r--r--src/core/execute.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/core/execute.c b/src/core/execute.c
index 4ae838e72a..953c0f073d 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -2031,7 +2031,7 @@ static int setup_exec_directory(
if (context->dynamic_user &&
!IN_SET(type, EXEC_DIRECTORY_RUNTIME, EXEC_DIRECTORY_CONFIGURATION)) {
- _cleanup_free_ char *private_root = NULL, *relative = NULL, *parent = NULL;
+ _cleanup_free_ char *private_root = NULL;
/* So, here's one extra complication when dealing with DynamicUser=1 units. In that case we
* want to avoid leaving a directory around fully accessible that is owned by a dynamic user
@@ -2096,18 +2096,8 @@ static int setup_exec_directory(
goto fail;
}
- parent = dirname_malloc(p);
- if (!parent) {
- r = -ENOMEM;
- goto fail;
- }
-
- r = path_make_relative(parent, pp, &relative);
- if (r < 0)
- goto fail;
-
/* And link it up from the original place */
- r = symlink_idempotent(relative, p);
+ r = symlink_idempotent(pp, p, true);
if (r < 0)
goto fail;