Fixed problem that was causing us to clear Proxy User credentials from

miCASA erroneously when modifying realm configuration.
This commit is contained in:
Juan Carlos Luciani 2007-08-14 21:55:34 +00:00
parent 389d184ca7
commit b8ccfe47f6

View File

@ -589,11 +589,14 @@ global boolean Write() {
// Clear out the credentials that may have been saved in miCASA
// for this user.
/* Comment this out until we can read realm proxy credentials
using CASAcli.
string cmd = sformat("CASAcli -r -u %1", uid);
ret = (map) SCR::Execute(.target.bash_output, cmd);
exit = ret["exit"]:-1;
if (exit != 0)
y2error("Failed to remove casaatsd credentials");
*/
}
// Check if we need to save the server configuration
@ -684,21 +687,25 @@ global boolean Write() {
if (exit != 0)
y2error("Failed to set realm " + realmId);
// Save Proxy User Credentials in miCASA if we have the uid of casaatsd
// Try to save Proxy User Credentials in miCASA if we have the uid of casaatsd
if (uid != "")
{
// Set the Proxy User Credentials in miCASA
cmd = sformat("KEYVALUE=\"%1\" CASAcli -s -u %2 -n %3 -k CN", proxy_username, uid, realmId);
ret = (map) SCR::Execute(.target.bash_output, cmd);
exit = ret["exit"]:-1;
if (exit != 0)
y2error("Failed to set Proxy Username in miCASA for realm " + realmId);
// Save the credentials if we have access to them
if (proxy_username != "")
{
// Set the Proxy User Credentials in miCASA
cmd = sformat("KEYVALUE=\"%1\" CASAcli -s -u %2 -n %3 -k CN", proxy_username, uid, realmId);
ret = (map) SCR::Execute(.target.bash_output, cmd);
exit = ret["exit"]:-1;
if (exit != 0)
y2error("Failed to set Proxy Username in miCASA for realm " + realmId);
cmd = sformat("KEYVALUE=\"%1\" CASAcli -s -u %2 -n \"%3\" -k Password", proxy_password, uid, realmId);
ret = (map) SCR::Execute(.target.bash_output, cmd);
exit = ret["exit"]:-1;
if (exit != 0)
y2error("Failed to set Proxy Password in miCASA for realm " + realmId);
cmd = sformat("KEYVALUE=\"%1\" CASAcli -s -u %2 -n \"%3\" -k Password", proxy_password, uid, realmId);
ret = (map) SCR::Execute(.target.bash_output, cmd);
exit = ret["exit"]:-1;
if (exit != 0)
y2error("Failed to set Proxy Password in miCASA for realm " + realmId);
}
}
else
{