summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-04-28 14:13:22 -0700
committerJeremy Allison <jra@samba.org>2010-04-28 14:13:22 -0700
commitac09506d36ea3018f888775058901498ab6aa370 (patch)
tree53cfe0c1b6226777513e926da10e3495c95f5f0e /source3
parent37e9019119326aca374d55c6379b13b5cd0f564a (diff)
downloadsamba-ac09506d36ea3018f888775058901498ab6aa370.tar.gz
samba-ac09506d36ea3018f888775058901498ab6aa370.tar.bz2
samba-ac09506d36ea3018f888775058901498ab6aa370.zip
Connect set security descriptor into SMB2 code.
Jeremy.
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);