parent
3d0193909b
commit
de7da3f694
|
@ -19,20 +19,19 @@
|
||||||
# RUN: chmod 0777 %t
|
# RUN: chmod 0777 %t
|
||||||
# RUN: llvm-objcopy %t %t1
|
# RUN: llvm-objcopy %t %t1
|
||||||
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
|
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
|
||||||
## : cmp %t1.perms %t.0755
|
# RUN: cmp %t1.perms %t.0755
|
||||||
|
|
||||||
# RUN: umask 0237
|
# RUN: umask 0237
|
||||||
# RUN: chmod 0707 %t
|
# RUN: chmod 0707 %t
|
||||||
# RUN: llvm-objcopy %t %t1
|
# RUN: llvm-objcopy %t %t1
|
||||||
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
|
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
|
||||||
## : cmp %t1.perms %t.0500
|
# RUN: cmp %t1.perms %t.0500
|
||||||
|
|
||||||
# RUN: umask 0222
|
# RUN: umask 0222
|
||||||
# RUN: chmod 0777 %t
|
# RUN: chmod 0777 %t
|
||||||
# RUN: llvm-objcopy %t %t1
|
# RUN: llvm-objcopy %t %t1
|
||||||
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
|
# RUN: ls -l %t1 | cut -f 1 -d ' ' > %t1.perms
|
||||||
## : cmp %t1.perms %t.0555
|
# RUN: cmp %t1.perms %t.0555
|
||||||
|
|
||||||
|
|
||||||
--- !ELF
|
--- !ELF
|
||||||
FileHeader:
|
FileHeader:
|
||||||
|
|
|
@ -215,7 +215,8 @@ static Error restoreStatOnFile(StringRef Filename,
|
||||||
FD, Stat.getLastAccessedTime(), Stat.getLastModificationTime()))
|
FD, Stat.getLastAccessedTime(), Stat.getLastModificationTime()))
|
||||||
return createFileError(Filename, EC);
|
return createFileError(Filename, EC);
|
||||||
|
|
||||||
if (auto EC = sys::fs::setPermissions(Filename, Stat.permissions()))
|
if (auto EC = sys::fs::setPermissions(Filename, Stat.permissions(),
|
||||||
|
/*respectUmask=*/true))
|
||||||
return createFileError(Filename, EC);
|
return createFileError(Filename, EC);
|
||||||
|
|
||||||
if (auto EC = sys::Process::SafelyCloseFileDescriptor(FD))
|
if (auto EC = sys::Process::SafelyCloseFileDescriptor(FD))
|
||||||
|
|
Loading…
Reference in New Issue