Remove linefeed characters
This commit is contained in:
parent
54210a90b8
commit
aca2b715b1
30
CASA/micasad/cache/IKeychain.cs
vendored
30
CASA/micasad/cache/IKeychain.cs
vendored
@ -20,18 +20,18 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
interface IKeychain
|
||||
{
|
||||
|
||||
void AddSecret(Secret mySecret);
|
||||
void RemoveSecret(String secretID);
|
||||
Secret GetSecret(string secretID);
|
||||
// IEnumerator getAllSecrets();
|
||||
}
|
||||
|
||||
}
|
||||
using System;
|
||||
using System.Collections;
|
||||
namespace sscs.cache
|
||||
{
|
||||
|
||||
interface IKeychain
|
||||
{
|
||||
|
||||
void AddSecret(Secret mySecret);
|
||||
void RemoveSecret(String secretID);
|
||||
Secret GetSecret(string secretID);
|
||||
// IEnumerator getAllSecrets();
|
||||
}
|
||||
|
||||
}
|
||||
|
28
CASA/micasad/cache/ISecret.cs
vendored
28
CASA/micasad/cache/ISecret.cs
vendored
@ -20,17 +20,17 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
namespace sscs.cache
|
||||
{
|
||||
interface ISecret
|
||||
{
|
||||
//Setter methods
|
||||
void SetValue(byte[] key);
|
||||
void SetKey(String newkey);
|
||||
|
||||
//Get methods
|
||||
byte[] GetValue(String key);
|
||||
string GetKey();
|
||||
}
|
||||
}
|
||||
using System;
|
||||
namespace sscs.cache
|
||||
{
|
||||
interface ISecret
|
||||
{
|
||||
//Setter methods
|
||||
void SetValue(byte[] key);
|
||||
void SetKey(String newkey);
|
||||
|
||||
//Get methods
|
||||
byte[] GetValue(String key);
|
||||
string GetKey();
|
||||
}
|
||||
}
|
||||
|
4
CASA/micasad/cache/KeyChain.cs
vendored
4
CASA/micasad/cache/KeyChain.cs
vendored
@ -113,13 +113,13 @@ class KeyChain : IKeychain
|
||||
public void RemoveSecret(String secretID)
|
||||
{
|
||||
// remove all keyvalues first, as to unlink reverse links
|
||||
try
|
||||
try
|
||||
{
|
||||
Secret secret = GetSecret(secretID);
|
||||
secret.RemoveAllKeyValuePairs(this);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
{
|
||||
CSSSLogger.ExpLog(e.ToString());
|
||||
}
|
||||
|
||||
|
54
CASA/micasad/cache/KeyValue.cs
vendored
54
CASA/micasad/cache/KeyValue.cs
vendored
@ -33,21 +33,21 @@ namespace sscs.cache
|
||||
public static int VALUE_TYPE_STRING = 0;
|
||||
public static int VALUE_TYPE_BINARY = 1;
|
||||
|
||||
private int m_iValueType = VALUE_TYPE_STRING;
|
||||
|
||||
private bool m_IsPersistent = true;
|
||||
public bool IsPersistent
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsPersistent;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsPersistent = value;
|
||||
}
|
||||
private int m_iValueType = VALUE_TYPE_STRING;
|
||||
|
||||
private bool m_IsPersistent = true;
|
||||
public bool IsPersistent
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_IsPersistent;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_IsPersistent = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private string m_key;
|
||||
public string Key
|
||||
{
|
||||
@ -152,10 +152,10 @@ namespace sscs.cache
|
||||
get
|
||||
{
|
||||
return m_created;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_created = value;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_created = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,10 +165,10 @@ namespace sscs.cache
|
||||
get
|
||||
{
|
||||
return m_modified;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_modified = value;
|
||||
}
|
||||
set
|
||||
{
|
||||
m_modified = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -230,11 +230,11 @@ namespace sscs.cache
|
||||
public int GetValueType()
|
||||
{
|
||||
return m_iValueType;
|
||||
}
|
||||
|
||||
internal void SetValueType(int iValueType)
|
||||
{
|
||||
m_iValueType = iValueType;
|
||||
}
|
||||
|
||||
internal void SetValueType(int iValueType)
|
||||
{
|
||||
m_iValueType = iValueType;
|
||||
}
|
||||
|
||||
public string ToXML()
|
||||
|
44
CASA/micasad/cache/Secret.cs
vendored
44
CASA/micasad/cache/Secret.cs
vendored
@ -194,11 +194,11 @@ namespace sscs.cache
|
||||
public string GetKey()
|
||||
{
|
||||
return secretID;
|
||||
}
|
||||
|
||||
public void SetKeyValue(string key, string value)
|
||||
{
|
||||
SetKeyValue(key, value, true);
|
||||
}
|
||||
|
||||
public void SetKeyValue(string key, string value)
|
||||
{
|
||||
SetKeyValue(key, value, true);
|
||||
}
|
||||
|
||||
public void SetKeyValue(string key, string value, bool bUpdateSecretModifiedTime)
|
||||
@ -213,17 +213,17 @@ namespace sscs.cache
|
||||
{
|
||||
kv = new KeyValue(key, value);
|
||||
htKeyValues.Add(key, kv);
|
||||
}
|
||||
|
||||
if (bUpdateSecretModifiedTime)
|
||||
{
|
||||
this.ModifiedTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetKeyValue(string key, byte[] baValue)
|
||||
{
|
||||
SetKeyValue(key, baValue, true);
|
||||
|
||||
if (bUpdateSecretModifiedTime)
|
||||
{
|
||||
this.ModifiedTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetKeyValue(string key, byte[] baValue)
|
||||
{
|
||||
SetKeyValue(key, baValue, true);
|
||||
}
|
||||
|
||||
public void SetKeyValue(string key, byte[] baValue, bool bUpdateModifiedTime)
|
||||
@ -238,11 +238,11 @@ namespace sscs.cache
|
||||
{
|
||||
kv = new KeyValue(key, baValue);
|
||||
htKeyValues.Add(key, kv);
|
||||
}
|
||||
|
||||
if (bUpdateModifiedTime)
|
||||
{
|
||||
this.ModifiedTime = DateTime.Now;
|
||||
}
|
||||
|
||||
if (bUpdateModifiedTime)
|
||||
{
|
||||
this.ModifiedTime = DateTime.Now;
|
||||
}
|
||||
}
|
||||
|
||||
@ -261,13 +261,13 @@ namespace sscs.cache
|
||||
internal void RemoveAllKeyValuePairs(KeyChain kc)
|
||||
{
|
||||
if (htKeyValues != null)
|
||||
{
|
||||
{
|
||||
IDictionaryEnumerator enumer = htKeyValues.GetEnumerator();
|
||||
while (enumer.MoveNext())
|
||||
{
|
||||
String key = (String)enumer.Key;
|
||||
RemoveKeyValue(kc, key);
|
||||
// refresh enumerator
|
||||
// refresh enumerator
|
||||
enumer = htKeyValues.GetEnumerator();
|
||||
}
|
||||
}
|
||||
|
112
CASA/micasad/cache/SecretStore.cs
vendored
112
CASA/micasad/cache/SecretStore.cs
vendored
@ -68,8 +68,8 @@ namespace sscs.cache
|
||||
|
||||
string m_persistenceDirectory = null;
|
||||
private static string POLICY_DIRECTORY = "/home/.casa";
|
||||
private MPFileWatcher mpWatcher = null;
|
||||
|
||||
private MPFileWatcher mpWatcher = null;
|
||||
|
||||
private Secret m_DesktopSecret = new Secret(ConstStrings.MICASA_DESKTOP_PASSWD);
|
||||
|
||||
private DateTime createTime;
|
||||
@ -793,7 +793,7 @@ namespace sscs.cache
|
||||
if (lss != null)
|
||||
lss.PersistStoreWithDelay();
|
||||
|
||||
if (slss != null)
|
||||
if (slss != null)
|
||||
slss.PersistStore(ConstStrings.SSCS_SERVER_KEY_CHAIN_ID);
|
||||
}
|
||||
|
||||
@ -885,62 +885,62 @@ namespace sscs.cache
|
||||
{
|
||||
if (mpWatcher != null)
|
||||
mpWatcher.resumeWatcher();
|
||||
}
|
||||
|
||||
internal Secret GetDesktopSecret()
|
||||
{
|
||||
if (common.CSSSUtils.StoreDesktopPasswordInCache())
|
||||
{
|
||||
try
|
||||
{
|
||||
string keyChainId = ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + "\0";
|
||||
KeyChain keyChain = GetKeyChain(keyChainId);
|
||||
Secret secret;
|
||||
|
||||
try
|
||||
{
|
||||
secret = keyChain.GetSecret(ConstStrings.MICASA_DESKTOP_PASSWD);
|
||||
return secret;
|
||||
}
|
||||
catch (SecretNotFoundException e)
|
||||
{
|
||||
CSSSLogger.DbgLog("Desktop password not found in cache, creating one");
|
||||
secret = new Secret(ConstStrings.MICASA_DESKTOP_PASSWD);
|
||||
keyChain.AddSecret(secret);
|
||||
return secret;
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
CSSSLogger.DbgLog(e1.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
CSSSLogger.DbgLog("KeyChain does not exist");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_DesktopSecret;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal Secret GetDesktopSecret()
|
||||
{
|
||||
if (common.CSSSUtils.StoreDesktopPasswordInCache())
|
||||
{
|
||||
try
|
||||
{
|
||||
string keyChainId = ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + "\0";
|
||||
KeyChain keyChain = GetKeyChain(keyChainId);
|
||||
Secret secret;
|
||||
|
||||
try
|
||||
{
|
||||
secret = keyChain.GetSecret(ConstStrings.MICASA_DESKTOP_PASSWD);
|
||||
return secret;
|
||||
}
|
||||
catch (SecretNotFoundException e)
|
||||
{
|
||||
CSSSLogger.DbgLog("Desktop password not found in cache, creating one");
|
||||
secret = new Secret(ConstStrings.MICASA_DESKTOP_PASSWD);
|
||||
keyChain.AddSecret(secret);
|
||||
return secret;
|
||||
}
|
||||
catch (Exception e1)
|
||||
{
|
||||
CSSSLogger.DbgLog(e1.ToString());
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
CSSSLogger.DbgLog("KeyChain does not exist");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return m_DesktopSecret;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
internal string GetDesktopPasswd()
|
||||
{
|
||||
try
|
||||
{
|
||||
Secret secret = GetDesktopSecret();
|
||||
if (secret != null)
|
||||
{
|
||||
string passwd = secret.GetKeyValue(ConstStrings.MICASA_DESKTOP_PASSWD_KEYNAME).GetValue();
|
||||
return passwd;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
CSSSLogger.DbgLog("Desktop password not set in Session");
|
||||
{
|
||||
try
|
||||
{
|
||||
Secret secret = GetDesktopSecret();
|
||||
if (secret != null)
|
||||
{
|
||||
string passwd = secret.GetKeyValue(ConstStrings.MICASA_DESKTOP_PASSWD_KEYNAME).GetValue();
|
||||
return passwd;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
CSSSLogger.DbgLog("Desktop password not set in Session");
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -20,82 +20,82 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
|
||||
//TBD
|
||||
// All user defined exceptions will extend this class in future
|
||||
internal class CSSSException : ApplicationException
|
||||
{
|
||||
internal CSSSException (string message)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
internal class CommunicationException : ApplicationException
|
||||
{
|
||||
internal CommunicationException (String message) : base (message)
|
||||
{
|
||||
}
|
||||
internal CommunicationException (String message, Exception inner) : base(message,inner)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal class MessageFormatException : Exception
|
||||
{
|
||||
internal MessageFormatException (String message) : base (message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal MessageFormatException (String message, Exception inner) : base(message,inner)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class UserNotInSessionException : Exception
|
||||
{
|
||||
internal UserNotInSessionException (String message) : base (message)
|
||||
{
|
||||
CSSSLogger.DbgLog(message);
|
||||
}
|
||||
internal UserNotInSessionException (UserIdentifier user)
|
||||
{
|
||||
CSSSLogger.DbgLog("UserIdentifier is not in session table " + user.GetUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal class KeyChainDoesNotExistException : Exception
|
||||
{
|
||||
internal KeyChainDoesNotExistException (String kId)
|
||||
{
|
||||
CSSSLogger.DbgLog("Keychain - " + kId + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
internal class SecretNotFoundException : Exception
|
||||
{
|
||||
internal SecretNotFoundException (String sId)
|
||||
{
|
||||
CSSSLogger.DbgLog("SecretId - " + sId + " not found");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class CryptoException : ApplicationException
|
||||
{
|
||||
internal CryptoException(string msg)
|
||||
{
|
||||
CSSSLogger.DbgLog("Crypto exception : " + msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
|
||||
//TBD
|
||||
// All user defined exceptions will extend this class in future
|
||||
internal class CSSSException : ApplicationException
|
||||
{
|
||||
internal CSSSException (string message)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
internal class CommunicationException : ApplicationException
|
||||
{
|
||||
internal CommunicationException (String message) : base (message)
|
||||
{
|
||||
}
|
||||
internal CommunicationException (String message, Exception inner) : base(message,inner)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal class MessageFormatException : Exception
|
||||
{
|
||||
internal MessageFormatException (String message) : base (message)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
internal MessageFormatException (String message, Exception inner) : base(message,inner)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class UserNotInSessionException : Exception
|
||||
{
|
||||
internal UserNotInSessionException (String message) : base (message)
|
||||
{
|
||||
CSSSLogger.DbgLog(message);
|
||||
}
|
||||
internal UserNotInSessionException (UserIdentifier user)
|
||||
{
|
||||
CSSSLogger.DbgLog("UserIdentifier is not in session table " + user.GetUID());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal class KeyChainDoesNotExistException : Exception
|
||||
{
|
||||
internal KeyChainDoesNotExistException (String kId)
|
||||
{
|
||||
CSSSLogger.DbgLog("Keychain - " + kId + " not found");
|
||||
}
|
||||
}
|
||||
|
||||
internal class SecretNotFoundException : Exception
|
||||
{
|
||||
internal SecretNotFoundException (String sId)
|
||||
{
|
||||
CSSSLogger.DbgLog("SecretId - " + sId + " not found");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
internal class CryptoException : ApplicationException
|
||||
{
|
||||
internal CryptoException(string msg)
|
||||
{
|
||||
CSSSLogger.DbgLog("Crypto exception : " + msg );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,225 +20,225 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using sscs.common;
|
||||
using sscs.constants;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
/*
|
||||
* This ia a common logging facility for windows and Linux.
|
||||
* This also is the common place to log all server logs and debug logs.
|
||||
*/
|
||||
|
||||
class CSSSLogger
|
||||
{
|
||||
//private static CSSSLogger csssLog = null;
|
||||
//private static string WINID = "Microsoft";
|
||||
private static string engineLog = null;
|
||||
#if DEBUG
|
||||
private static string LINUXID = "Unix";
|
||||
private static string debugLog = null;
|
||||
private static Stream debugStream= null;
|
||||
#endif
|
||||
private static StreamWriter serverTrace= null;
|
||||
private static Mutex dbgmutex = new Mutex();
|
||||
|
||||
static CSSSLogger()
|
||||
{
|
||||
#if DEBUG
|
||||
if (Environment.OSVersion.ToString().StartsWith(LINUXID))
|
||||
{
|
||||
engineLog = ConstStrings.SSCS_LINUX_ENGINELOG;
|
||||
debugLog = ConstStrings.SSCS_LINUX_DEBUGLOG;
|
||||
}
|
||||
else
|
||||
{
|
||||
engineLog = ConstStrings.SSCS_WIN_ENGINELOG;
|
||||
debugLog = ConstStrings.SSCS_WIN_DEBUGLOG;
|
||||
}
|
||||
|
||||
/* There is no set up for Server Trace
|
||||
* open and close would be done when needed.
|
||||
*/
|
||||
|
||||
// Set up for Debug
|
||||
|
||||
if( File.Exists( debugLog ) )
|
||||
{
|
||||
File.Delete( debugLog );
|
||||
}
|
||||
|
||||
debugStream = File.Create(debugLog);
|
||||
|
||||
Debug.Listeners.Add(new TextWriterTraceListener(debugStream));
|
||||
Debug.AutoFlush = true;
|
||||
Debug.Indent();
|
||||
Debug.WriteLine("Debug Log created");
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void log(bool criticality, String message)
|
||||
{
|
||||
if (criticality) // Status message
|
||||
WritetoServerLog(message);
|
||||
else
|
||||
DbgLog(message);
|
||||
}
|
||||
|
||||
public static void log(bool criticality, System.Exception e)
|
||||
{
|
||||
if (criticality) // Status message
|
||||
WritetoServerLog(e.ToString());
|
||||
else
|
||||
DbgLog(e.ToString());
|
||||
|
||||
}
|
||||
|
||||
public static void ExecutionTrace(Object obj)
|
||||
{
|
||||
#if DEBUG
|
||||
StringBuilder message = null;
|
||||
StackTrace st = null;
|
||||
try
|
||||
{
|
||||
message = new StringBuilder();
|
||||
st = new StackTrace(true);
|
||||
}
|
||||
catch( OutOfMemoryException e )
|
||||
{
|
||||
ExpLog(e.ToString());
|
||||
throw e;
|
||||
}
|
||||
Type type = obj.GetType();
|
||||
StackFrame sf = st.GetFrame(1);
|
||||
message.Append(" ThreadID: ");
|
||||
message.Append(Thread.CurrentThread.GetHashCode().ToString());
|
||||
message.Append(" Executing Path: ");
|
||||
message.Append(type.ToString());
|
||||
message.Append(":");
|
||||
if (sf != null)
|
||||
message.Append(sf.GetMethod().ToString());
|
||||
else
|
||||
message.Append("Method unknown");
|
||||
|
||||
log( ConstStrings.DEBUG,message.ToString() );
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void ExecutionTrace(Type type)
|
||||
{
|
||||
#if DEBUG
|
||||
StringBuilder message = null;
|
||||
StackTrace st = null;
|
||||
try
|
||||
{
|
||||
message = new StringBuilder();
|
||||
st = new StackTrace(true);
|
||||
}
|
||||
catch( OutOfMemoryException e )
|
||||
{
|
||||
ExpLog(e.ToString());
|
||||
throw e;
|
||||
}
|
||||
StackFrame sf = st.GetFrame(1);
|
||||
message.Append(" ThreadID: ");
|
||||
message.Append(Thread.CurrentThread.GetHashCode().ToString());
|
||||
message.Append(" Executing Path: ");
|
||||
message.Append(type.ToString());
|
||||
message.Append(":");
|
||||
if (sf != null)
|
||||
message.Append(sf.GetMethod().ToString());
|
||||
else
|
||||
message.Append("Method Unknown");
|
||||
log( ConstStrings.DEBUG,message.ToString() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static string GetExecutionPath(Object obj)
|
||||
{
|
||||
StringBuilder message = null;
|
||||
StackTrace st = null;
|
||||
try
|
||||
{
|
||||
message = new StringBuilder();
|
||||
st = new StackTrace(true);
|
||||
}
|
||||
catch( OutOfMemoryException e )
|
||||
{
|
||||
ExpLog(e.ToString());
|
||||
throw e;
|
||||
}
|
||||
Type type = obj.GetType();
|
||||
StackFrame sf = st.GetFrame(1);
|
||||
message.Append(" ThreadID: ");
|
||||
message.Append(Thread.CurrentThread.GetHashCode().ToString());
|
||||
message.Append(" Executing Path: ");
|
||||
message.Append(type.ToString());
|
||||
message.Append("::");
|
||||
if (sf != null)
|
||||
message.Append(sf.GetMethod().ToString());
|
||||
else
|
||||
message.Append("Method unknown");
|
||||
|
||||
return message.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static void logbreak()
|
||||
{
|
||||
dbgmutex.WaitOne();
|
||||
Debug.WriteLine(" ") ;
|
||||
Debug.WriteLine("----------------------------------------------------") ;
|
||||
Debug.WriteLine(" ") ;
|
||||
dbgmutex.ReleaseMutex();
|
||||
|
||||
}
|
||||
|
||||
// The log format is Time stamp : Machine name: Product name: Logging information
|
||||
private static void WritetoServerLog( string message )
|
||||
{
|
||||
serverTrace = File.AppendText(engineLog);
|
||||
serverTrace.Write("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
|
||||
serverTrace.Write("CSSS");
|
||||
serverTrace.Write(message);
|
||||
serverTrace.Flush();
|
||||
serverTrace.Close();
|
||||
}
|
||||
|
||||
|
||||
// The log format is Time stamp :Component name: Error description
|
||||
public static void DbgLog(string message)
|
||||
{
|
||||
dbgmutex.WaitOne();
|
||||
|
||||
Debug.Write(DateTime.Now.ToLongTimeString());
|
||||
Debug.Write(" " + DateTime.Now.ToLongDateString());
|
||||
Debug.Write(":");
|
||||
Debug.WriteLine(message);
|
||||
// Debug.WriteLine(" ") ;
|
||||
|
||||
dbgmutex.ReleaseMutex();
|
||||
}
|
||||
|
||||
public static void ExpLog(string message)
|
||||
{
|
||||
dbgmutex.WaitOne();
|
||||
|
||||
Debug.Write(DateTime.Now.ToLongTimeString());
|
||||
Debug.Write(" " + DateTime.Now.ToLongDateString());
|
||||
Debug.Write(": Exception encountered - ");
|
||||
Debug.WriteLine(message);
|
||||
Debug.WriteLine(" ") ;
|
||||
StackTrace st = new StackTrace();
|
||||
Debug.WriteLine(st.ToString());
|
||||
|
||||
dbgmutex.ReleaseMutex();
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using sscs.common;
|
||||
using sscs.constants;
|
||||
using System.IO;
|
||||
using System.Threading;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
/*
|
||||
* This ia a common logging facility for windows and Linux.
|
||||
* This also is the common place to log all server logs and debug logs.
|
||||
*/
|
||||
|
||||
class CSSSLogger
|
||||
{
|
||||
//private static CSSSLogger csssLog = null;
|
||||
//private static string WINID = "Microsoft";
|
||||
private static string engineLog = null;
|
||||
#if DEBUG
|
||||
private static string LINUXID = "Unix";
|
||||
private static string debugLog = null;
|
||||
private static Stream debugStream= null;
|
||||
#endif
|
||||
private static StreamWriter serverTrace= null;
|
||||
private static Mutex dbgmutex = new Mutex();
|
||||
|
||||
static CSSSLogger()
|
||||
{
|
||||
#if DEBUG
|
||||
if (Environment.OSVersion.ToString().StartsWith(LINUXID))
|
||||
{
|
||||
engineLog = ConstStrings.SSCS_LINUX_ENGINELOG;
|
||||
debugLog = ConstStrings.SSCS_LINUX_DEBUGLOG;
|
||||
}
|
||||
else
|
||||
{
|
||||
engineLog = ConstStrings.SSCS_WIN_ENGINELOG;
|
||||
debugLog = ConstStrings.SSCS_WIN_DEBUGLOG;
|
||||
}
|
||||
|
||||
/* There is no set up for Server Trace
|
||||
* open and close would be done when needed.
|
||||
*/
|
||||
|
||||
// Set up for Debug
|
||||
|
||||
if( File.Exists( debugLog ) )
|
||||
{
|
||||
File.Delete( debugLog );
|
||||
}
|
||||
|
||||
debugStream = File.Create(debugLog);
|
||||
|
||||
Debug.Listeners.Add(new TextWriterTraceListener(debugStream));
|
||||
Debug.AutoFlush = true;
|
||||
Debug.Indent();
|
||||
Debug.WriteLine("Debug Log created");
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void log(bool criticality, String message)
|
||||
{
|
||||
if (criticality) // Status message
|
||||
WritetoServerLog(message);
|
||||
else
|
||||
DbgLog(message);
|
||||
}
|
||||
|
||||
public static void log(bool criticality, System.Exception e)
|
||||
{
|
||||
if (criticality) // Status message
|
||||
WritetoServerLog(e.ToString());
|
||||
else
|
||||
DbgLog(e.ToString());
|
||||
|
||||
}
|
||||
|
||||
public static void ExecutionTrace(Object obj)
|
||||
{
|
||||
#if DEBUG
|
||||
StringBuilder message = null;
|
||||
StackTrace st = null;
|
||||
try
|
||||
{
|
||||
message = new StringBuilder();
|
||||
st = new StackTrace(true);
|
||||
}
|
||||
catch( OutOfMemoryException e )
|
||||
{
|
||||
ExpLog(e.ToString());
|
||||
throw e;
|
||||
}
|
||||
Type type = obj.GetType();
|
||||
StackFrame sf = st.GetFrame(1);
|
||||
message.Append(" ThreadID: ");
|
||||
message.Append(Thread.CurrentThread.GetHashCode().ToString());
|
||||
message.Append(" Executing Path: ");
|
||||
message.Append(type.ToString());
|
||||
message.Append(":");
|
||||
if (sf != null)
|
||||
message.Append(sf.GetMethod().ToString());
|
||||
else
|
||||
message.Append("Method unknown");
|
||||
|
||||
log( ConstStrings.DEBUG,message.ToString() );
|
||||
#endif
|
||||
}
|
||||
|
||||
public static void ExecutionTrace(Type type)
|
||||
{
|
||||
#if DEBUG
|
||||
StringBuilder message = null;
|
||||
StackTrace st = null;
|
||||
try
|
||||
{
|
||||
message = new StringBuilder();
|
||||
st = new StackTrace(true);
|
||||
}
|
||||
catch( OutOfMemoryException e )
|
||||
{
|
||||
ExpLog(e.ToString());
|
||||
throw e;
|
||||
}
|
||||
StackFrame sf = st.GetFrame(1);
|
||||
message.Append(" ThreadID: ");
|
||||
message.Append(Thread.CurrentThread.GetHashCode().ToString());
|
||||
message.Append(" Executing Path: ");
|
||||
message.Append(type.ToString());
|
||||
message.Append(":");
|
||||
if (sf != null)
|
||||
message.Append(sf.GetMethod().ToString());
|
||||
else
|
||||
message.Append("Method Unknown");
|
||||
log( ConstStrings.DEBUG,message.ToString() );
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
public static string GetExecutionPath(Object obj)
|
||||
{
|
||||
StringBuilder message = null;
|
||||
StackTrace st = null;
|
||||
try
|
||||
{
|
||||
message = new StringBuilder();
|
||||
st = new StackTrace(true);
|
||||
}
|
||||
catch( OutOfMemoryException e )
|
||||
{
|
||||
ExpLog(e.ToString());
|
||||
throw e;
|
||||
}
|
||||
Type type = obj.GetType();
|
||||
StackFrame sf = st.GetFrame(1);
|
||||
message.Append(" ThreadID: ");
|
||||
message.Append(Thread.CurrentThread.GetHashCode().ToString());
|
||||
message.Append(" Executing Path: ");
|
||||
message.Append(type.ToString());
|
||||
message.Append("::");
|
||||
if (sf != null)
|
||||
message.Append(sf.GetMethod().ToString());
|
||||
else
|
||||
message.Append("Method unknown");
|
||||
|
||||
return message.ToString();
|
||||
}
|
||||
|
||||
|
||||
public static void logbreak()
|
||||
{
|
||||
dbgmutex.WaitOne();
|
||||
Debug.WriteLine(" ") ;
|
||||
Debug.WriteLine("----------------------------------------------------") ;
|
||||
Debug.WriteLine(" ") ;
|
||||
dbgmutex.ReleaseMutex();
|
||||
|
||||
}
|
||||
|
||||
// The log format is Time stamp : Machine name: Product name: Logging information
|
||||
private static void WritetoServerLog( string message )
|
||||
{
|
||||
serverTrace = File.AppendText(engineLog);
|
||||
serverTrace.Write("{0} {1}", DateTime.Now.ToLongTimeString(), DateTime.Now.ToLongDateString());
|
||||
serverTrace.Write("CSSS");
|
||||
serverTrace.Write(message);
|
||||
serverTrace.Flush();
|
||||
serverTrace.Close();
|
||||
}
|
||||
|
||||
|
||||
// The log format is Time stamp :Component name: Error description
|
||||
public static void DbgLog(string message)
|
||||
{
|
||||
dbgmutex.WaitOne();
|
||||
|
||||
Debug.Write(DateTime.Now.ToLongTimeString());
|
||||
Debug.Write(" " + DateTime.Now.ToLongDateString());
|
||||
Debug.Write(":");
|
||||
Debug.WriteLine(message);
|
||||
// Debug.WriteLine(" ") ;
|
||||
|
||||
dbgmutex.ReleaseMutex();
|
||||
}
|
||||
|
||||
public static void ExpLog(string message)
|
||||
{
|
||||
dbgmutex.WaitOne();
|
||||
|
||||
Debug.Write(DateTime.Now.ToLongTimeString());
|
||||
Debug.Write(" " + DateTime.Now.ToLongDateString());
|
||||
Debug.Write(": Exception encountered - ");
|
||||
Debug.WriteLine(message);
|
||||
Debug.WriteLine(" ") ;
|
||||
StackTrace st = new StackTrace();
|
||||
Debug.WriteLine(st.ToString());
|
||||
|
||||
dbgmutex.ReleaseMutex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -54,14 +54,14 @@ namespace sscs.constants
|
||||
internal static int SSCS_SECRET_IS_PERSISTENT = -24;
|
||||
internal static int SSCS_SECRET_IS_NOT_PERSISTENT = -25;
|
||||
internal static int SSCS_SECRET_STORE_IS_LOCKED = -26;
|
||||
}
|
||||
|
||||
class SSFLAGS
|
||||
{
|
||||
// used internally by WriteBinaryKey
|
||||
// these are not published in the NDK
|
||||
internal static int FLAG_PERSIST = 0x10000000;
|
||||
internal static int FLAG_DO_NOT_PERSIST = 0x20000000;
|
||||
}
|
||||
|
||||
class SSFLAGS
|
||||
{
|
||||
// used internally by WriteBinaryKey
|
||||
// these are not published in the NDK
|
||||
internal static int FLAG_PERSIST = 0x10000000;
|
||||
internal static int FLAG_DO_NOT_PERSIST = 0x20000000;
|
||||
}
|
||||
|
||||
internal class ReqMsgId
|
||||
@ -91,8 +91,8 @@ namespace sscs.constants
|
||||
internal static string SSCS_LOCAL_KEY_CHAIN_ID = "SSCS_LOCAL_KEY_CHAIN_ID";
|
||||
internal static string SSCS_HIDDEN_LOCAL_KEYCHAIN_ID = "SSCS_HIDDEN_LOCAL_KEYCHAIN_ID";
|
||||
internal static string SSCS_REMOTE_KEYCHAIN_ID = "SSCS_REMOTE_KEYCHAIN_ID";
|
||||
internal static string SSCS_LOCAL_REMOTE_KEYCHAIN_ID = "SSCS_LOCAL_REMOTE_KEYCHAIN_ID";
|
||||
|
||||
internal static string SSCS_LOCAL_REMOTE_KEYCHAIN_ID = "SSCS_LOCAL_REMOTE_KEYCHAIN_ID";
|
||||
|
||||
internal static string SSCS_CONFLICT_KEYCHAIN = "SSCS_CONFLICT_KEYCHAIN_ID";
|
||||
|
||||
//TBD , Need to look at Novell standard for the desktop
|
||||
@ -163,7 +163,7 @@ namespace sscs.constants
|
||||
internal static string miCASANode = "miCASA";
|
||||
internal static string versionAttr = "version";
|
||||
internal static string keyChainNode = "KeyChain";
|
||||
internal static string idAttr = "id";
|
||||
internal static string idAttr = "id";
|
||||
internal static string binaryAttr = "binary";
|
||||
internal static string secretNode = "Secret";
|
||||
internal static string valueNode = "Value";
|
||||
|
@ -82,7 +82,7 @@ namespace sscs.common
|
||||
msgIdMap.Add(19,"sscs.verbs.IsSecretPersistent");
|
||||
msgIdMap.Add(20,"sscs.verbs.ObjectSerialization");
|
||||
msgIdMap.Add(21,"sscs.verbs.WriteBinaryKey");
|
||||
msgIdMap.Add(22,"sscs.verbs.ReadBinaryKey");
|
||||
msgIdMap.Add(22,"sscs.verbs.ReadBinaryKey");
|
||||
msgIdMap.Add(23,"sscs.verbs.RemoveKey");
|
||||
msgIdMap.Add(24,"sscs.verbs.MergeCache");
|
||||
}
|
||||
|
@ -66,12 +66,12 @@ namespace sscs.common
|
||||
{
|
||||
return sessionManager;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
internal static SecretStore CreateUserSession(UserIdentifier userId)
|
||||
{
|
||||
return CreateUserSession(userId, null);
|
||||
}
|
||||
|
||||
|
||||
internal static SecretStore CreateUserSession(UserIdentifier userId)
|
||||
{
|
||||
return CreateUserSession(userId, null);
|
||||
}
|
||||
|
||||
internal static SecretStore CreateUserSession(UserIdentifier userId, string userHome)
|
||||
@ -87,137 +87,137 @@ namespace sscs.common
|
||||
return ss;
|
||||
}
|
||||
catch(UserNotInSessionException)
|
||||
{
|
||||
#if W32
|
||||
// if running on vista, let's make additional checks for users with elevation privileges
|
||||
// on Vista use the elevated token if there is one.
|
||||
System.OperatingSystem os = System.Environment.OSVersion;
|
||||
if (os.Version.Major > 5)
|
||||
{
|
||||
WinUserIdentifier vistaAdminUser = (WinUserIdentifier)userId;
|
||||
|
||||
// if this user an admin eqivalent, it has an elevated token
|
||||
if (vistaAdminUser.HasElevatedToken())
|
||||
{
|
||||
CSSSLogger.DbgLog("VISTA: Request received from user with Elevated Token");
|
||||
|
||||
// CASA's Credential Manager creates a WinUser with just the normal token id
|
||||
// ZEN creates a WinUser with the elevated token id
|
||||
// Here we determine if we can merge any of these.
|
||||
WinUserIdentifier credUser = null;
|
||||
WinUserIdentifier zenUser = null;
|
||||
SecretStore credUserSS = null;
|
||||
SecretStore zenUserSS = null;
|
||||
|
||||
// look for match UserIdentifier with just the normal id
|
||||
try
|
||||
{
|
||||
credUser = new WinUserIdentifier(vistaAdminUser.GetUIDLow(), vistaAdminUser.GetUIDHigh(), vistaAdminUser.GetSID());
|
||||
credUserSS = GetUserSecretStore(credUser);
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
// ZEN creates a winUser with just the elevated ID
|
||||
try
|
||||
{
|
||||
zenUser = new WinUserIdentifier(vistaAdminUser.GetElevatedUIDLow(), vistaAdminUser.GetElevatedUIDHigh(), vistaAdminUser.GetSID());
|
||||
zenUserSS = GetUserSecretStore(zenUser);
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
// if both exist merge them into the credUser, fix up userIdentify and return resulting store
|
||||
if ((credUserSS != null) && (zenUserSS != null))
|
||||
{
|
||||
CSSSLogger.DbgLog("VISTA: Merging zenUser store with credUser store");
|
||||
byte[] baSecrets = sscs.lss.LocalStorage.GetSecretsAsXMLStream(zenUserSS, ConstStrings.SSCS_SESSION_KEY_CHAIN_ID).ToArray();
|
||||
|
||||
if (baSecrets != null)
|
||||
{
|
||||
credUserSS.MergeXMLSecrets(baSecrets);
|
||||
}
|
||||
|
||||
// add elevated ids to cred user object
|
||||
WinUserIdentifier temp = (WinUserIdentifier)credUserSS.GetUserIdentifier();
|
||||
temp.SetElevatedUIDLow(vistaAdminUser.GetElevatedUIDLow());
|
||||
temp.SetElevatedUIDHigh(vistaAdminUser.GetElevatedUIDHigh());
|
||||
|
||||
// nuke the zen user session
|
||||
SessionManager.RemoveUserSession(zenUser, true);
|
||||
|
||||
return credUserSS;
|
||||
}
|
||||
// only the credUser exists, add the elevated UIDs, return creduser store
|
||||
else if (credUserSS != null)
|
||||
{
|
||||
// fix up credUser with elevated IDs
|
||||
CSSSLogger.DbgLog("VISTA: Fixing credUser up with elevated IDs");
|
||||
WinUserIdentifier temp = (WinUserIdentifier)credUserSS.GetUserIdentifier();
|
||||
temp.SetElevatedUIDLow(vistaAdminUser.GetElevatedUIDLow());
|
||||
temp.SetElevatedUIDHigh(vistaAdminUser.GetElevatedUIDHigh());
|
||||
return credUserSS;
|
||||
|
||||
}
|
||||
// only the zenUser exists, fix the UIDs, return zenuser store
|
||||
else if (zenUserSS != null)
|
||||
{
|
||||
// fix up zenUser with correct IDs
|
||||
// NOTE:we might need to remove old UserID from session table, and add this one
|
||||
CSSSLogger.DbgLog("VISTA: Fixing zenUser up with correct IDs");
|
||||
WinUserIdentifier temp = (WinUserIdentifier)zenUserSS.GetUserIdentifier();
|
||||
|
||||
// move uids
|
||||
temp.SetUIDLow(vistaAdminUser.GetUIDLow());
|
||||
temp.SetUIDHigh(vistaAdminUser.GetUIDHigh());
|
||||
|
||||
// set non elevated
|
||||
temp.SetElevatedUIDLow(vistaAdminUser.GetElevatedUIDLow());
|
||||
temp.SetElevatedUIDHigh(vistaAdminUser.GetElevatedUIDHigh());
|
||||
|
||||
return zenUserSS;
|
||||
}
|
||||
}
|
||||
{
|
||||
#if W32
|
||||
// if running on vista, let's make additional checks for users with elevation privileges
|
||||
// on Vista use the elevated token if there is one.
|
||||
System.OperatingSystem os = System.Environment.OSVersion;
|
||||
if (os.Version.Major > 5)
|
||||
{
|
||||
WinUserIdentifier vistaAdminUser = (WinUserIdentifier)userId;
|
||||
|
||||
// if this user an admin eqivalent, it has an elevated token
|
||||
if (vistaAdminUser.HasElevatedToken())
|
||||
{
|
||||
CSSSLogger.DbgLog("VISTA: Request received from user with Elevated Token");
|
||||
|
||||
// CASA's Credential Manager creates a WinUser with just the normal token id
|
||||
// ZEN creates a WinUser with the elevated token id
|
||||
// Here we determine if we can merge any of these.
|
||||
WinUserIdentifier credUser = null;
|
||||
WinUserIdentifier zenUser = null;
|
||||
SecretStore credUserSS = null;
|
||||
SecretStore zenUserSS = null;
|
||||
|
||||
// look for match UserIdentifier with just the normal id
|
||||
try
|
||||
{
|
||||
credUser = new WinUserIdentifier(vistaAdminUser.GetUIDLow(), vistaAdminUser.GetUIDHigh(), vistaAdminUser.GetSID());
|
||||
credUserSS = GetUserSecretStore(credUser);
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
// ZEN creates a winUser with just the elevated ID
|
||||
try
|
||||
{
|
||||
zenUser = new WinUserIdentifier(vistaAdminUser.GetElevatedUIDLow(), vistaAdminUser.GetElevatedUIDHigh(), vistaAdminUser.GetSID());
|
||||
zenUserSS = GetUserSecretStore(zenUser);
|
||||
}
|
||||
catch (Exception) { }
|
||||
|
||||
// if both exist merge them into the credUser, fix up userIdentify and return resulting store
|
||||
if ((credUserSS != null) && (zenUserSS != null))
|
||||
{
|
||||
CSSSLogger.DbgLog("VISTA: Merging zenUser store with credUser store");
|
||||
byte[] baSecrets = sscs.lss.LocalStorage.GetSecretsAsXMLStream(zenUserSS, ConstStrings.SSCS_SESSION_KEY_CHAIN_ID).ToArray();
|
||||
|
||||
if (baSecrets != null)
|
||||
{
|
||||
credUserSS.MergeXMLSecrets(baSecrets);
|
||||
}
|
||||
|
||||
// add elevated ids to cred user object
|
||||
WinUserIdentifier temp = (WinUserIdentifier)credUserSS.GetUserIdentifier();
|
||||
temp.SetElevatedUIDLow(vistaAdminUser.GetElevatedUIDLow());
|
||||
temp.SetElevatedUIDHigh(vistaAdminUser.GetElevatedUIDHigh());
|
||||
|
||||
// nuke the zen user session
|
||||
SessionManager.RemoveUserSession(zenUser, true);
|
||||
|
||||
return credUserSS;
|
||||
}
|
||||
// only the credUser exists, add the elevated UIDs, return creduser store
|
||||
else if (credUserSS != null)
|
||||
{
|
||||
// fix up credUser with elevated IDs
|
||||
CSSSLogger.DbgLog("VISTA: Fixing credUser up with elevated IDs");
|
||||
WinUserIdentifier temp = (WinUserIdentifier)credUserSS.GetUserIdentifier();
|
||||
temp.SetElevatedUIDLow(vistaAdminUser.GetElevatedUIDLow());
|
||||
temp.SetElevatedUIDHigh(vistaAdminUser.GetElevatedUIDHigh());
|
||||
return credUserSS;
|
||||
|
||||
}
|
||||
// only the zenUser exists, fix the UIDs, return zenuser store
|
||||
else if (zenUserSS != null)
|
||||
{
|
||||
// fix up zenUser with correct IDs
|
||||
// NOTE:we might need to remove old UserID from session table, and add this one
|
||||
CSSSLogger.DbgLog("VISTA: Fixing zenUser up with correct IDs");
|
||||
WinUserIdentifier temp = (WinUserIdentifier)zenUserSS.GetUserIdentifier();
|
||||
|
||||
// move uids
|
||||
temp.SetUIDLow(vistaAdminUser.GetUIDLow());
|
||||
temp.SetUIDHigh(vistaAdminUser.GetUIDHigh());
|
||||
|
||||
// set non elevated
|
||||
temp.SetElevatedUIDLow(vistaAdminUser.GetElevatedUIDLow());
|
||||
temp.SetElevatedUIDHigh(vistaAdminUser.GetElevatedUIDHigh());
|
||||
|
||||
return zenUserSS;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
// Would create either windows/unix user
|
||||
// depending on the platform.
|
||||
User user;
|
||||
if (userHome != null)
|
||||
{
|
||||
user = User.CreateUser(userId, userHome);
|
||||
}
|
||||
else
|
||||
{
|
||||
user = User.CreateUser(userId);
|
||||
User user;
|
||||
if (userHome != null)
|
||||
{
|
||||
user = User.CreateUser(userId, userHome);
|
||||
}
|
||||
else
|
||||
{
|
||||
user = User.CreateUser(userId);
|
||||
}
|
||||
|
||||
mutex.WaitOne();
|
||||
|
||||
try
|
||||
{
|
||||
sessionTable.Add(userId, user);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CSSSLogger.DbgLog(e.ToString());
|
||||
mutex.WaitOne();
|
||||
|
||||
try
|
||||
{
|
||||
sessionTable.Add(userId, user);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
CSSSLogger.DbgLog(e.ToString());
|
||||
}
|
||||
|
||||
mutex.ReleaseMutex();
|
||||
ss = user.GetSecretStore();
|
||||
ss.IncrRefCount();
|
||||
ss.CreateTime = DateTime.Now;
|
||||
|
||||
// add session keychain if it does not exist.
|
||||
if (!ss.CheckIfKeyChainExists(constants.ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + '\0'))
|
||||
{
|
||||
ss.AddKeyChain(new KeyChain(constants.ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + '\0'));
|
||||
}
|
||||
ss.CreateTime = DateTime.Now;
|
||||
|
||||
// add server keychain if it does not exist.
|
||||
if (!ss.CheckIfKeyChainExists(constants.ConstStrings.SSCS_SERVER_KEY_CHAIN_ID + '\0'))
|
||||
{
|
||||
ss.AddKeyChain(new KeyChain(constants.ConstStrings.SSCS_SERVER_KEY_CHAIN_ID + '\0'));
|
||||
// add session keychain if it does not exist.
|
||||
if (!ss.CheckIfKeyChainExists(constants.ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + '\0'))
|
||||
{
|
||||
ss.AddKeyChain(new KeyChain(constants.ConstStrings.SSCS_SESSION_KEY_CHAIN_ID + '\0'));
|
||||
}
|
||||
|
||||
// add server keychain if it does not exist.
|
||||
if (!ss.CheckIfKeyChainExists(constants.ConstStrings.SSCS_SERVER_KEY_CHAIN_ID + '\0'))
|
||||
{
|
||||
ss.AddKeyChain(new KeyChain(constants.ConstStrings.SSCS_SERVER_KEY_CHAIN_ID + '\0'));
|
||||
}
|
||||
|
||||
ss.StartPersistenceOfServerSecretsBySystemKey();
|
||||
@ -342,7 +342,7 @@ namespace sscs.common
|
||||
//Console.WriteLine((((SecretStore)(etor.Value)).secretStoreName + ":" + ((SecretStore)(etor.Value)).refCount);
|
||||
|
||||
}
|
||||
CSSSLogger.DbgLog("List Active Sessions3");
|
||||
CSSSLogger.DbgLog("List Active Sessions3");
|
||||
CSSSLogger.DbgLog("Current Session Count: " + sessionTable.Count);
|
||||
mutex.ReleaseMutex();
|
||||
CSSSLogger.DbgLog("List Active Sessions4");
|
||||
|
@ -20,39 +20,39 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
internal class UnixUserIdentifier : UserIdentifier
|
||||
{
|
||||
private int uid;
|
||||
|
||||
internal UnixUserIdentifier(int uid)
|
||||
{
|
||||
this.uid = uid;
|
||||
}
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
UnixUserIdentifier u = (UnixUserIdentifier)obj;
|
||||
if (u.uid == uid)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return uid.GetHashCode();
|
||||
}
|
||||
public void PrintIdentifier()
|
||||
{
|
||||
// Console.WriteLine("UnixUserIdentifier : uid is {0}",uid);
|
||||
}
|
||||
|
||||
public int GetUID()
|
||||
{
|
||||
return uid;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
internal class UnixUserIdentifier : UserIdentifier
|
||||
{
|
||||
private int uid;
|
||||
|
||||
internal UnixUserIdentifier(int uid)
|
||||
{
|
||||
this.uid = uid;
|
||||
}
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
UnixUserIdentifier u = (UnixUserIdentifier)obj;
|
||||
if (u.uid == uid)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return uid.GetHashCode();
|
||||
}
|
||||
public void PrintIdentifier()
|
||||
{
|
||||
// Console.WriteLine("UnixUserIdentifier : uid is {0}",uid);
|
||||
}
|
||||
|
||||
public int GetUID()
|
||||
{
|
||||
return uid;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -20,66 +20,66 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using sscs.cache;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
abstract class User
|
||||
{
|
||||
protected UserIdentifier userId;
|
||||
public UserIdentifier UserIdentifier
|
||||
{
|
||||
get
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected SecretStore secretStore;
|
||||
|
||||
//protected string home;
|
||||
|
||||
/* Change the protection level after getting the latest requirements */
|
||||
|
||||
protected string userName = null;
|
||||
|
||||
abstract internal void SetUserName(string userName);
|
||||
abstract internal string GetUserName();
|
||||
abstract internal string GetUserHomeDir();
|
||||
|
||||
internal SecretStore GetSecretStore()
|
||||
{
|
||||
return secretStore;
|
||||
}
|
||||
|
||||
internal static User CreateUser(UserIdentifier userId, string userHome)
|
||||
{
|
||||
User user = null;
|
||||
#if LINUX
|
||||
user = new UnixUser(userId);
|
||||
#endif
|
||||
#if W32
|
||||
user = new WinUser(userId, userHome);
|
||||
#endif
|
||||
return user;
|
||||
|
||||
}
|
||||
|
||||
|
||||
internal static User CreateUser(UserIdentifier userId)
|
||||
{
|
||||
User user = null;
|
||||
#if LINUX
|
||||
user = new UnixUser(userId);
|
||||
#endif
|
||||
#if W32
|
||||
user = new WinUser(userId);
|
||||
#endif
|
||||
return user;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.IO;
|
||||
using sscs.cache;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
abstract class User
|
||||
{
|
||||
protected UserIdentifier userId;
|
||||
public UserIdentifier UserIdentifier
|
||||
{
|
||||
get
|
||||
{
|
||||
return userId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected SecretStore secretStore;
|
||||
|
||||
//protected string home;
|
||||
|
||||
/* Change the protection level after getting the latest requirements */
|
||||
|
||||
protected string userName = null;
|
||||
|
||||
abstract internal void SetUserName(string userName);
|
||||
abstract internal string GetUserName();
|
||||
abstract internal string GetUserHomeDir();
|
||||
|
||||
internal SecretStore GetSecretStore()
|
||||
{
|
||||
return secretStore;
|
||||
}
|
||||
|
||||
internal static User CreateUser(UserIdentifier userId, string userHome)
|
||||
{
|
||||
User user = null;
|
||||
#if LINUX
|
||||
user = new UnixUser(userId);
|
||||
#endif
|
||||
#if W32
|
||||
user = new WinUser(userId, userHome);
|
||||
#endif
|
||||
return user;
|
||||
|
||||
}
|
||||
|
||||
|
||||
internal static User CreateUser(UserIdentifier userId)
|
||||
{
|
||||
User user = null;
|
||||
#if LINUX
|
||||
user = new UnixUser(userId);
|
||||
#endif
|
||||
#if W32
|
||||
user = new WinUser(userId);
|
||||
#endif
|
||||
return user;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,15 +21,15 @@
|
||||
***********************************************************************/
|
||||
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
public interface UserIdentifier
|
||||
{
|
||||
void PrintIdentifier();
|
||||
int GetUID();
|
||||
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
public interface UserIdentifier
|
||||
{
|
||||
void PrintIdentifier();
|
||||
int GetUID();
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -20,108 +20,108 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Microsoft.Win32;
|
||||
|
||||
using sscs.cache;
|
||||
using sscs.common;
|
||||
using sscs.constants;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
internal class WinUser : User
|
||||
{
|
||||
private string m_sUserHome = null;
|
||||
|
||||
internal WinUser()
|
||||
{
|
||||
}
|
||||
|
||||
internal WinUser(UserIdentifier winUserId, string userHome)
|
||||
{
|
||||
userId = winUserId;
|
||||
secretStore = new SecretStore(this);
|
||||
m_sUserHome = userHome;
|
||||
}
|
||||
|
||||
|
||||
internal WinUser(UserIdentifier winUserId)
|
||||
{
|
||||
userId = winUserId;
|
||||
secretStore = new SecretStore(this);
|
||||
}
|
||||
|
||||
override internal void SetUserName(string username)
|
||||
{
|
||||
userName = username;
|
||||
}
|
||||
|
||||
override internal string GetUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
/* A method to find the user's home dir on windows needs to be added.
|
||||
*/
|
||||
override internal string GetUserHomeDir()
|
||||
{
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir - Entered");
|
||||
if (m_sUserHome == null || m_sUserHome.Length < 1)
|
||||
{
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir is empty");
|
||||
//Console.WriteLine("read registry");
|
||||
// get the users home drive and homepath from the registry
|
||||
//
|
||||
string sSIDString = ((WinUserIdentifier)userId).GetSID();
|
||||
|
||||
// look up Profile path
|
||||
// [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1757981266-436374069-725345543-1006]
|
||||
CSSSLogger.DbgLog("Reading Reg: SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString);
|
||||
string sProfile = ReadRegKey(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString, "ProfileImagePath");
|
||||
|
||||
if (sProfile == null)
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir get Profile return null");
|
||||
else
|
||||
m_sUserHome = sProfile;
|
||||
|
||||
//string sHomeDrive = ReadRegKey(Registry.Users, sSIDString+"\\Volatile Environment", "HOMEDRIVE");
|
||||
//string sHomeDir = ReadRegKey(Registry.Users, sSIDString+"\\Volatile Environment", "HOMEPATH");
|
||||
//m_sUserHome = sHomeDrive+sHomeDir;
|
||||
//Console.WriteLine("Homedir: "+ m_sUserHome);
|
||||
}
|
||||
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir - Exited: "+m_sUserHome);
|
||||
|
||||
return m_sUserHome;
|
||||
}
|
||||
|
||||
private string ReadRegKey(RegistryKey rk, string sSubKey, string KeyName)
|
||||
{
|
||||
// Opening the registry key
|
||||
// RegistryKey rk = Registry.Users;
|
||||
// Open a subKey as read-only
|
||||
RegistryKey sk1 = rk.OpenSubKey(sSubKey);
|
||||
// If the RegistrySubKey doesn't exist -> (null)
|
||||
if ( sk1 == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
// If the RegistryKey exists I get its value
|
||||
// or null is returned.
|
||||
return (string)sk1.GetValue(KeyName.ToUpper());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using Microsoft.Win32;
|
||||
|
||||
using sscs.cache;
|
||||
using sscs.common;
|
||||
using sscs.constants;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
internal class WinUser : User
|
||||
{
|
||||
private string m_sUserHome = null;
|
||||
|
||||
internal WinUser()
|
||||
{
|
||||
}
|
||||
|
||||
internal WinUser(UserIdentifier winUserId, string userHome)
|
||||
{
|
||||
userId = winUserId;
|
||||
secretStore = new SecretStore(this);
|
||||
m_sUserHome = userHome;
|
||||
}
|
||||
|
||||
|
||||
internal WinUser(UserIdentifier winUserId)
|
||||
{
|
||||
userId = winUserId;
|
||||
secretStore = new SecretStore(this);
|
||||
}
|
||||
|
||||
override internal void SetUserName(string username)
|
||||
{
|
||||
userName = username;
|
||||
}
|
||||
|
||||
override internal string GetUserName()
|
||||
{
|
||||
return userName;
|
||||
}
|
||||
|
||||
/* A method to find the user's home dir on windows needs to be added.
|
||||
*/
|
||||
override internal string GetUserHomeDir()
|
||||
{
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir - Entered");
|
||||
if (m_sUserHome == null || m_sUserHome.Length < 1)
|
||||
{
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir is empty");
|
||||
//Console.WriteLine("read registry");
|
||||
// get the users home drive and homepath from the registry
|
||||
//
|
||||
string sSIDString = ((WinUserIdentifier)userId).GetSID();
|
||||
|
||||
// look up Profile path
|
||||
// [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList\S-1-5-21-1757981266-436374069-725345543-1006]
|
||||
CSSSLogger.DbgLog("Reading Reg: SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString);
|
||||
string sProfile = ReadRegKey(Registry.LocalMachine, "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\ProfileList\\" + sSIDString, "ProfileImagePath");
|
||||
|
||||
if (sProfile == null)
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir get Profile return null");
|
||||
else
|
||||
m_sUserHome = sProfile;
|
||||
|
||||
//string sHomeDrive = ReadRegKey(Registry.Users, sSIDString+"\\Volatile Environment", "HOMEDRIVE");
|
||||
//string sHomeDir = ReadRegKey(Registry.Users, sSIDString+"\\Volatile Environment", "HOMEPATH");
|
||||
//m_sUserHome = sHomeDrive+sHomeDir;
|
||||
//Console.WriteLine("Homedir: "+ m_sUserHome);
|
||||
}
|
||||
|
||||
CSSSLogger.DbgLog("WinUser:GetUserHomeDir - Exited: "+m_sUserHome);
|
||||
|
||||
return m_sUserHome;
|
||||
}
|
||||
|
||||
private string ReadRegKey(RegistryKey rk, string sSubKey, string KeyName)
|
||||
{
|
||||
// Opening the registry key
|
||||
// RegistryKey rk = Registry.Users;
|
||||
// Open a subKey as read-only
|
||||
RegistryKey sk1 = rk.OpenSubKey(sSubKey);
|
||||
// If the RegistrySubKey doesn't exist -> (null)
|
||||
if ( sk1 == null )
|
||||
{
|
||||
return null;
|
||||
}
|
||||
else
|
||||
{
|
||||
try
|
||||
{
|
||||
// If the RegistryKey exists I get its value
|
||||
// or null is returned.
|
||||
return (string)sk1.GetValue(KeyName.ToUpper());
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
//ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -20,141 +20,141 @@
|
||||
*
|
||||
***********************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
internal class WinUserIdentifier : UserIdentifier
|
||||
{
|
||||
private int m_uidLow;
|
||||
private int m_uidHigh;
|
||||
private int m_elevatedUidLow = 0;
|
||||
private int m_elevatedUidHigh = 0;
|
||||
private string m_sSID = "";
|
||||
|
||||
internal WinUserIdentifier(int uidLowPart, int uidHighPart, string sSID, int elevatedUidLow, int elevatedUidHigh)
|
||||
{
|
||||
this.m_uidLow = uidLowPart;
|
||||
this.m_uidHigh = uidHighPart;
|
||||
this.m_sSID = sSID;
|
||||
|
||||
if (elevatedUidLow != 0)
|
||||
this.m_elevatedUidLow = elevatedUidLow;
|
||||
|
||||
if (elevatedUidHigh != 0)
|
||||
this.m_elevatedUidHigh = elevatedUidHigh;
|
||||
|
||||
}
|
||||
|
||||
internal WinUserIdentifier(int uidLowPart, int uidHighPart, string sSID)
|
||||
{
|
||||
this.m_uidLow = uidLowPart;
|
||||
this.m_uidHigh = uidHighPart;
|
||||
this.m_sSID = sSID;
|
||||
}
|
||||
|
||||
internal WinUserIdentifier(int uidLowPart, int uidHighPart)
|
||||
{
|
||||
this.m_uidLow = uidLowPart;
|
||||
this.m_uidHigh = uidHighPart;
|
||||
}
|
||||
|
||||
|
||||
internal string GetSID()
|
||||
{
|
||||
return m_sSID;
|
||||
}
|
||||
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
WinUserIdentifier temp = (WinUserIdentifier)obj;
|
||||
|
||||
if ((temp.m_uidLow == m_uidLow) &&
|
||||
(temp.m_uidHigh == m_uidHigh) &&
|
||||
(temp.m_elevatedUidLow == m_elevatedUidLow) &&
|
||||
(temp.m_elevatedUidHigh == m_elevatedUidHigh))
|
||||
{
|
||||
// we have a match, set the SID if we can
|
||||
if ((this.m_sSID.Length < 1) && (temp.GetSID().Length > 0))
|
||||
{
|
||||
CSSSLogger.DbgLog("******** WinUserIdentifier: Updating the SID *********");
|
||||
this.m_sSID = temp.GetSID();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return m_uidLow.GetHashCode();
|
||||
}
|
||||
public void PrintIdentifier()
|
||||
{
|
||||
CSSSLogger.DbgLog(" High: " + this.m_uidHigh);
|
||||
CSSSLogger.DbgLog(" LOW: " + this.m_uidLow);
|
||||
|
||||
CSSSLogger.DbgLog(" eHigh: " + this.m_elevatedUidHigh);
|
||||
CSSSLogger.DbgLog(" eLOW: " + this.m_elevatedUidLow);
|
||||
|
||||
CSSSLogger.DbgLog(" SID: " + this.m_sSID);
|
||||
}
|
||||
|
||||
public int GetUID()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
internal int GetUIDLow()
|
||||
{
|
||||
return this.m_uidLow;
|
||||
}
|
||||
|
||||
internal int GetUIDHigh()
|
||||
{
|
||||
return this.m_uidHigh;
|
||||
}
|
||||
|
||||
internal int GetElevatedUIDLow()
|
||||
{
|
||||
return this.m_elevatedUidLow;
|
||||
}
|
||||
|
||||
internal int GetElevatedUIDHigh()
|
||||
{
|
||||
return this.m_elevatedUidHigh;
|
||||
}
|
||||
|
||||
// setters
|
||||
internal void SetUIDLow(int uidLow)
|
||||
{
|
||||
this.m_uidLow = uidLow;
|
||||
}
|
||||
|
||||
internal void SetUIDHigh(int uidHigh)
|
||||
{
|
||||
this.m_uidHigh = uidHigh;
|
||||
}
|
||||
|
||||
internal void SetElevatedUIDLow(int elevatedUidLow)
|
||||
{
|
||||
this.m_elevatedUidLow = elevatedUidLow;
|
||||
}
|
||||
|
||||
internal void SetElevatedUIDHigh(int elevatedUidHigh)
|
||||
{
|
||||
this.m_elevatedUidHigh = elevatedUidHigh;
|
||||
}
|
||||
|
||||
internal bool HasElevatedToken()
|
||||
{
|
||||
if (m_elevatedUidHigh + m_elevatedUidLow > 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
using System;
|
||||
|
||||
namespace sscs.common
|
||||
{
|
||||
internal class WinUserIdentifier : UserIdentifier
|
||||
{
|
||||
private int m_uidLow;
|
||||
private int m_uidHigh;
|
||||
private int m_elevatedUidLow = 0;
|
||||
private int m_elevatedUidHigh = 0;
|
||||
private string m_sSID = "";
|
||||
|
||||
internal WinUserIdentifier(int uidLowPart, int uidHighPart, string sSID, int elevatedUidLow, int elevatedUidHigh)
|
||||
{
|
||||
this.m_uidLow = uidLowPart;
|
||||
this.m_uidHigh = uidHighPart;
|
||||
this.m_sSID = sSID;
|
||||
|
||||
if (elevatedUidLow != 0)
|
||||
this.m_elevatedUidLow = elevatedUidLow;
|
||||
|
||||
if (elevatedUidHigh != 0)
|
||||
this.m_elevatedUidHigh = elevatedUidHigh;
|
||||
|
||||
}
|
||||
|
||||
internal WinUserIdentifier(int uidLowPart, int uidHighPart, string sSID)
|
||||
{
|
||||
this.m_uidLow = uidLowPart;
|
||||
this.m_uidHigh = uidHighPart;
|
||||
this.m_sSID = sSID;
|
||||
}
|
||||
|
||||
internal WinUserIdentifier(int uidLowPart, int uidHighPart)
|
||||
{
|
||||
this.m_uidLow = uidLowPart;
|
||||
this.m_uidHigh = uidHighPart;
|
||||
}
|
||||
|
||||
|
||||
internal string GetSID()
|
||||
{
|
||||
return m_sSID;
|
||||
}
|
||||
|
||||
public override bool Equals(Object obj)
|
||||
{
|
||||
WinUserIdentifier temp = (WinUserIdentifier)obj;
|
||||
|
||||
if ((temp.m_uidLow == m_uidLow) &&
|
||||
(temp.m_uidHigh == m_uidHigh) &&
|
||||
(temp.m_elevatedUidLow == m_elevatedUidLow) &&
|
||||
(temp.m_elevatedUidHigh == m_elevatedUidHigh))
|
||||
{
|
||||
// we have a match, set the SID if we can
|
||||
if ((this.m_sSID.Length < 1) && (temp.GetSID().Length > 0))
|
||||
{
|
||||
CSSSLogger.DbgLog("******** WinUserIdentifier: Updating the SID *********");
|
||||
this.m_sSID = temp.GetSID();
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return m_uidLow.GetHashCode();
|
||||
}
|
||||
public void PrintIdentifier()
|
||||
{
|
||||
CSSSLogger.DbgLog(" High: " + this.m_uidHigh);
|
||||
CSSSLogger.DbgLog(" LOW: " + this.m_uidLow);
|
||||
|
||||
CSSSLogger.DbgLog(" eHigh: " + this.m_elevatedUidHigh);
|
||||
CSSSLogger.DbgLog(" eLOW: " + this.m_elevatedUidLow);
|
||||
|
||||
CSSSLogger.DbgLog(" SID: " + this.m_sSID);
|
||||
}
|
||||
|
||||
public int GetUID()
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
internal int GetUIDLow()
|
||||
{
|
||||
return this.m_uidLow;
|
||||
}
|
||||
|
||||
internal int GetUIDHigh()
|
||||
{
|
||||
return this.m_uidHigh;
|
||||
}
|
||||
|
||||
internal int GetElevatedUIDLow()
|
||||
{
|
||||
return this.m_elevatedUidLow;
|
||||
}
|
||||
|
||||
internal int GetElevatedUIDHigh()
|
||||
{
|
||||
return this.m_elevatedUidHigh;
|
||||
}
|
||||
|
||||
// setters
|
||||
internal void SetUIDLow(int uidLow)
|
||||
{
|
||||
this.m_uidLow = uidLow;
|
||||
}
|
||||
|
||||
internal void SetUIDHigh(int uidHigh)
|
||||
{
|
||||
this.m_uidHigh = uidHigh;
|
||||
}
|
||||
|
||||
internal void SetElevatedUIDLow(int elevatedUidLow)
|
||||
{
|
||||
this.m_elevatedUidLow = elevatedUidLow;
|
||||
}
|
||||
|
||||
internal void SetElevatedUIDHigh(int elevatedUidHigh)
|
||||
{
|
||||
this.m_elevatedUidHigh = elevatedUidHigh;
|
||||
}
|
||||
|
||||
internal bool HasElevatedToken()
|
||||
{
|
||||
if (m_elevatedUidHigh + m_elevatedUidLow > 0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user