From b8ccfe47f648ad92124fff8d0611ecdfd2dc4c08 Mon Sep 17 00:00:00 2001 From: Juan Carlos Luciani Date: Tue, 14 Aug 2007 21:55:34 +0000 Subject: [PATCH] Fixed problem that was causing us to clear Proxy User credentials from miCASA erroneously when modifying realm configuration. --- .../yast2-casa-ats/src/CasaAts.ycp | 31 ++++++++++++------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/CASA-auth-token/yast2-casa-ats/src/CasaAts.ycp b/CASA-auth-token/yast2-casa-ats/src/CasaAts.ycp index b02bf41f..b35ae42b 100644 --- a/CASA-auth-token/yast2-casa-ats/src/CasaAts.ycp +++ b/CASA-auth-token/yast2-casa-ats/src/CasaAts.ycp @@ -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 {