From 4393625a1bddded558ab72b53ec58d6f511c7809 Mon Sep 17 00:00:00 2001 From: dongshengyuan <545258830@qq.com> Date: Mon, 29 Jun 2026 10:20:36 +0800 Subject: [PATCH] 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 --- src/tmpfiles/tmpfiles.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 738f09a963..620ab9486e 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -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: