svn commit: samba r16666 - in branches/SAMBA_4_0/source/smb_server/smb2: .

metze at samba.org metze at samba.org
Thu Jun 29 06:53:44 GMT 2006


Author: metze
Date: 2006-06-29 06:53:44 +0000 (Thu, 29 Jun 2006)
New Revision: 16666

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16666

Log:
implement setting of security_descriptors via SMB2 SetInfo

metze
Modified:
   branches/SAMBA_4_0/source/smb_server/smb2/fileinfo.c


Changeset:
Modified: branches/SAMBA_4_0/source/smb_server/smb2/fileinfo.c
===================================================================
--- branches/SAMBA_4_0/source/smb_server/smb2/fileinfo.c	2006-06-29 00:48:44 UTC (rev 16665)
+++ branches/SAMBA_4_0/source/smb_server/smb2/fileinfo.c	2006-06-29 06:53:44 UTC (rev 16666)
@@ -250,23 +250,61 @@
 	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;



More information about the samba-cvs mailing list