mirror of
https://github.com/clearlinux/swupd-client.git
synced 2026-09-08 06:31:50 +00:00
The intended behavior here is to check if the directory path for the current file contains any symlinks, not the full path itself. By not checking the directory path only, verify --fix would not delete any symlinks that were marked deleted. Also, because the directory path is being examined now, we can obtain the directory file descriptor (dirfd) and use unlinkat(2) to delete files and directories instead of unlink/rmdir; doing so avoids race conditions in that paths may change between calling realpath() and unlink(). Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>