mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-25 18:38:14 +02:00
AccessMask related bugfixes
This commit is contained in:
parent
584ca8da61
commit
2a4cb0f789
1 changed files with 7 additions and 6 deletions
|
@ -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
|
* 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,
|
* the GNU Lesser Public License as published by the Free Software Foundation,
|
||||||
|
@ -12,6 +12,7 @@ using Utilities;
|
||||||
namespace SMBLibrary
|
namespace SMBLibrary
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
/// [MS-CIFS] SMB_COM_NT_CREATE_ANDX request (DesiredAccess field) and NT_TRANSACT_CREATE request (DesiredAccess field)
|
||||||
/// [MS-SMB] 2.2.1.4.1 - File_Pipe_Printer_Access_Mask
|
/// [MS-SMB] 2.2.1.4.1 - File_Pipe_Printer_Access_Mask
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Flags]
|
[Flags]
|
||||||
|
@ -32,7 +33,7 @@ namespace SMBLibrary
|
||||||
SYNCHRONIZE = 0x00100000,
|
SYNCHRONIZE = 0x00100000,
|
||||||
ACCESS_SYSTEM_SECURITY = 0x01000000,
|
ACCESS_SYSTEM_SECURITY = 0x01000000,
|
||||||
MAXIMUM_ALLOWED = 0x02000000,
|
MAXIMUM_ALLOWED = 0x02000000,
|
||||||
GENERIC_ALL = 0x20000000,
|
GENERIC_ALL = 0x10000000,
|
||||||
GENERIC_EXECUTE = 0x20000000,
|
GENERIC_EXECUTE = 0x20000000,
|
||||||
GENERIC_WRITE = 0x40000000,
|
GENERIC_WRITE = 0x40000000,
|
||||||
GENERIC_READ = 0x80000000,
|
GENERIC_READ = 0x80000000,
|
||||||
|
@ -60,7 +61,7 @@ namespace SMBLibrary
|
||||||
SYNCHRONIZE = 0x00100000,
|
SYNCHRONIZE = 0x00100000,
|
||||||
ACCESS_SYSTEM_SECURITY = 0x01000000,
|
ACCESS_SYSTEM_SECURITY = 0x01000000,
|
||||||
MAXIMUM_ALLOWED = 0x02000000,
|
MAXIMUM_ALLOWED = 0x02000000,
|
||||||
GENERIC_ALL = 0x20000000,
|
GENERIC_ALL = 0x10000000,
|
||||||
GENERIC_EXECUTE = 0x20000000,
|
GENERIC_EXECUTE = 0x20000000,
|
||||||
GENERIC_WRITE = 0x40000000,
|
GENERIC_WRITE = 0x40000000,
|
||||||
GENERIC_READ = 0x80000000,
|
GENERIC_READ = 0x80000000,
|
||||||
|
@ -74,7 +75,7 @@ namespace SMBLibrary
|
||||||
public const int Length = 4;
|
public const int Length = 4;
|
||||||
|
|
||||||
public FileAccessMask File;
|
public FileAccessMask File;
|
||||||
public FileAccessMask Directory;
|
public DirectoryAccessMask Directory;
|
||||||
|
|
||||||
public AccessMask(byte[] buffer, ref int offset) : this(buffer, offset)
|
public AccessMask(byte[] buffer, ref int offset) : this(buffer, offset)
|
||||||
{
|
{
|
||||||
|
@ -85,12 +86,12 @@ namespace SMBLibrary
|
||||||
{
|
{
|
||||||
uint value = LittleEndianConverter.ToUInt32(buffer, offset);
|
uint value = LittleEndianConverter.ToUInt32(buffer, offset);
|
||||||
File = (FileAccessMask)value;
|
File = (FileAccessMask)value;
|
||||||
Directory = (FileAccessMask)value;
|
Directory = (DirectoryAccessMask)value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void WriteBytes(byte[] buffer, int offset)
|
public void WriteBytes(byte[] buffer, int offset)
|
||||||
{
|
{
|
||||||
uint value = (uint)(this.File | this.Directory);
|
uint value = (uint)this.File | (uint)this.Directory;
|
||||||
LittleEndianWriter.WriteUInt32(buffer, offset, value);
|
LittleEndianWriter.WriteUInt32(buffer, offset, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue