tmpfiles: propagate clean_item_instance() error in clean_item()
The CREATE_DIRECTORY, TRUNCATE_DIRECTORY, CREATE_SUBVOLUME, CREATE_SUBVOLUME_INHERIT_QUOTA, CREATE_SUBVOLUME_NEW_QUOTA and COPY_FILES branches in clean_item() called clean_item_instance() but discarded its return value, always returning 0. If dir_cleanup() fails (e.g. cannot stat a subdirectory), the error is silently swallowed and the caller has no way to detect the failure. The sibling EMPTY_DIRECTORY/IGNORE_PATH branches already propagate the error correctly via glob_item(). Signed-off-by: dongshengyuan <dongshengyuan@uniontech.com>
This commit is contained in:
@@ -3486,8 +3486,7 @@ static int clean_item(Context *c, Item *i) {
|
||||
case CREATE_SUBVOLUME_INHERIT_QUOTA:
|
||||
case CREATE_SUBVOLUME_NEW_QUOTA:
|
||||
case COPY_FILES:
|
||||
clean_item_instance(c, i, i->path, CREATION_EXISTING);
|
||||
return 0;
|
||||
return clean_item_instance(c, i, i->path, CREATION_EXISTING);
|
||||
|
||||
case EMPTY_DIRECTORY:
|
||||
case IGNORE_PATH:
|
||||
|
||||
Reference in New Issue
Block a user