mirror of
https://github.com/samba-team/samba.git
synced 2025-01-03 01:18:10 +03:00
s3/locking: return parent_lease_key from get_delete_on_close_token()
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
0beef8d2e8
commit
113c5400dc
@ -37,6 +37,7 @@
|
||||
|
||||
#include "includes.h"
|
||||
#include "lib/util/time_basic.h"
|
||||
#include "smbd/proto.h"
|
||||
#include "system/filesys.h"
|
||||
#include "lib/util/server_id.h"
|
||||
#include "share_mode_lock.h"
|
||||
@ -1046,7 +1047,8 @@ static struct delete_token *find_delete_on_close_token(
|
||||
bool get_delete_on_close_token(struct share_mode_lock *lck,
|
||||
uint32_t name_hash,
|
||||
const struct security_token **pp_nt_tok,
|
||||
const struct security_unix_token **pp_tok)
|
||||
const struct security_unix_token **pp_tok,
|
||||
struct smb2_lease_key *parent_lease_key)
|
||||
{
|
||||
struct share_mode_data *d = NULL;
|
||||
struct delete_token *dt;
|
||||
@ -1070,6 +1072,7 @@ bool get_delete_on_close_token(struct share_mode_lock *lck,
|
||||
}
|
||||
*pp_nt_tok = dt->delete_nt_token;
|
||||
*pp_tok = dt->delete_token;
|
||||
*parent_lease_key = dt->parent_lease_key;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -148,7 +148,8 @@ NTSTATUS remove_lease_if_stale(struct share_mode_lock *lck,
|
||||
bool get_delete_on_close_token(struct share_mode_lock *lck,
|
||||
uint32_t name_hash,
|
||||
const struct security_token **pp_nt_tok,
|
||||
const struct security_unix_token **pp_tok);
|
||||
const struct security_unix_token **pp_tok,
|
||||
struct smb2_lease_key *parent_lease_key);
|
||||
void reset_delete_on_close_lck(files_struct *fsp,
|
||||
struct share_mode_lock *lck);
|
||||
void set_delete_on_close_lck(files_struct *fsp,
|
||||
|
@ -296,6 +296,7 @@ struct close_share_mode_lock_state {
|
||||
enum file_close_type close_type;
|
||||
bool delete_object;
|
||||
bool got_tokens;
|
||||
struct smb2_lease_key parent_lease_key;
|
||||
const struct security_unix_token *del_token;
|
||||
const struct security_token *del_nt_token;
|
||||
bool reset_delete_on_close;
|
||||
@ -397,8 +398,11 @@ static void close_share_mode_lock_prepare(struct share_mode_lock *lck,
|
||||
*/
|
||||
*keep_locked = true;
|
||||
|
||||
state->got_tokens = get_delete_on_close_token(lck, fsp->name_hash,
|
||||
&state->del_nt_token, &state->del_token);
|
||||
state->got_tokens = get_delete_on_close_token(lck,
|
||||
fsp->name_hash,
|
||||
&state->del_nt_token,
|
||||
&state->del_token,
|
||||
&state->parent_lease_key);
|
||||
if (state->close_type != ERROR_CLOSE) {
|
||||
SMB_ASSERT(state->got_tokens);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user