Author: jsuchome Date: Fri Feb 4 15:19:57 2011 New Revision: 63351 URL: http://svn.opensuse.org/viewcvs/yast?rev=63351&view=rev Log: - reset connection when TLS status has been changed (bnc#662949) - 2.20.14 Modified: trunk/ldap-client/VERSION trunk/ldap-client/package/yast2-ldap-client.changes trunk/ldap-client/src/Ldap.ycp trunk/ldap-client/src/ui.ycp trunk/ldap-client/yast2-ldap-client.spec.in Modified: trunk/ldap-client/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-client/VERSION?rev=63351&r1=63350&r2=63351&view=diff ============================================================================== --- trunk/ldap-client/VERSION (original) +++ trunk/ldap-client/VERSION Fri Feb 4 15:19:57 2011 @@ -1 +1 @@ -2.20.13 +2.20.14 Modified: trunk/ldap-client/package/yast2-ldap-client.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-client/package/yast2-ldap-client.changes?rev=63351&r1=63350&r2=63351&view=diff ============================================================================== --- trunk/ldap-client/package/yast2-ldap-client.changes (original) +++ trunk/ldap-client/package/yast2-ldap-client.changes Fri Feb 4 15:19:57 2011 @@ -1,4 +1,10 @@ ------------------------------------------------------------------- +Fri Feb 4 08:57:50 CET 2011 - jsuchome@suse.cz + +- reset connection when TLS status has been changed (bnc#662949) +- 2.20.14 + +------------------------------------------------------------------- Tue Feb 1 11:32:25 CET 2011 - jsuchome@suse.cz - do not add +-lines when configuring sssd (bnc#668565) Modified: trunk/ldap-client/src/Ldap.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-client/src/Ldap.ycp?rev=63351&r1=63350&r2=63351&view=diff ============================================================================== --- trunk/ldap-client/src/Ldap.ycp (original) +++ trunk/ldap-client/src/Ldap.ycp Fri Feb 4 15:19:57 2011 @@ -272,6 +272,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 @@ -1097,6 +1100,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 () ``{ @@ -1120,6 +1131,7 @@ else { ldap_initialized = init; + tls_when_initialized= ldap_tls; if (!init) { ret = LDAPError(); @@ -1134,6 +1146,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), @@ -1168,8 +1184,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()); } @@ -1230,6 +1248,7 @@ } } ldap_initialized = init; + tls_when_initialized= args["use_tls"]:"no" == "yes"; } return ret; } Modified: trunk/ldap-client/src/ui.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-client/src/ui.ycp?rev=63351&r1=63350&r2=63351&view=diff ============================================================================== --- trunk/ldap-client/src/ui.ycp (original) +++ trunk/ldap-client/src/ui.ycp Fri Feb 4 15:19:57 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 ("", $[ @@ -764,15 +768,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), @@ -1092,6 +1093,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: trunk/ldap-client/yast2-ldap-client.spec.in URL: http://svn.opensuse.org/viewcvs/yast/trunk/ldap-client/yast2-ldap-client.spec.in?rev=63351&r1=63350&r2=63351&view=diff ============================================================================== --- trunk/ldap-client/yast2-ldap-client.spec.in (original) +++ trunk/ldap-client/yast2-ldap-client.spec.in Fri Feb 4 15:19:57 2011 @@ -13,8 +13,8 @@ Requires: yast2-network -# removed lowercasing of LDAP object names -Requires: yast2-ldap >= 2.17.1 +# .close +Requires: yast2-ldap >= 2.20.1 # etc_sssd_conf.scr Requires: yast2-pam >= 2.20.0 -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org