Browse Source

INTFileStore: Added GetSecurityInformation and SetSecurityInformation methods

Tal Aloni 7 years ago
parent
commit
e6e7bbe412

+ 11 - 0
SMBLibrary/Client/SMB1FileStore.cs

@@ -303,6 +303,17 @@ namespace SMBLibrary.Client
             return NTStatus.STATUS_INVALID_SMB;
         }
 
+        public NTStatus GetSecurityInformation(out SecurityDescriptor result, object handle, SecurityInformation securityInformation)
+        {
+            result = null;
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus SetSecurityInformation(object handle, SecurityInformation securityInformation, SecurityDescriptor securityDescriptor)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         {
             throw new NotImplementedException();

+ 11 - 0
SMBLibrary/Client/SMB2FileStore.cs

@@ -144,6 +144,17 @@ namespace SMBLibrary.Client
             throw new NotImplementedException();
         }
 
+        public NTStatus GetSecurityInformation(out SecurityDescriptor result, object handle, SecurityInformation securityInformation)
+        {
+            result = null;
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus SetSecurityInformation(object handle, SecurityInformation securityInformation, SecurityDescriptor securityDescriptor)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         {
             throw new NotImplementedException();

+ 11 - 0
SMBLibrary/NTFileStore/Adapter/NTFileSystemAdapter.cs

@@ -392,6 +392,17 @@ namespace SMBLibrary
             return NTStatus.STATUS_NOT_SUPPORTED;
         }
 
+        public NTStatus GetSecurityInformation(out SecurityDescriptor result, object handle, SecurityInformation securityInformation)
+        {
+            result = null;
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus SetSecurityInformation(object handle, SecurityInformation securityInformation, SecurityDescriptor securityDescriptor)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         {
             ioRequest = null;

+ 4 - 0
SMBLibrary/NTFileStore/INTFileStore.cs

@@ -40,6 +40,10 @@ namespace SMBLibrary
 
         NTStatus GetFileSystemInformation(out FileSystemInformation result, FileSystemInformationClass informationClass);
 
+        NTStatus GetSecurityInformation(out SecurityDescriptor result, object handle, SecurityInformation securityInformation);
+
+        NTStatus SetSecurityInformation(object handle, SecurityInformation securityInformation, SecurityDescriptor securityDescriptor);
+
         /// <summary>
         /// Monitor the contents of a directory (and its subdirectories) by using change notifications.
         /// When something changes within the directory being watched this operation is completed.

+ 11 - 0
SMBLibrary/NTFileStore/NamedPipeStore.cs

@@ -209,6 +209,17 @@ namespace SMBLibrary
             return NTStatus.STATUS_NOT_SUPPORTED;
         }
 
+        public NTStatus GetSecurityInformation(out SecurityDescriptor result, object handle, SecurityInformation securityInformation)
+        {
+            result = null;
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
+        public NTStatus SetSecurityInformation(object handle, SecurityInformation securityInformation, SecurityDescriptor securityDescriptor)
+        {
+            return NTStatus.STATUS_NOT_SUPPORTED;
+        }
+
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         {
             ioRequest = null;

+ 12 - 0
SMBLibrary/Win32/NTFileStore/NTDirectoryFileSystem.cs

@@ -362,6 +362,18 @@ namespace SMBLibrary.Win32
             return status;
         }
 
+        public NTStatus GetSecurityInformation(out SecurityDescriptor result, object handle, SecurityInformation securityInformation)
+        {
+            result = null;
+            return NTStatus.STATUS_INVALID_DEVICE_REQUEST;
+        }
+
+        public NTStatus SetSecurityInformation(object handle, SecurityInformation securityInformation, SecurityDescriptor securityDescriptor)
+        {
+            // [MS-FSA] If the object store does not implement security, the operation MUST be failed with STATUS_INVALID_DEVICE_REQUEST.
+            return NTStatus.STATUS_INVALID_DEVICE_REQUEST;
+        }
+
         public NTStatus NotifyChange(out object ioRequest, object handle, NotifyChangeFilter completionFilter, bool watchTree, int outputBufferSize, OnNotifyChangeCompleted onNotifyChangeCompleted, object context)
         {
             byte[] buffer = new byte[outputBufferSize];