summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
Diffstat (limited to 'source3')
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/smbd/nttrans.c4
-rw-r--r--source3/smbd/smb2_setinfo.c25
3 files changed, 23 insertions, 8 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index f5e9ec4e06..1eaa008320 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -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);
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 3ce196d467..b594b7e4bc 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -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;
diff --git a/source3/smbd/smb2_setinfo.c b/source3/smbd/smb2_setinfo.c
index f6dbf78c21..410d9f7223 100644
--- a/source3/smbd/smb2_setinfo.c
+++ b/source3/smbd/smb2_setinfo.c
@@ -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);