]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shift-uid: use TAKE_FD on input fd 43051/head
authorLuca Boccassi <luca.boccassi@gmail.com>
Thu, 16 Jul 2026 18:21:48 +0000 (19:21 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Thu, 16 Jul 2026 18:21:48 +0000 (19:21 +0100)
Follow-up for c3eafb10a0b886876316bca6f9af06db67308ad0

src/shared/shift-uid.c

index e1c53dcb884dc8cf151628f96feb0918fae3958e..d01a4dad8dd866add8272960a173d3a4a54eb8ee 100644 (file)
@@ -297,7 +297,7 @@ static int is_fs_fully_userns_compatible(const struct statfs *sfs) {
 
 static int recurse_fd(int input_fd, const struct stat *st, uid_t shift, bool is_toplevel) {
         _cleanup_closedir_ DIR *d = NULL;
-        _cleanup_close_ int fd = input_fd;
+        _cleanup_close_ int fd = TAKE_FD(input_fd);
         bool changed = false;
         struct statfs sfs;
         int r;