1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: leases: Add leases_db_rename() to cope with renaming a leased file.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Jeremy Allison 2014-12-04 10:13:47 -08:00
parent 959b9ea0ef
commit 59cd638a1d
2 changed files with 27 additions and 1 deletions

View File

@ -385,3 +385,25 @@ NTSTATUS leases_db_parse(const struct GUID *client_guid,
}
return state.status;
}
NTSTATUS leases_db_rename(const struct GUID *client_guid,
const struct smb2_lease_key *lease_key,
const struct file_id *id,
const char *filename_new,
const char *stream_name_new)
{
NTSTATUS status;
status = leases_db_del(client_guid,
lease_key,
id);
if (!NT_STATUS_IS_OK(status)) {
return status;
}
return leases_db_add(client_guid,
lease_key,
id,
filename_new,
stream_name_new);
}

View File

@ -42,5 +42,9 @@ NTSTATUS leases_db_parse(const struct GUID *client_guid,
const char *stream_name,
void *private_data),
void *private_data);
NTSTATUS leases_db_rename(const struct GUID *client_guid,
const struct smb2_lease_key *lease_key,
const struct file_id *id,
const char *filename_new,
const char *stream_name_new);
#endif /* _LEASES_DB_H_ */