HomeClusterLabs Projects

Low: daemons: Fix a toctou bug when fetching additional schemas.

Description

Low: daemons: Fix a toctou bug when fetching additional schemas.

Testing whether the remote schema directory exists and then making it if
it doesn't introduces a race condition where the directory could be
created in between those two events. This seems fairly unlikely to
happen as far as I can tell, but it's still technically possible.

Instead, try to make it regardless and interpret errno to see what
happened. If the directory already existed, apply the same technique to
emptying it out - call nftw on it even if it's not a directory and
interpret errno from that function as well.

Details

Provenance
clumensAuthored on Mon, Jun 16, 8:49 PM
Parents
rP7a63a7728af8: Low: daemons: Fix a bug iterating in get_op_total_timeout.
Branches
Unknown
Tags
Unknown