diff --git a/src/fetch.c b/src/fetch.c index 09b4e97eae4fdc7f323c49b553d3af4d24e5e0de..5cea5db74b55f1c2c452518283d3b270e216f176 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -90,7 +90,9 @@ static int fetch_package(struct fetch_ctx *fctx, fd = STDOUT_FILENO; } else { if ((fctx->flags & FETCH_LINK) && apk_url_local_file(infile)) { - if (link(infile, outfile) == 0) + char real_infile[256]; + readlink(infile, real_infile, sizeof(real_infile)); + if (link(real_infile, outfile) == 0) return 0; } fd = creat(outfile, 0644);