elfcompress: Swap fchmod and fchown calls on new file.
authorMark Wielaard <mark@klomp.org>
Sat, 21 Jul 2018 14:10:25 +0000 (16:10 +0200)
committerMark Wielaard <mark@klomp.org>
Sun, 22 Jul 2018 08:05:56 +0000 (10:05 +0200)
commit4d240015c63d7cb702b70f7b17c8535c8223858a
treeb7fd4489d65e6fd88ced65c3c6936095f617ed49
parent272f70b8ac7dfab779810141c12735202492b881
elfcompress: Swap fchmod and fchown calls on new file.

Calling fchmod with a suid bit on a file might silently fail or the suid
bit might be slilently cleared by a call to fchown if already set. Swap
the calls so that the owner is set first and then set the suid bit.

https://bugzilla.redhat.com/show_bug.cgi?id=1607044

Reported-and-tested-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Signed-off-by: Mark Wielaard <mark@klomp.org>
src/ChangeLog
src/elfcompress.c