From: Volker Lendecke Date: Fri, 14 Jun 2024 15:48:52 +0000 (+0200) Subject: tdb: Update times in tdb_transaction_commit per fd, not per name X-Git-Tag: tdb-1.4.11~310 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=3f2e45aa163bfb7c0b3c459f82d2677a9cd8a443;p=thirdparty%2Fsamba.git 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 --- 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 */