From 3f2e45aa163bfb7c0b3c459f82d2677a9cd8a443 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 14 Jun 2024 17:48:52 +0200 Subject: [PATCH] tdb: Update times in tdb_transaction_commit per fd, not per name We might have a relative filename in tdb->name, so we might do the wrong thing here. And as we have the fd, why not use it... We call futimens in vfs_default without #ifdef and it's Posix 2018 or before. So I don't think we need to check for it. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- lib/tdb/common/transaction.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index 78bbd7ad23e..b4dec1024a0 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -1206,9 +1206,7 @@ _PUBLIC_ int tdb_transaction_commit(struct tdb_context *tdb) not be backed up (as tdb rounding to block sizes means that file size changes are quite rare too). The following forces mtime changes when a transaction completes */ -#ifdef HAVE_UTIME - utime(tdb->name, NULL); -#endif + futimens(tdb->fd, NULL); /* use a transaction cancel to free memory and remove the transaction locks */ -- 2.47.2