Author: jdsn Date: Thu Apr 23 21:23:18 2009 New Revision: 56952 URL: http://svn.opensuse.org/viewcvs/yast?rev=56952&view=rev Log: check boolean values also for nil to prevent crashes (bnc#463800) Modified: branches/SuSE-Code-11-Branch/registration/package/yast2-registration.changes branches/SuSE-Code-11-Branch/registration/src/modules/Register.ycp Modified: branches/SuSE-Code-11-Branch/registration/package/yast2-registration.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/registration/package/yast2-registration.changes?rev=56952&r1=56951&r2=56952&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/registration/package/yast2-registration.changes (original) +++ branches/SuSE-Code-11-Branch/registration/package/yast2-registration.changes Thu Apr 23 21:23:18 2009 @@ -1,4 +1,9 @@ ------------------------------------------------------------------- +Thu Apr 23 21:14:23 CEST 2009 - jdsn@suse.de + +- check boolean values also for nil to prevent crashes (bnc#463800) + +------------------------------------------------------------------- Thu Apr 9 17:43:26 CEST 2009 - jdsn@suse.de - proper language setting for registration browser (bnc#490811) Modified: branches/SuSE-Code-11-Branch/registration/src/modules/Register.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/registration/src/modules/Register.ycp?rev=56952&r1=56951&r2=56952&view=diff ============================================================================== --- branches/SuSE-Code-11-Branch/registration/src/modules/Register.ycp (original) +++ branches/SuSE-Code-11-Branch/registration/src/modules/Register.ycp Thu Apr 23 21:23:18 2009 @@ -784,11 +784,11 @@ */ void write_config() { - SCR::Write(.sysconfig.suse_register.SUBMIT_OPTIONAL, sformat("%1", submit_optional ? true:false )); - SCR::Write(.sysconfig.suse_register.SUBMIT_HWDATA, sformat("%1", submit_hwdata ? true:false )); + SCR::Write(.sysconfig.suse_register.SUBMIT_OPTIONAL, sformat("%1", submit_optional == true ? true:false )); + SCR::Write(.sysconfig.suse_register.SUBMIT_HWDATA, sformat("%1", submit_hwdata == true ? true:false )); if ( register_regularly == nil ) register_regularly = false; - SCR::Execute(.target.bash, sformat("%1 /var/lib/suseRegister/neverRegisterOnBoot", register_regularly ? "rm -f ":"touch " )); + SCR::Execute(.target.bash, sformat("%1 /var/lib/suseRegister/neverRegisterOnBoot", register_regularly == true ? "rm -f ":"touch " )); // touch a flag file for opensuseupdater SCR::Execute(.target.bash, sformat("touch /var/lib/YaST2/registrationDidRun")); } @@ -1388,11 +1388,12 @@ map ui = UI::GetDisplayInfo(); boolean debugMode = (boolean) ui["y2debug"]:false; + // take care for nil booleans (bnc#463800) map<string, any> contextData = $[ - "debug" : (debugMode ? 2:0), - "nooptional" : (submit_optional ? 0:1), - "nohwdata" : (submit_hwdata ? 0:1), - "forcereg" : (force_registration ? 1:0), // (bnc#443704) + "debug" : (debugMode == true ? 2:0), + "nooptional" : (submit_optional == true ? 0:1), + "nohwdata" : (submit_hwdata == true ? 0:1), + "forcereg" : (force_registration == true ? 1:0), // (bnc#443704) "norefresh" : 1, "yastcall" : 1, "restoreRepos" : 1, // (#309231) @@ -1428,7 +1429,7 @@ // initialize target if ( ! isInitializedTarget ) { - string targetRootDir = Mode::normal() ? "/":Installation::destdir; + string targetRootDir = Mode::normal() == true ? "/":Installation::destdir; if ( ! Pkg::TargetInitialize(targetRootDir) ) { y2error("Initializing the target failed via Pkg::TargetInitialize. No interaction with the package system is possible."); -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org