Bug 135386: Linking secrets with colon in the name - FIXED

This commit is contained in:
Jim Norman
2006-02-17 21:05:10 +00:00
parent 95e66ba8b8
commit d7bf9b40a5
7 changed files with 113 additions and 42 deletions

View File

@@ -61,13 +61,13 @@ namespace Novell.CASA.MiCasa.Common
if (sSecretID != null)
{
if (sSecretID.StartsWith("SS_CredSet"))
m_SecretID = "SS_CredSet:" + EscapeReservedChars(sSecretID.Substring(11)) + '\0';
m_SecretID = "SS_CredSet:" + Utils.EscapeReservedChars(sSecretID.Substring(11)) + '\0';
else
m_SecretID = "SS_CredSet:" + EscapeReservedChars(sSecretID) + '\0';
m_SecretID = "SS_CredSet:" + Utils.EscapeReservedChars(sSecretID) + '\0';
}
if (sKeyID != null)
m_KeyID = EscapeReservedChars(sKeyID); // + '\0';
m_KeyID = Utils.EscapeReservedChars(sKeyID); // + '\0';
// serialize the object
m_object = theObject;
@@ -118,34 +118,5 @@ namespace Novell.CASA.MiCasa.Common
{
return m_errorMsg;
}
private string EscapeReservedChars(string origString)
{
StringBuilder sb = new StringBuilder();
for (int i=0; i<origString.Length; i++)
{
switch (origString[i])
{
case ':' :
{
sb.Append("\\");
break;
}
case '\\' :
{
sb.Append("\\");
break;
}
case '=' :
{
sb.Append("\\");
break;
}
}
sb.Append(origString[i]);
}
return sb.ToString();
}
}
}