From 4bc1198b88238d03551d96f3a2e773507d408f5c Mon Sep 17 00:00:00 2001 From: Juan Carlos Luciani Date: Thu, 17 May 2007 15:42:32 +0000 Subject: [PATCH] Modified to work with the new CASAcli interface which eliminates the need to invoke CASAcli using sudo which creates its own set of problems. Fixed the issue of the password box too small when running Yast in text mode and changed the text on the "Re-enter password" box to "Confirm password". --- .../yast2-casa-ats/src/CasaAts.ycp | 35 +++++++++++++------ .../yast2-casa-ats/src/dialogs.ycp | 4 +-- 2 files changed, 27 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 0a23bf86..12eba7af 100644 --- a/CASA-auth-token/yast2-casa-ats/src/CasaAts.ycp +++ b/CASA-auth-token/yast2-casa-ats/src/CasaAts.ycp @@ -589,18 +589,33 @@ global boolean Write() { if (exit != 0) y2error("Failed to set realm " + realmId); - // Set the Proxy User Credentials in miCASA - cmd = sformat("KEYVALUE=\"%1\" sudo -u casaatsd CASAcli --set -n %2 -k CN", proxy_username, realmId); - ret = (map) SCR::Execute(.target.bash_output, cmd); + // Obtain the uid of casaatsd + ret = (map) SCR::Execute(.target.bash_output, "id -u casaatsd"); exit = ret["exit"]:-1; - if (exit != 0) - y2error("Failed to set Proxy Username in miCASA for realm " + realmId); + if (exit == 0) + { + string cmd_output = ret["stdout"]:""; + list uidComponents = splitstring(cmd_output, "\n"); + string uid = uidComponents[0]:""; + y2milestone("casaatsd uid = " + uid); - cmd = sformat("KEYVALUE=\"%1\" sudo -u casaatsd CASAcli --set -n %2 -k Password", proxy_password, 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); + // 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); + } + else + { + y2error("Failed to obtain casaatsd uid"); + } }); // Adjust firewall as needed diff --git a/CASA-auth-token/yast2-casa-ats/src/dialogs.ycp b/CASA-auth-token/yast2-casa-ats/src/dialogs.ycp index 0098bf40..9e836e06 100644 --- a/CASA-auth-token/yast2-casa-ats/src/dialogs.ycp +++ b/CASA-auth-token/yast2-casa-ats/src/dialogs.ycp @@ -555,8 +555,8 @@ LDAP contexts containing entities that can be authenticated.

`Frame(_("Proxy User Credentials"), `VBox( `Left(`TextEntry(`id(`username), _("&Username (i.e. cn=admin,o=novell)"))), - `Left(`Password(`id(`passwd), _("&Password"))), - `Left(`Password(`id(`repasswd), _("&Re-enter Password"))) + `Left(`Password(`id(`passwd), _("&Password "))), + `Left(`Password(`id(`repasswd), _("&Confirm Password "))) ) ), `VStretch()