public class NTProtocolHandler extends Object
The NT protocol handler processes the additional SMBs that were added to the protocol in the NT SMB dialect.
Modifier and Type | Field and Description |
---|---|
static long |
DotFileDateTime |
static boolean |
FakeOpLocks |
static int |
FileSizeChangeRate |
protected SMBSrvSession |
m_sess |
static int |
MaxPathLength |
static int |
NTFSStreamsInfoBufsize |
static boolean |
ReturnDotFiles |
protected static int |
SearchInfoLen |
protected static int |
StandardAttributes |
Modifier | Constructor and Description |
---|---|
protected |
NTProtocolHandler()
Class constructor.
|
protected |
NTProtocolHandler(SMBSrvSession sess)
Class constructor
|
Modifier and Type | Method and Description |
---|---|
protected SrvDiskInfo |
getDiskInformation(DiskInterface disk,
DiskDeviceContext ctx)
Get disk sizing information from the specified driver and context.
|
String |
getName()
Return the protocol name
|
protected SMBSrvSession |
getSession()
Get the server session that this protocol handler is associated with.
|
protected VolumeInfo |
getVolumeInformation(DiskInterface disk,
DiskDeviceContext ctx)
Get disk volume information from the specified driver and context
|
protected boolean |
hasChainedCommand(SMBSrvPacket pkt)
Determine if the request is a chained (AndX) type command and there is a chained
command in this request.
|
protected boolean |
isValidPath(String path)
Check if a path contains any illegal characters, for file/create open/create/rename/get info
|
protected boolean |
isValidSearchPath(String path)
Check if a path contains any illegal characters, for a folder search
|
protected void |
MapExceptionToSMBError(Exception ex)
Map a Java exception class to an SMB error code, and return an error response to the caller.
|
protected int |
packSearchInfo(byte[] buf,
int bufPos,
String searchStr,
int resumeId,
int searchId,
FileInfo info)
Pack file information for a search into the specified buffer.
|
protected int |
procAndXCommands(SMBSrvPacket smbPkt,
NetworkFile file)
Process the chained SMB commands (AndX).
|
protected int |
procChainedClose(int cmdOff,
SMBSrvPacket smbPkt,
SMBSrvPacket respPkt,
int endOff)
Process a chained close file request
|
protected int |
procChainedReadAndX(int cmdOff,
SMBSrvPacket smbPkt,
SMBSrvPacket respPkt,
int endOff,
NetworkFile netFile)
Process a chained read file request
|
protected int |
procChainedTreeConnectAndX(int cmdOff,
SMBSrvPacket smbPkt,
SMBSrvPacket respPkt,
int endOff)
Process a chained tree connect request.
|
protected void |
procCheckDirectory(SMBSrvPacket smbPkt)
Check if the specified path exists, and is a directory.
|
protected void |
procCloseFile(SMBSrvPacket smbPkt)
Close a file that has been opened on the server.
|
protected void |
procCreateDirectory(SMBSrvPacket smbPkt)
Create a new directory.
|
protected void |
procCreateFile(SMBSrvPacket smbPkt)
Create a new file on the server.
|
protected void |
procCreateTemporaryFile(SMBSrvPacket smbPkt)
Create a temporary file.
|
protected void |
procDeleteDirectory(SMBSrvPacket smbPkt)
Delete a directory.
|
protected void |
procDeleteFile(SMBSrvPacket smbPkt)
Delete a file.
|
protected void |
procDiskAttributes(SMBSrvPacket smbPkt)
Get disk attributes processing.
|
protected void |
procEcho(SMBSrvPacket smbPkt)
Echo packet request.
|
protected void |
procFindClose(SMBSrvPacket smbPkt)
Close a search started via the transact2 find first/next command.
|
protected void |
procFlushFile(SMBSrvPacket smbPkt)
Flush the specified file.
|
protected void |
procGetFileAttributes(SMBSrvPacket smbPkt)
Get the file attributes for the specified file.
|
protected void |
procGetFileInformation(SMBSrvPacket smbPkt)
Get file information.
|
protected void |
procLockFile(SMBSrvPacket smbPkt) |
protected void |
procLockingAndX(SMBSrvPacket smbPkt)
Process the file lock/unlock request.
|
protected void |
procLogoffAndX(SMBSrvPacket smbPkt)
Process the logoff request.
|
protected void |
procNTCancel(SMBSrvPacket smbPkt)
Process the cancel request.
|
protected void |
procNTCreateAndX(SMBSrvPacket smbPkt)
Process the file create/open request.
|
protected void |
procNTTransactCreate(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
NTTransPacket smbPkt)
Process an NT create file/directory transaction
|
protected void |
procNTTransactIOCtl(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
NTTransPacket smbPkt)
Process an NT I/O control transaction
|
protected void |
procNTTransaction(SMBSrvPacket smbPkt)
Process an NT transaction
|
protected void |
procNTTransactionSecondary(SMBSrvPacket smbPkt)
Process an NT transaction secondary packet
|
protected void |
procNTTransactNotifyChange(NTTransPacket ntpkt,
SMBSrvPacket smbPkt)
Process an NT change notification transaction
|
protected void |
procNTTransactQuerySecurityDesc(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
NTTransPacket smbPkt)
Process an NT query security descriptor transaction
|
protected void |
procNTTransactRename(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
NTTransPacket smbPkt)
Process an NT rename via handle transaction
|
protected void |
procNTTransactSetSecurityDesc(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
NTTransPacket smbPkt)
Process an NT set security descriptor transaction
|
protected void |
procOpenAndX(SMBSrvPacket smbPkt)
Process the file open request.
|
protected void |
procOpenFile(SMBSrvPacket smbPkt)
Open a file on the server.
|
protected void |
procProcessExit(SMBSrvPacket smbPkt)
Process exit, close all open files.
|
protected void |
procReadAndX(SMBSrvPacket smbPkt)
Process the file read request.
|
protected void |
procReadFile(SMBSrvPacket smbPkt)
Read from a file that has been opened on the server.
|
protected void |
procRenameFile(SMBSrvPacket smbPkt)
Rename a file.
|
protected void |
procSearch(SMBSrvPacket smbPkt)
Start/continue a directory search operation.
|
protected void |
procSearchVolumeLabel(SMBSrvPacket smbPkt)
Process a search request that is for the volume label.
|
protected void |
procSeekFile(SMBSrvPacket smbPkt)
Seek to the specified file position within the open file.
|
protected void |
procSessionSetup(SMBSrvPacket smbPkt)
Process the NT SMB session setup request.
|
protected void |
procSetFileAttributes(SMBSrvPacket smbPkt)
Set the file attributes for a file.
|
protected void |
procSetFileInformation(SMBSrvPacket smbPkt)
Set file information.
|
protected void |
procTrans2FindFirst(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 file search request.
|
protected void |
procTrans2FindNext(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 file search continue request.
|
protected void |
procTrans2QueryFile(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 query file information (via handle) request.
|
protected void |
procTrans2QueryFileSys(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 file system query request.
|
protected void |
procTrans2QueryPath(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 query path information request.
|
protected void |
procTrans2SetFile(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 set file information (via handle) request.
|
protected void |
procTrans2SetPath(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf,
SMBSrvPacket smbPkt)
Process a transact2 set path information request.
|
protected void |
procTransact2(SMBSrvPacket smbPkt)
Process a transact2 request.
|
protected void |
procTransact2Secondary(SMBSrvPacket smbPkt)
Process a transact2 secondary request.
|
protected void |
procTreeConnect(SMBSrvPacket smbPkt)
Process the SMB tree connect request.
|
protected void |
procTreeConnectAndX(SMBSrvPacket smbPkt)
Process the SMB tree connect request.
|
protected void |
procTreeDisconnect(SMBSrvPacket smbPkt)
Process the SMB tree disconnect request.
|
protected void |
procUnLockFile(SMBSrvPacket smbPkt)
Unlock a byte range in the specified file.
|
protected void |
procUnsupported(SMBSrvPacket smbPkt)
Unsupported SMB procesing.
|
protected void |
procWriteAndCloseFile(SMBSrvPacket smbPkt)
Write to a file then close the file.
|
protected void |
procWriteAndX(SMBSrvPacket smbPkt)
Process the file write request.
|
protected void |
procWriteFile(SMBSrvPacket smbPkt)
Write to a file.
|
boolean |
runProtocol(SMBSrvPacket smbPkt)
Run the NT SMB protocol handler to process the received SMB packet
|
protected void |
runRequestPostProcessors(SrvSession sess)
Run any request post processors that are queued for a session
|
protected void |
setSession(SMBSrvSession sess)
Set the server session that this protocol handler is associated with.
|
public static final boolean ReturnDotFiles
public static final long DotFileDateTime
public static final boolean FakeOpLocks
public static final int FileSizeChangeRate
public static final int MaxPathLength
public static final int NTFSStreamsInfoBufsize
protected static final int StandardAttributes
protected static final int SearchInfoLen
protected SMBSrvSession m_sess
protected NTProtocolHandler()
protected NTProtocolHandler(SMBSrvSession sess)
sess
- SMBSrvSessionpublic String getName()
public boolean runProtocol(SMBSrvPacket smbPkt) throws IOException, SMBSrvException, TooManyConnectionsException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
TooManyConnectionsException
protected void procSessionSetup(SMBSrvPacket smbPkt) throws SMBSrvException, IOException, TooManyConnectionsException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
TooManyConnectionsException
protected final int procAndXCommands(SMBSrvPacket smbPkt, NetworkFile file)
smbPkt
- Request packet.file
- Current file , or null if no file context in chainprotected final int procChainedTreeConnectAndX(int cmdOff, SMBSrvPacket smbPkt, SMBSrvPacket respPkt, int endOff)
cmdOff
- int Offset to the chained command within the request packet.smbPkt
- Request packet.respPkt
- Response packetendOff
- int Offset to the current end of the reply packet.protected final int procChainedReadAndX(int cmdOff, SMBSrvPacket smbPkt, SMBSrvPacket respPkt, int endOff, NetworkFile netFile)
cmdOff
- Offset to the chained command within the request packet.smbPkt
- Request packet.respPkt
- Response packetendOff
- Offset to the current end of the reply packet.netFile
- File to be read, passed down the chained requestsprotected final int procChainedClose(int cmdOff, SMBSrvPacket smbPkt, SMBSrvPacket respPkt, int endOff)
cmdOff
- int Offset to the chained command within the request packet.smbPkt
- Request packet.respPkt
- Response packetendOff
- int Offset to the current end of the reply packet.protected void procTreeConnectAndX(SMBSrvPacket smbPkt) throws SMBSrvException, TooManyConnectionsException, IOException
smbPkt
- Request packet.IOException
SMBSrvException
TooManyConnectionsException
protected void procCloseFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected void procTransact2(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected void procTransact2Secondary(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procFindClose(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procLockingAndX(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procLogoffAndX(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procOpenAndX(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procReadAndX(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected void procRenameFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected void procDeleteFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected void procDeleteDirectory(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2FindFirst(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2FindNext(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2QueryFileSys(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2QueryPath(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2QueryFile(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2SetFile(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procTrans2SetPath(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
tbuf
- Transaction request detailssmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procWriteAndX(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procNTCreateAndX(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procNTCancel(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procNTTransaction(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procNTTransactionSecondary(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procNTTransactCreate(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, NTTransPacket smbPkt) throws IOException, SMBSrvException
tbuf
- TransactBuffersmbPkt
- NTTransPacketIOException
SMBSrvException
protected final void procNTTransactIOCtl(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, NTTransPacket smbPkt) throws IOException, SMBSrvException
tbuf
- TransactBuffersmbPkt
- NTTransPacketIOException
SMBSrvException
protected final void procNTTransactQuerySecurityDesc(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, NTTransPacket smbPkt) throws IOException, SMBSrvException
tbuf
- TransactBuffersmbPkt
- NTTransPacketIOException
SMBSrvException
protected final void procNTTransactSetSecurityDesc(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, NTTransPacket smbPkt) throws IOException, SMBSrvException
tbuf
- TransactBuffersmbPkt
- NTTransPacketIOException
SMBSrvException
protected final void procNTTransactNotifyChange(NTTransPacket ntpkt, SMBSrvPacket smbPkt) throws IOException, SMBSrvException
ntpkt
- NTTransPacketsmbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procNTTransactRename(org.alfresco.jlan.smb.server.SrvTransactBuffer tbuf, NTTransPacket smbPkt) throws IOException, SMBSrvException
tbuf
- TransactBuffersmbPkt
- NTTransPacketIOException
SMBSrvException
protected final void MapExceptionToSMBError(Exception ex)
ex
- java.lang.Exceptionprotected boolean isValidPath(String path)
path
- Stringprotected boolean isValidSearchPath(String path)
path
- Stringprotected final int packSearchInfo(byte[] buf, int bufPos, String searchStr, int resumeId, int searchId, FileInfo info)
buf
- byte[] Buffer to store data.bufPos
- int Position to start storing data.searchStr
- Search context string.resumeId
- int Resume idsearchId
- Search context idinfo
- File data to be packed.protected void procCheckDirectory(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procCreateDirectory(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procCreateFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procCreateTemporaryFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procDiskAttributes(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.protected void procEcho(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procFlushFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procGetFileAttributes(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.protected void procGetFileInformation(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procLockFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procOpenFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.protected void procProcessExit(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procReadFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.protected final void procSearch(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.protected final void procSearchVolumeLabel(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected final void procSeekFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
SMBSrvException
protected void procSetFileAttributes(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procSetFileInformation(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procTreeConnect(SMBSrvPacket smbPkt) throws SMBSrvException, TooManyConnectionsException, IOException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.TooManyConnectionsException
- Too many concurrent connections
on this session.protected void procTreeDisconnect(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- Response SMB packet.IOException
- The exception description.SMBSrvException
- The exception description.protected void procUnLockFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected final void procUnsupported(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procWriteFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected void procWriteAndCloseFile(SMBSrvPacket smbPkt) throws IOException, SMBSrvException
smbPkt
- SMBSrvPacketIOException
- The exception description.SMBSrvException
- The exception description.protected final SMBSrvSession getSession()
protected final void setSession(SMBSrvSession sess)
sess
- SMBSrvSessionprotected final boolean hasChainedCommand(SMBSrvPacket pkt)
pkt
- SMBSrvPacketprotected final SrvDiskInfo getDiskInformation(DiskInterface disk, DiskDeviceContext ctx) throws IOException
disk
- DiskInterfacectx
- DiskDeviceContextIOException
protected final VolumeInfo getVolumeInformation(DiskInterface disk, DiskDeviceContext ctx)
disk
- DiskInterfacectx
- DiskDeviceContextprotected final void runRequestPostProcessors(SrvSession sess)
sess
- SrvSessionCopyright © 2005–2018 Alfresco Software. All rights reserved.