mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
Connect set security descriptor into SMB2 code.
Jeremy.
This commit is contained in:
parent
37e9019119
commit
ac09506d36
@ -6613,6 +6613,8 @@ void send_nt_replies(connection_struct *conn,
|
||||
char *params, int paramsize,
|
||||
char *pdata, int datasize);
|
||||
void reply_ntcreate_and_X(struct smb_request *req);
|
||||
NTSTATUS set_sd(files_struct *fsp, uint8_t *data, uint32_t sd_len,
|
||||
uint32_t security_info_sent);
|
||||
struct ea_list *read_nttrans_ea_list(TALLOC_CTX *ctx, const char *pdata, size_t data_size);
|
||||
void reply_ntcancel(struct smb_request *req);
|
||||
void reply_ntrename(struct smb_request *req);
|
||||
|
@ -828,8 +828,8 @@ static void do_nt_transact_create_pipe(connection_struct *conn,
|
||||
Internal fn to set security descriptors.
|
||||
****************************************************************************/
|
||||
|
||||
static NTSTATUS set_sd(files_struct *fsp, uint8 *data, uint32 sd_len,
|
||||
uint32 security_info_sent)
|
||||
NTSTATUS set_sd(files_struct *fsp, uint8_t *data, uint32_t sd_len,
|
||||
uint32_t security_info_sent)
|
||||
{
|
||||
SEC_DESC *psd = NULL;
|
||||
NTSTATUS status;
|
||||
|
@ -161,11 +161,12 @@ static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx,
|
||||
uint32_t in_additional_information,
|
||||
uint64_t in_file_id_volatile)
|
||||
{
|
||||
struct tevent_req *req;
|
||||
struct smbd_smb2_setinfo_state *state;
|
||||
struct smb_request *smbreq;
|
||||
struct tevent_req *req = NULL;
|
||||
struct smbd_smb2_setinfo_state *state = NULL;
|
||||
struct smb_request *smbreq = NULL;
|
||||
connection_struct *conn = smb2req->tcon->compat_conn;
|
||||
files_struct *fsp;
|
||||
files_struct *fsp = NULL;
|
||||
NTSTATUS status;
|
||||
|
||||
req = tevent_req_create(mem_ctx, &state,
|
||||
struct smbd_smb2_setinfo_state);
|
||||
@ -208,7 +209,6 @@ static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx,
|
||||
char *data;
|
||||
int data_size;
|
||||
int ret_size = 0;
|
||||
NTSTATUS status;
|
||||
|
||||
|
||||
file_info_level = in_file_info_class + 1000;
|
||||
@ -285,7 +285,7 @@ static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx,
|
||||
if (data_size > 0) {
|
||||
data = (char *)SMB_MALLOC_ARRAY(char, data_size);
|
||||
if (tevent_req_nomem(data, req)) {
|
||||
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
memcpy(data, in_input_buffer.data, data_size);
|
||||
}
|
||||
@ -308,6 +308,19 @@ static struct tevent_req *smbd_smb2_setinfo_send(TALLOC_CTX *mem_ctx,
|
||||
break;
|
||||
}
|
||||
|
||||
case 0x03:/* SMB2_SETINFO_SECURITY */
|
||||
{
|
||||
status = set_sd(fsp,
|
||||
in_input_buffer.data,
|
||||
in_input_buffer.length,
|
||||
in_additional_information);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER);
|
||||
return tevent_req_post(req, ev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user