Updates to the CIFS protocol handlers to use the new authentication code.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2761 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Gary Spencer
2006-05-04 15:34:49 +00:00
parent d021b46d07
commit a937dfa608
15 changed files with 381 additions and 569 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2005 Alfresco, Inc.
* Copyright (C) 2005-2006 Alfresco, Inc.
*
* Licensed under the Mozilla Public License version 1.1
* with a permitted attribution clause. You may obtain a
@@ -17,6 +17,7 @@
package org.alfresco.filesys.smb.server;
import org.alfresco.filesys.smb.SMBErrorText;
import org.alfresco.filesys.smb.SMBStatus;
/**
* SMB exception class
@@ -35,9 +36,16 @@ public class SMBSrvException extends Exception
// SMB error code
protected int m_errorcode;
// NT 32-bit error code
protected int m_NTerror;
/**
* Construct an SMB exception with the specified error class/error code.
*
* @param errclass int
* @param errcode int
*/
public SMBSrvException(int errclass, int errcode)
{
@@ -49,6 +57,10 @@ public class SMBSrvException extends Exception
/**
* Construct an SMB exception with the specified error class/error code and additional text
* error message.
*
* @param errclass int
* @param errcode int
* @param msg String
*/
public SMBSrvException(int errclass, int errcode, String msg)
{
@@ -59,6 +71,8 @@ public class SMBSrvException extends Exception
/**
* Construct an SMB exception using the error class/error code in the SMB packet
*
* @param pkt SMBSrvPacket
*/
protected SMBSrvException(SMBSrvPacket pkt)
{
@@ -67,6 +81,21 @@ public class SMBSrvException extends Exception
m_errorcode = pkt.getErrorCode();
}
/**
* Construct an SMB exception with the specified error class/error code.
*
* @param nterror int
* @param errclass int
* @param errcode int
*/
public SMBSrvException(int nterror, int errclass, int errcode)
{
super(SMBErrorText.ErrorString(errclass, errcode));
m_errorclass = errclass;
m_errorcode = errcode;
m_NTerror = nterror;
}
/**
* Return the error class for this SMB exception.
*
@@ -87,6 +116,15 @@ public class SMBSrvException extends Exception
return m_errorcode;
}
/**
* Return the NT error code
*
* @return int
*/
public int getNTErrorCode() {
return m_NTerror;
}
/**
* Return the error text for the SMB exception
*
@@ -94,6 +132,8 @@ public class SMBSrvException extends Exception
*/
public String getErrorText()
{
if ( getNTErrorCode() != 0)
return SMBErrorText.ErrorString(SMBStatus.NTErr, getNTErrorCode());
return SMBErrorText.ErrorString(m_errorclass, m_errorcode);
}
}