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 "includes.h"
|
||||||
#include "lib/util/time_basic.h"
|
#include "lib/util/time_basic.h"
|
||||||
|
#include "smbd/proto.h"
|
||||||
#include "system/filesys.h"
|
#include "system/filesys.h"
|
||||||
#include "lib/util/server_id.h"
|
#include "lib/util/server_id.h"
|
||||||
#include "share_mode_lock.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,
|
bool get_delete_on_close_token(struct share_mode_lock *lck,
|
||||||
uint32_t name_hash,
|
uint32_t name_hash,
|
||||||
const struct security_token **pp_nt_tok,
|
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 share_mode_data *d = NULL;
|
||||||
struct delete_token *dt;
|
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_nt_tok = dt->delete_nt_token;
|
||||||
*pp_tok = dt->delete_token;
|
*pp_tok = dt->delete_token;
|
||||||
|
*parent_lease_key = dt->parent_lease_key;
|
||||||
return true;
|
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,
|
bool get_delete_on_close_token(struct share_mode_lock *lck,
|
||||||
uint32_t name_hash,
|
uint32_t name_hash,
|
||||||
const struct security_token **pp_nt_tok,
|
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,
|
void reset_delete_on_close_lck(files_struct *fsp,
|
||||||
struct share_mode_lock *lck);
|
struct share_mode_lock *lck);
|
||||||
void set_delete_on_close_lck(files_struct *fsp,
|
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;
|
enum file_close_type close_type;
|
||||||
bool delete_object;
|
bool delete_object;
|
||||||
bool got_tokens;
|
bool got_tokens;
|
||||||
|
struct smb2_lease_key parent_lease_key;
|
||||||
const struct security_unix_token *del_token;
|
const struct security_unix_token *del_token;
|
||||||
const struct security_token *del_nt_token;
|
const struct security_token *del_nt_token;
|
||||||
bool reset_delete_on_close;
|
bool reset_delete_on_close;
|
||||||
@ -397,8 +398,11 @@ static void close_share_mode_lock_prepare(struct share_mode_lock *lck,
|
|||||||
*/
|
*/
|
||||||
*keep_locked = true;
|
*keep_locked = true;
|
||||||
|
|
||||||
state->got_tokens = get_delete_on_close_token(lck, fsp->name_hash,
|
state->got_tokens = get_delete_on_close_token(lck,
|
||||||
&state->del_nt_token, &state->del_token);
|
fsp->name_hash,
|
||||||
|
&state->del_nt_token,
|
||||||
|
&state->del_token,
|
||||||
|
&state->parent_lease_key);
|
||||||
if (state->close_type != ERROR_CLOSE) {
|
if (state->close_type != ERROR_CLOSE) {
|
||||||
SMB_ASSERT(state->got_tokens);
|
SMB_ASSERT(state->got_tokens);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user