From b8d3bb8ec89cc703b939bd7097f931ce4ddc2200 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 15 Apr 2021 06:22:36 +0000 Subject: library: replace all uses of symlink() with symlinkat(). --- src/helper/slbt_archive_import.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/helper') diff --git a/src/helper/slbt_archive_import.c b/src/helper/slbt_archive_import.c index b3b1cec..444c48d 100644 --- a/src/helper/slbt_archive_import.c +++ b/src/helper/slbt_archive_import.c @@ -4,6 +4,7 @@ /* Released under the Standard MIT License; see COPYING.SLIBTOOL. */ /*******************************************************************/ +#include #include #include #include @@ -21,6 +22,7 @@ #include "slibtool_errinfo_impl.h" static char * slbt_mri_argument( + int fdat, char * arg, char * buf) { @@ -50,7 +52,7 @@ static char * slbt_mri_argument( if (!(tmpnam(buf))) return 0; - if (!(symlink(target,buf))) + if (!(symlinkat(target,fdat,buf))) lnk = buf; } @@ -127,8 +129,8 @@ int slbt_archive_import( ectx->pid = pid; - dst = slbt_mri_argument(dstarchive,mridst); - src = slbt_mri_argument(srcarchive,mrisrc); + dst = slbt_mri_argument(fdcwd,dstarchive,mridst); + src = slbt_mri_argument(fdcwd,srcarchive,mrisrc); fmt = "OPEN %s\n" "ADDLIB %s\n" "SAVE\n" -- cgit v1.2.3