- Added support for ADD-KEY and DELETE-KEY for GnomeKeyring store.

- Bug 142183:Added code to prevent users from deleting "GKPassword"
  Key in Keyring store.
...................................................................
This commit is contained in:
smanojna
2006-01-10 07:39:48 +00:00
parent 7b685e2987
commit 8348ecdb4a
4 changed files with 26 additions and 15 deletions

View File

@@ -653,7 +653,8 @@ namespace Novell.CASA.GUI {
XmlNode keyParentNode = key.ParentNode;
key.ParentNode.RemoveChild(key);
//Console.WriteLine("EXECUTING OPERATION_DELETE_KEY:Deleting"+ccfSecretPath);//FIXME:Remove this line
ad.SetSecret(keyParentNode,storeIDentifier);
//ad.SetSecret(keyParentNode,storeIDentifier);
ad.SetSecret(keyParentNode,Common.OPERATION_MODIFY_KEY,storeIDentifier);
}
}
else if( Common.OPERATION_ADD_SECRET == operation )
@@ -729,7 +730,7 @@ namespace Novell.CASA.GUI {
}
else
{//Wallet:CASAwallet exists. Hence check for folder
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']"; //Password
ccfKeyChainPath = "//CCF/KWallet/Wallet[@ID='" + keyChainID + "']/Folder[@Name='" + folderName + "']"; //Passwords
XmlNodeList keychainFolderNodeList = root.SelectNodes(ccfKeyChainPath);
if( (null == keychainFolderNodeList) || (0 == keychainFolderNodeList.Count) )
{//folderName:Password does not exist. Hence create folder & type
@@ -777,11 +778,12 @@ namespace Novell.CASA.GUI {
//Console.WriteLine("ADD_SECRET:ccfKeyChainPath="+ccfKeyChainPath);//FIXME:Remove this line
XmlNodeList secretNodeList = root.SelectNodes(ccfKeyChainPath);
XmlNode SecretNode = secretNodeList.Item(0);
XmlNode lastChild = SecretNode.LastChild; //The newly added secret
SecretNode.AppendChild(newSecretElement); //Add the new Secret
XmlNode lastChild = SecretNode.LastChild; //Get The newly added secret
if(lastChild!=null)
{
//Console.WriteLine("EXECUTING OPERATION_ADD_SECRET:Adding"+ccfSecretPath);//FIXME:Remove this line
ad.SetSecret(lastChild,operation,storeIDentifier);
Console.WriteLine("EXECUTING OPERATION_ADD_SECRET:Adding"+ccfSecretPath);//FIXME:Remove this line
ad.SetSecret(lastChild,operation,storeIDentifier); //and set it
}
}//STORE_KDEWALLET
@@ -797,7 +799,8 @@ namespace Novell.CASA.GUI {
XmlNode lastChild = keyNode.LastChild;
keyNode.InsertBefore(newKeyElement,lastChild);
//ShowDocOnConsole("JUST BEFORE CALL TO SETSECRET-ADDKEY");//FIXME:Remove this
int errcode=ad.SetSecret(keyNode,Common.OPERATION_ADD_SECRET,storeIDentifier);
//int errcode=ad.SetSecret(keyNode,Common.OPERATION_ADD_SECRET,storeIDentifier);
int errcode=ad.SetSecret(keyNode,Common.OPERATION_MODIFY_KEY,storeIDentifier);
//ShowDocOnConsole("SetSecret returned errcode="+errcode);//FIXME:Remove this
}