Mailinglist Archive: yast-commit (195 mails)

< Previous Next >
[yast-commit] r63616 - in /branches/SuSE-Code-11-SP2-Branch/ldap-client: src/Ldap.ycp src/ui.ycp yast2-ldap-client.spec.in
Author: jsuchome
Date: Fri Mar 18 17:23:19 2011
New Revision: 63616

URL: http://svn.opensuse.org/viewcvs/yast?rev=63616&view=rev
Log:
reset connection when TLS status has been changed (bnc#662949)


Modified:
branches/SuSE-Code-11-SP2-Branch/ldap-client/src/Ldap.ycp
branches/SuSE-Code-11-SP2-Branch/ldap-client/src/ui.ycp
branches/SuSE-Code-11-SP2-Branch/ldap-client/yast2-ldap-client.spec.in

Modified: branches/SuSE-Code-11-SP2-Branch/ldap-client/src/Ldap.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/ldap-client/src/Ldap.ycp?rev=63616&r1=63615&r2=63616&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/ldap-client/src/Ldap.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/ldap-client/src/Ldap.ycp Fri Mar 18
17:23:19 2011
@@ -273,6 +273,9 @@

global boolean ldap_initialized = false;

+ // was LDAP connection initialized with TLS?
+ global boolean tls_when_initialized = false;
+
/**
* If false, do not read settings already set from outside
* used e.g. for Users YaPI. see bug #60898
@@ -1125,6 +1128,14 @@
}

/**
+ * Shut down existing LDAP connection
+ */
+ global define boolean LDAPClose () {
+ ldap_initialized = false;
+ return (boolean) SCR::Execute (.ldap.close);
+ }
+
+ /**
* Initializes LDAP agent
*/
global define string LDAPInit () ``{
@@ -1148,6 +1159,7 @@
else
{
ldap_initialized = init;
+ tls_when_initialized= ldap_tls;
if (!init)
{
ret = LDAPError();
@@ -1162,6 +1174,10 @@
*/
global define boolean ConnectWithoutTLS (map errmap) {

+ string details = errmap["msg"]:"";
+ if (errmap["server_msg"]:"" != "")
+ details = sformat ("%1\n%2", details, errmap["server_msg"]:"");
+
UI::OpenDialog (`HBox(`HSpacing (0.5),
`VBox(
`VSpacing (0.5),
@@ -1196,8 +1212,10 @@
if (ret == `details)
{
if ((boolean)UI::QueryWidget (`id(`details), `Value))
- UI::ReplaceWidget (`id(`rp), `VBox (
- `Label (errmap["msg"]:"")));
+ {
+
+ UI::ReplaceWidget (`id(`rp), `VBox (`Label (details)));
+ }
else
UI::ReplaceWidget (`id(`rp), `Empty());
}
@@ -1258,6 +1276,7 @@
}
}
ldap_initialized = init;
+ tls_when_initialized= args["use_tls"]:"no" == "yes";
}
return ret;
}

Modified: branches/SuSE-Code-11-SP2-Branch/ldap-client/src/ui.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/ldap-client/src/ui.ycp?rev=63616&r1=63615&r2=63616&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/ldap-client/src/ui.ycp (original)
+++ branches/SuSE-Code-11-SP2-Branch/ldap-client/src/ui.ycp Fri Mar 18 17:23:19
2011
@@ -368,6 +368,10 @@
if (result == `fetch)
{
Ldap::tls_switched_off = false;
+ if (Ldap::ldap_initialized && Ldap::tls_when_initialized !=
ldap_tls)
+ {
+ Ldap::LDAPClose ();
+ }
string dn = Ldap::ldap_initialized ?
LdapPopup::BrowseTree ("") :
LdapPopup::InitAndBrowseTree ("", $[
@@ -763,15 +767,12 @@

if (base_dn == "") return;

- if (Ldap::ldap_initialized || true == SCR::Execute (.ldap, $[
- "hostname" : Ldap::GetFirstServer (Ldap::server),
- "port" : Ldap::GetFirstPort (Ldap::server),
- "version" : Ldap::ldap_v2 ? 2 : 3,
- "use_tls" : Ldap::ldap_tls ? "yes" : "no",
- "cacertdir" : Ldap::tls_cacertdir,
- "cacertfile": Ldap::tls_cacertfile
- ])
- )
+ if (Ldap::ldap_initialized && Ldap::tls_when_initialized !=
Ldap::ldap_tls)
+ {
+ Ldap::LDAPClose ();
+ }
+
+ if (Ldap::ldap_initialized || Ldap::LDAPInit () == "")
{
ppolicies_enabled = (boolean) SCR::Execute (.ldap.ppolicy, $[
"hostname" : Ldap::GetFirstServer (Ldap::server),
@@ -1091,6 +1092,10 @@
if (is (result, symbol) &&
contains ([`br, `br_passwd, `br_shadow, `br_group ],
(symbol)result))
{
+ if (Ldap::ldap_initialized && Ldap::tls_when_initialized !=
Ldap::ldap_tls)
+ {
+ Ldap::LDAPClose ();
+ }
string dn = Ldap::ldap_initialized ?
LdapPopup::BrowseTree (base_dn) :
LdapPopup::InitAndBrowseTree (base_dn, $[

Modified: branches/SuSE-Code-11-SP2-Branch/ldap-client/yast2-ldap-client.spec.in
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP2-Branch/ldap-client/yast2-ldap-client.spec.in?rev=63616&r1=63615&r2=63616&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP2-Branch/ldap-client/yast2-ldap-client.spec.in
(original)
+++ branches/SuSE-Code-11-SP2-Branch/ldap-client/yast2-ldap-client.spec.in Fri
Mar 18 17:23:19 2011
@@ -11,8 +11,8 @@

Requires: yast2-network

-# removed lowercasing of LDAP object names
-Requires: yast2-ldap >= 2.17.1
+# .close
+Requires: yast2-ldap >= 2.17.4

# new API of Pam.ycp
Requires: yast2-pam >= 2.14.0

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages