aboutsummaryrefslogtreecommitdiffstats
path: root/lib/tools
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-04-19 11:43:29 +0200
committerBjörn Gustavsson <[email protected]>2017-04-19 11:43:29 +0200
commitb5b5a7f7469bd041959d4b48e4eeff49faa7f377 (patch)
treea607300c1cbc2c7ea66eaf6e96494b1e0467d149 /lib/tools
parent6124bfc9b61227a5e82f1d7273d0895e909aac6e (diff)
parent05f20a9790fa88011c1ce7099e0a660aa83195a9 (diff)
downloadotp-b5b5a7f7469bd041959d4b48e4eeff49faa7f377.tar.gz
otp-b5b5a7f7469bd041959d4b48e4eeff49faa7f377.tar.bz2
otp-b5b5a7f7469bd041959d4b48e4eeff49faa7f377.zip
Merge branch 'bjorn/stdlib/erl_tar/OTP-14278'
* bjorn/stdlib/erl_tar/OTP-14278: erl_tar: Handle leading slashes and directory traversal attacks Don't create absolute path names in tar files
Diffstat (limited to 'lib/tools')
-rw-r--r--lib/tools/test/xref_SUITE.erl8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/tools/test/xref_SUITE.erl b/lib/tools/test/xref_SUITE.erl
index f308ea1204..b8e7113595 100644
--- a/lib/tools/test/xref_SUITE.erl
+++ b/lib/tools/test/xref_SUITE.erl
@@ -89,11 +89,11 @@ init_per_suite(Conf) when is_list(Conf) ->
DataDir = ?datadir,
PrivDir = ?privdir,
CopyDir = fname(PrivDir, "datacopy"),
+ ok = file:make_dir(CopyDir),
TarFile = fname(PrivDir, "datacopy.tgz"),
- {ok, Tar} = erl_tar:open(TarFile, [write, compressed]),
- ok = erl_tar:add(Tar, DataDir, CopyDir, [compressed]),
- ok = erl_tar:close(Tar),
- ok = erl_tar:extract(TarFile, [compressed]),
+ ok = file:set_cwd(DataDir),
+ ok = erl_tar:create(TarFile, ["."], [compressed]),
+ ok = erl_tar:extract(TarFile, [compressed, {cwd,CopyDir}]),
ok = file:delete(TarFile),
[{copy_dir, CopyDir}|Conf].