aboutsummaryrefslogtreecommitdiffstats
path: root/guts/symlinkat.c
diff options
context:
space:
mode:
Diffstat (limited to 'guts/symlinkat.c')
-rw-r--r--guts/symlinkat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/guts/symlinkat.c b/guts/symlinkat.c
index df1df06..577b1e7 100644
--- a/guts/symlinkat.c
+++ b/guts/symlinkat.c
@@ -6,6 +6,12 @@
struct stat64 buf;
char *roldname = 0;
+ if (oldname[0] == '/' && pseudo_chroot_len) {
+ size_t len = pseudo_chroot_len + strlen(oldname) + 1;
+ roldname = malloc(len);
+ snprintf(roldname, len, "%s%s", pseudo_chroot, oldname);
+ }
+
#ifdef PSEUDO_NO_REAL_AT_FUNCTIONS
if (dirfd != AT_FDCWD) {
errno = ENOSYS;