summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-02-02 21:29:49 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:21 -0500
commit466230e5a10c2175535f7224df644fa6d09607e6 (patch)
treeb94fa7e78c064a09d882b6dcbdd4c8df0d575365
parentd14af63e6ab600eb3ac705f2f425c860e927553a (diff)
downloadsamba-466230e5a10c2175535f7224df644fa6d09607e6.tar.gz
samba-466230e5a10c2175535f7224df644fa6d09607e6.tar.bz2
samba-466230e5a10c2175535f7224df644fa6d09607e6.zip
r13294: Fix basic delete on close tests - don't forget to tell
the data struct how big the token is... :-). Jeremy. (This used to be commit f259de8b69f94ae8b5f4553180f245234bffd397)
-rw-r--r--source3/locking/locking.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index e558c6d74f..666988b541 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -558,6 +558,7 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
struct locking_data *data;
ssize_t offset;
ssize_t sp_len;
+ uint32 delete_token_size;
result.dptr = NULL;
result.dsize = 0;
@@ -573,10 +574,12 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
}
sp_len = strlen(lck->servicepath);
+ delete_token_size = (lck->delete_token ?
+ (8 + (lck->delete_token->ngroups*4)) : 0);
result.dsize = sizeof(*data) +
lck->num_share_modes * sizeof(struct share_mode_entry) +
- (lck->delete_token ? (8 + (lck->delete_token->ngroups*4)) : 0) +
+ delete_token_size +
sp_len + 1 +
strlen(lck->filename) + 1;
result.dptr = talloc_size(lck, result.dsize);
@@ -590,10 +593,12 @@ static TDB_DATA unparse_share_modes(struct share_mode_lock *lck)
data->u.s.num_share_mode_entries = lck->num_share_modes;
data->u.s.delete_on_close = lck->delete_on_close;
data->u.s.initial_delete_on_close = lck->initial_delete_on_close;
- DEBUG(10, ("unparse_share_modes: del: %d, initial del %d, num: %d\n",
- data->u.s.delete_on_close,
- data->u.s.initial_delete_on_close,
- data->u.s.num_share_mode_entries));
+ data->u.s.delete_token_size = delete_token_size;
+ DEBUG(10, ("unparse_share_modes: del: %d, initial del %d, tok = %u, num: %d\n",
+ data->u.s.delete_on_close,
+ data->u.s.initial_delete_on_close,
+ (unsigned int)data->u.s.delete_token_size,
+ data->u.s.num_share_mode_entries));
memcpy(result.dptr + sizeof(*data), lck->share_modes,
sizeof(struct share_mode_entry)*lck->num_share_modes);
offset = sizeof(*data) +