summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb2
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-06-29 06:53:44 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:09:36 -0500
commitbcc9e8af30e430e5bc49f23457a56ffe21624679 (patch)
tree259b4ab94bc6c819f459a7ef5a1ff34eeeedb0c1 /source4/smb_server/smb2
parent414c47633d89d87011fda08c3c2b8dcbbfbcc2a8 (diff)
downloadsamba-bcc9e8af30e430e5bc49f23457a56ffe21624679.tar.gz
samba-bcc9e8af30e430e5bc49f23457a56ffe21624679.tar.bz2
samba-bcc9e8af30e430e5bc49f23457a56ffe21624679.zip
r16666: implement setting of security_descriptors via SMB2 SetInfo
metze (This used to be commit 6908582f68478d5f702159f6b01934ffff3a95f0)
Diffstat (limited to 'source4/smb_server/smb2')
-rw-r--r--source4/smb_server/smb2/fileinfo.c48
1 files changed, 43 insertions, 5 deletions
diff --git a/source4/smb_server/smb2/fileinfo.c b/source4/smb_server/smb2/fileinfo.c
index 500a824d94..74b316f6a4 100644
--- a/source4/smb_server/smb2/fileinfo.c
+++ b/source4/smb_server/smb2/fileinfo.c
@@ -250,23 +250,61 @@ static void smb2srv_setinfo_send(struct ntvfs_request *ntvfs)
smb2srv_send_reply(req);
}
+static NTSTATUS smb2srv_setinfo_file(struct smb2srv_setinfo_op *op, uint8_t smb2_level)
+{
+ return NT_STATUS_FOOBAR;
+}
+
+static NTSTATUS smb2srv_setinfo_fs(struct smb2srv_setinfo_op *op, uint8_t smb2_level)
+{
+ return NT_STATUS_FOOBAR;
+}
+
+static NTSTATUS smb2srv_setinfo_security(struct smb2srv_setinfo_op *op, uint8_t smb2_level)
+{
+ union smb_setfileinfo *io;
+ NTSTATUS status;
+
+ switch (smb2_level) {
+ case 0x00:
+ io = talloc(op, union smb_setfileinfo);
+ NT_STATUS_HAVE_NO_MEMORY(io);
+
+ io->set_secdesc.level = RAW_SFILEINFO_SEC_DESC;
+ io->set_secdesc.in.file.ntvfs = op->info->in.file.ntvfs;
+ io->set_secdesc.in.secinfo_flags = op->info->in.flags;
+
+ io->set_secdesc.in.sd = talloc(io, struct security_descriptor);
+ NT_STATUS_HAVE_NO_MEMORY(io->set_secdesc.in.sd);
+
+ status = ndr_pull_struct_blob(&op->info->in.blob, io,
+ io->set_secdesc.in.sd,
+ (ndr_pull_flags_fn_t)ndr_pull_security_descriptor);
+ NT_STATUS_NOT_OK_RETURN(status);
+
+ return ntvfs_setfileinfo(op->req->ntvfs, io);
+ }
+
+ return NT_STATUS_INVALID_INFO_CLASS;
+}
+
static NTSTATUS smb2srv_setinfo_backend(struct smb2srv_setinfo_op *op)
{
uint8_t smb2_class;
- /*uint8_t smb2_level;*/
+ uint8_t smb2_level;
smb2_class = 0xFF & op->info->in.level;
- /*smb2_level = 0xFF & (op->info->in.level>>8);*/
+ smb2_level = 0xFF & (op->info->in.level>>8);
switch (smb2_class) {
case SMB2_GETINFO_FILE:
- return NT_STATUS_NOT_IMPLEMENTED;
+ return smb2srv_setinfo_file(op, smb2_level);
case SMB2_GETINFO_FS:
- return NT_STATUS_NOT_IMPLEMENTED;
+ return smb2srv_setinfo_fs(op, smb2_level);
case SMB2_GETINFO_SECURITY:
- return NT_STATUS_NOT_IMPLEMENTED;
+ return smb2srv_setinfo_security(op, smb2_level);
}
return NT_STATUS_FOOBAR;