LibtraceTeam / wandio

C library for simple and efficient file IO
GNU Lesser General Public License v3.0
17 stars 13 forks source link

Only attempt to change file ownership if current owner is root #22

Closed alistairking closed 5 years ago

alistairking commented 5 years ago

Previously if the process was being run by sudo, this code block attempted to chown the created file to be owned by the user who had invoked sudo. This worked in the "normal" case where sudo was used to run a capture application as root, but if sudo is being used to run an application as another (non-root) user, then the chown would fail.