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()