summaryrefslogtreecommitdiffstats
path: root/source3/locking
diff options
context:
space:
mode:
Diffstat (limited to 'source3/locking')
-rw-r--r--source3/locking/locking.c25
1 files changed, 24 insertions, 1 deletions
diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index d144f5c75e..dd73f683af 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -471,7 +471,7 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
size_t sn_len;
size_t msg_len;
char *frm = NULL;
- int i;
+ uint32_t i;
bool strip_two_chars = false;
bool has_stream = smb_fname_dst->stream_name != NULL;
struct server_id self_pid = messaging_server_id(msg_ctx);
@@ -565,6 +565,29 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
(uint8 *)frm, msg_len);
}
+ for (i=0; i<d->num_leases; i++) {
+ /* Update the filename in leases_db. */
+ NTSTATUS status;
+ struct share_mode_lease *l;
+
+ l = &d->leases[i];
+
+ status = leases_db_rename(&l->client_guid,
+ &l->lease_key,
+ &id,
+ d->base_name,
+ d->stream_name);
+ if (!NT_STATUS_IS_OK(status)) {
+ /* Any error recovery possible here ? */
+ DEBUG(1,("Failed to rename lease key for "
+ "renamed file %s:%s. %s\n",
+ d->base_name,
+ d->stream_name,
+ nt_errstr(status)));
+ continue;
+ }
+ }
+
return True;
}