]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/commonio.c: Call utime for correct target
authorTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 14 Jan 2026 21:26:00 +0000 (22:26 +0100)
committerAlejandro Colomar <foss+github@alejandro-colomar.es>
Wed, 14 Jan 2026 22:43:01 +0000 (23:43 +0100)
Since tmpf has been already renamed to target at this point, call utime
with target instead of tmpf.

Fixes: f8732b17dd1d (2026-01-14; "lib/commonio.c: Use unpredictable temporary names")
Reported-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/commonio.c

index 777795661c10348c264312ef26717acd2cea3abb..4131a2e096298403a6f2ecca8a13bbb92c16d8b7 100644 (file)
@@ -318,7 +318,7 @@ static int create_backup (const char *name, FILE * fp)
 
        ub.actime = sb.st_atime;
        ub.modtime = sb.st_mtime;
-       (void) utime(tmpf, &ub);
+       (void) utime(target, &ub);
        return 0;
 }