The Samba-Bugzilla – Attachment 16556 Details for
Bug 14291
Patches for TDB mutex init problems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to fix TDB header/mutex file write sequence
tdb_header_mutex.patch (text/plain), 1.15 KB, created by
Peter Eriksson
on 2021-03-17 19:56:13 UTC
(
hide
)
Description:
Patch to fix TDB header/mutex file write sequence
Filename:
MIME Type:
Creator:
Peter Eriksson
Created:
2021-03-17 19:56:13 UTC
Size:
1.15 KB
patch
obsolete
>--- samba-4.14.0-orig/lib/tdb/common/open.c tors jan. 21 14:20:40 2021 >+++ samba-4.14.0/lib/tdb/common/open.c ons mars 17 19:15:01 2021 >@@ -127,19 +127,16 @@ > /* Don't endian-convert the magic food! */ > memcpy(newdb->magic_food, TDB_MAGIC_FOOD, strlen(TDB_MAGIC_FOOD)+1); > >- if (!tdb_write_all(tdb->fd, newdb, size)) >- goto fail; >- > if (newdb->feature_flags & TDB_FEATURE_FLAG_MUTEX) { > > /* > * Now we init the mutex area >- * followed by a second header. >+ * followed by the header. > */ > > ret = ftruncate( > tdb->fd, >- newdb->mutex_size + sizeof(struct tdb_header)); >+ newdb->mutex_size /* + sizeof(struct tdb_header) */ ); > if (ret == -1) { > goto fail; > } >@@ -149,7 +146,7 @@ > } > > /* >- * Write a second header behind the mutexes. That's the area >+ * Write the header behind the mutexes. That's the area > * that will be mmapp'ed. > */ > ret = lseek(tdb->fd, newdb->mutex_size, SEEK_SET); >@@ -156,11 +153,11 @@ > if (ret == -1) { > goto fail; > } >- if (!tdb_write_all(tdb->fd, newdb, size)) { >- goto fail; >- } > } > >+ if (!tdb_write_all(tdb->fd, newdb, size)) { >+ goto fail; >+ } > ret = 0; > fail: > SAFE_FREE(newdb);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 14291
:
15815
|
16555
| 16556