Return values of chmod() and chown() in file_restore_metadata() are ignored #58
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
In
src/shared/metadata.clines 99-101, the return values ofchmod()andchown()are ignored:The
chmod()result is completely discarded, whilechown()is stored in a variable that is immediately cast to void. This means permission/ownership restoration failures are silently ignored, and there is no way for the caller to know that metadata restoration failed.Location
src/shared/metadata.c:99-101Suggested Fix
Check the return values and log warnings on failure:
Severity
Low
Category
Quality