Changed so that Proxy Credentials be deleted when the ATS is disabled.
This commit is contained in:
parent
d6b3aef35f
commit
c559cc0ee1
@ -481,15 +481,15 @@ global boolean Write() {
|
||||
SCR::Execute(.target.bash, "/bin/cp "+trustedServerConfigFile+" "+trustedServerConfigFile+".YaST2save");
|
||||
|
||||
// Update the trusted server config
|
||||
any ret = false;
|
||||
any anyRet = false;
|
||||
list<string> trustedServerList = Settings["CONFIG_CASAATS_TRUSTED"]:[];
|
||||
string trustedServerListString = "";
|
||||
if (trustedServerList != []) {
|
||||
// Merge all of the addresses onto the string
|
||||
trustedServerListString = mergestring(trustedServerList, "\n");
|
||||
}
|
||||
ret = SCR::Write(.target.string, trustedServerConfigFile, trustedServerListString);
|
||||
if (ret != true)
|
||||
anyRet = SCR::Write(.target.string, trustedServerConfigFile, trustedServerListString);
|
||||
if (anyRet != true)
|
||||
y2error("Failed to write to " + trustedServerConfigFile);
|
||||
|
||||
// Write the /etc/sysconfig/casa-ats settings
|
||||
@ -501,15 +501,35 @@ global boolean Write() {
|
||||
if (false) Report::Error (_("Cannot sysconfig settings."));
|
||||
sleep(sl);
|
||||
|
||||
// Try to obtain the uid of casaatsd
|
||||
string uid = "";
|
||||
map ret = (map) SCR::Execute(.target.bash_output, "id -u casaatsd");
|
||||
integer exit = ret["exit"]:-1;
|
||||
if (exit == 0)
|
||||
{
|
||||
string cmd_output = ret["stdout"]:"";
|
||||
list<string> uidComponents = splitstring(cmd_output, "\n");
|
||||
uid = uidComponents[0]:"";
|
||||
y2milestone("casaatsd uid = " + uid);
|
||||
|
||||
// Clear out the credentials that may have been saved in miCASA
|
||||
// for this user.
|
||||
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
|
||||
if ((Settings["CONFIG_CASAATS_ENABLE"]:false) == true) {
|
||||
|
||||
// Create svc.settings file
|
||||
string cmd = "rm -f " + svcSettingsFile;
|
||||
map ret = (map) SCR::Execute(.target.bash_output, cmd);
|
||||
ret = (map) SCR::Execute(.target.bash_output, cmd);
|
||||
cmd = svcSettingsEditor + " -create -file " + svcSettingsFile;
|
||||
ret = (map) SCR::Execute(.target.bash_output, cmd);
|
||||
integer exit = ret["exit"]:-1;
|
||||
exit = ret["exit"]:-1;
|
||||
if (exit != 0)
|
||||
y2error("Failed to create " + svcSettingsFile);
|
||||
|
||||
@ -541,30 +561,6 @@ global boolean Write() {
|
||||
if (exit != 0)
|
||||
y2error("Failed to create " + iaRealmsFile);
|
||||
|
||||
// Obtain the uid of casaatsd
|
||||
string uid = "";
|
||||
ret = (map) SCR::Execute(.target.bash_output, "id -u casaatsd");
|
||||
exit = ret["exit"]:-1;
|
||||
if (exit == 0)
|
||||
{
|
||||
string cmd_output = ret["stdout"]:"";
|
||||
list<string> uidComponents = splitstring(cmd_output, "\n");
|
||||
uid = uidComponents[0]:"";
|
||||
y2milestone("casaatsd uid = " + uid);
|
||||
|
||||
// Clear out the credentials that may have been saved in miCASA
|
||||
// for this user.
|
||||
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");
|
||||
}
|
||||
else
|
||||
{
|
||||
y2error("Failed to obtain casaatsd uid");
|
||||
}
|
||||
|
||||
// Add the real information to auth.policy and iaRealms.xml files
|
||||
map<string, map> realms = (map<string, map>) CasaAts::Settings["CONFIG_CASAATS_REALMS"]:$[];
|
||||
foreach (string key, map realm, realms, {
|
||||
|
Loading…
Reference in New Issue
Block a user