Browse Source

SMB1: Renamed NT_TRANSACT_SET_SECURITY_DESC request and added response implementation

Tal Aloni 7 years ago
parent
commit
de355f93d8

+ 4 - 5
SMBLibrary/SMB1/NTTransactSubcommands/NTTransactSetSecurityDescriptor.cs

@@ -1,4 +1,4 @@
-/* Copyright (C) 2014 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
  * 
  * You can redistribute this program and/or modify it under the terms of
  * the GNU Lesser Public License as published by the Free Software Foundation,
@@ -6,7 +6,6 @@
  */
 using System;
 using System.Collections.Generic;
-using System.Text;
 using Utilities;
 
 namespace SMBLibrary.SMB1
@@ -14,7 +13,7 @@ namespace SMBLibrary.SMB1
     /// <summary>
     /// NT_TRANSACT_SET_SECURITY_DESC Request
     /// </summary>
-    public class NTTransactSetSecurityDescriptor : NTTransactSubcommand
+    public class NTTransactSetSecurityDescriptorRequest : NTTransactSubcommand
     {
         public const int ParametersLength = 8;
         // Parameters:
@@ -24,11 +23,11 @@ namespace SMBLibrary.SMB1
         // Data:
         public SecurityDescriptor SecurityDescriptor;
 
-        public NTTransactSetSecurityDescriptor()
+        public NTTransactSetSecurityDescriptorRequest()
         {
         }
 
-        public NTTransactSetSecurityDescriptor(byte[] parameters, byte[] data)
+        public NTTransactSetSecurityDescriptorRequest(byte[] parameters, byte[] data)
         {
             FID = LittleEndianConverter.ToUInt16(parameters, 0);
             Reserved = LittleEndianConverter.ToUInt16(parameters, 2);

+ 30 - 0
SMBLibrary/SMB1/NTTransactSubcommands/NTTransactSetSecurityDescriptorResponse.cs

@@ -0,0 +1,30 @@
+/* Copyright (C) 2014-2017 Tal Aloni <tal.aloni.il@gmail.com>. All rights reserved.
+ * 
+ * You can redistribute this program and/or modify it under the terms of
+ * the GNU Lesser Public License as published by the Free Software Foundation,
+ * either version 3 of the License, or (at your option) any later version.
+ */
+using System;
+using System.Collections.Generic;
+using Utilities;
+
+namespace SMBLibrary.SMB1
+{
+    /// <summary>
+    /// NT_TRANSACT_SET_SECURITY_DESC Response
+    /// </summary>
+    public class NTTransactSetSecurityDescriptorResponse : NTTransactSubcommand
+    {
+        public NTTransactSetSecurityDescriptorResponse()
+        {
+        }
+
+        public override NTTransactSubcommandName SubcommandName
+        {
+            get
+            {
+                return NTTransactSubcommandName.NT_TRANSACT_SET_SECURITY_DESC;
+            }
+        }
+    }
+}

+ 1 - 1
SMBLibrary/SMB1/NTTransactSubcommands/NTTransactSubcommand.cs

@@ -46,7 +46,7 @@ namespace SMBLibrary.SMB1
                 case NTTransactSubcommandName.NT_TRANSACT_IOCTL:
                     return new NTTransactIOCTLRequest(setup, data);
                 case NTTransactSubcommandName.NT_TRANSACT_SET_SECURITY_DESC:
-                    return new NTTransactSetSecurityDescriptor(parameters, data);
+                    return new NTTransactSetSecurityDescriptorRequest(parameters, data);
                 case NTTransactSubcommandName.NT_TRANSACT_NOTIFY_CHANGE:
                     return new NTTransactNotifyChangeRequest(setup);
                 case NTTransactSubcommandName.NT_TRANSACT_QUERY_SECURITY_DESC:

+ 2 - 1
SMBLibrary/SMBLibrary.csproj

@@ -414,7 +414,8 @@
     <Compile Include="SMB1\NTTransactSubcommands\NTTransactNotifyChangeResponse.cs" />
     <Compile Include="SMB1\NTTransactSubcommands\NTTransactQuerySecurityDescriptorRequest.cs" />
     <Compile Include="SMB1\NTTransactSubcommands\NTTransactQuerySecurityDescriptorResponse.cs" />
-    <Compile Include="SMB1\NTTransactSubcommands\NTTransactSetSecurityDescriptor.cs" />
+    <Compile Include="SMB1\NTTransactSubcommands\NTTransactSetSecurityDescriptorRequest.cs" />
+    <Compile Include="SMB1\NTTransactSubcommands\NTTransactSetSecurityDescriptorResponse.cs" />
     <Compile Include="SMB1\NTTransactSubcommands\NTTransactSubcommand.cs" />
     <Compile Include="SMB1\ServiceNameHelper.cs" />
     <Compile Include="SMB1\SMB1Header.cs" />

+ 1 - 1
SMBLibrary/Server/SMB1/NTTransactHelper.cs

@@ -96,7 +96,7 @@ namespace SMBLibrary.Server.SMB1
             {
                 subcommandResponse = GetSubcommandResponse(header, maxDataCount, (NTTransactIOCTLRequest)subcommand, share, state);
             }
-            else if (subcommand is NTTransactSetSecurityDescriptor)
+            else if (subcommand is NTTransactSetSecurityDescriptorRequest)
             {
                 header.Status = NTStatus.STATUS_NOT_IMPLEMENTED;
             }