Skip to content
Snippets Groups Projects
Commit c8677af0 authored by Jim MacArthur's avatar Jim MacArthur
Browse files

_process_list: Make files readable before copying/linking

parent fafa8136
No related branches found
No related tags found
1 merge request!837WIP: Import unreadable files
Pipeline #31695256 passed
......@@ -831,8 +831,18 @@ def _process_list(srcdir, destdir, filelist, actionfunc, result,
result.ignored.append(path)
continue
if not file_stat.st_mode & stat.S_IRUSR:
os.chmod(srcpath, file_stat.st_mode | stat.S_IRUSR)
actionfunc(srcpath, destpath, result=result)
if not file_stat.st_mode & stat.S_IRUSR:
# actionfunc would normally preserve permissions, but
# if we changed them before copying, we need to reset
# the permissions on both.
os.chmod(destpath, file_stat.st_mode)
os.chmod(srcpath, file_stat.st_mode)
elif stat.S_ISCHR(mode) or stat.S_ISBLK(mode):
# Block or character device. Put contents of st_dev in a mknod.
if not safe_remove(destpath):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment