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>
2 files changed