[PING][PATCH] binutils: Avoid renaming over existing files
Siddhesh Poyarekar
siddhesh@gotplt.org
Tue Feb 23 05:10:49 GMT 2021
On 2/23/21 10:14 AM, Fangrui Song wrote:
> On latest commit, there is a behavior difference. I don't know whether
> it is intended.
>
> # S_ISUID and S_ISGID bits are cleared
> chmod 7777 a.o; ls -l a.o; ~/Dev/binutils-gdb/Debug/binutils/strip-new
> -p a.o; ls -l a.o
>
> vs system
>
> # S_ISUID and S_ISGID bits are preserved
> chmod 7777 a.o; ls -l a.o; strip -p a.o; ls -l a.o
Hmm, so writing to a SUID/SGID file clears those bits; that's news to
me. It ought to be safe for binutils to attempt to only restore the
permission bits of the destination right after the copy. I'll share a
patch shortly.
Siddhesh
More information about the Binutils
mailing list