1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-06 07:36:37 +02:00

archive: do not let on-disk mode leak to zip archives

When the "--add-file" option is used to add the contents from an
untracked file to the archive, the permission mode bits for these
files are sent to the archive-backend specific "write_entry()"
method as-is.  We normalize the mode bits for tracked files way
before we pass them to the write_entry() method; we should do the
same here.

This is not strictly needed for "tar" archive-backend, as it has its
own code to further clean them up, but "zip" archive-backend is not
so well prepared.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Junio C Hamano 2022-05-12 14:31:09 -07:00
parent e54793a95a
commit 6a61661967

View File

@ -342,7 +342,7 @@ int write_archive_entries(struct archiver_args *args,
else
err = write_entry(args, &fake_oid, path_in_archive.buf,
path_in_archive.len,
info->stat.st_mode,
canon_mode(info->stat.st_mode),
content.buf, content.len);
if (err)
break;