YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
December 2009
- 24 participants
- 488 discussions
[yast-commit] r60192 - in /trunk/scanner: VERSION package/yast2-scanner.changes src/Scanner.ycp src/dialogs.ycp src/helps.ycp
by jsmeix@svn.opensuse.org 23 Dec '09
by jsmeix@svn.opensuse.org 23 Dec '09
23 Dec '09
Author: jsmeix
Date: Wed Dec 23 15:36:04 2009
New Revision: 60192
URL: http://svn.opensuse.org/viewcvs/yast?rev=60192&view=rev
Log:
New version 2.19.0 with this RPM changelog entry:
- V 2.19.0
- Replaced overcomplicated but nevertheless mostly useless code
for using the YaST SuSEFirewall module by simple generic code
in a ShowFirewallPopup function in the same way as it works
for yast2-printer (compare Novell/Suse Bugzilla bnc#549065)
and enhanced the help text "Regarding Firewall",
(see Novell/Suse Bugzilla bnc#551282).
- Fixed duplicate button widget with ID `back by
calling Wizard::HideBackButton() before calling
Wizard::SetAbortButton(`back,Label::CancelButton()), see
http://lists.opensuse.org/opensuse-factory/2009-10/msg00528.html
- Added X-KDE-SubstituteUID=true to src/scanner.desktop
(see Novell/Suse Bugzilla bnc#550073).
Modified:
trunk/scanner/VERSION
trunk/scanner/package/yast2-scanner.changes
trunk/scanner/src/Scanner.ycp
trunk/scanner/src/dialogs.ycp
trunk/scanner/src/helps.ycp
Modified: trunk/scanner/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/scanner/VERSION?rev=60192&r1=601…
==============================================================================
--- trunk/scanner/VERSION (original)
+++ trunk/scanner/VERSION Wed Dec 23 15:36:04 2009
@@ -1 +1 @@
-2.18.0
+2.19.0
Modified: trunk/scanner/package/yast2-scanner.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/scanner/package/yast2-scanner.ch…
==============================================================================
--- trunk/scanner/package/yast2-scanner.changes (original)
+++ trunk/scanner/package/yast2-scanner.changes Wed Dec 23 15:36:04 2009
@@ -1,4 +1,21 @@
-------------------------------------------------------------------
+Wed Dec 23 15:21:13 CET 2009 - jsmeix(a)suse.de
+
+- V 2.19.0
+- Replaced overcomplicated but nevertheless mostly useless code
+ for using the YaST SuSEFirewall module by simple generic code
+ in a ShowFirewallPopup function in the same way as it works
+ for yast2-printer (compare Novell/Suse Bugzilla bnc#549065)
+ and enhanced the help text "Regarding Firewall",
+ (see Novell/Suse Bugzilla bnc#551282).
+- Fixed duplicate button widget with ID `back by
+ calling Wizard::HideBackButton() before calling
+ Wizard::SetAbortButton(`back,Label::CancelButton()), see
+ http://lists.opensuse.org/opensuse-factory/2009-10/msg00528.html
+- Added X-KDE-SubstituteUID=true to src/scanner.desktop
+ (see Novell/Suse Bugzilla bnc#550073).
+
+-------------------------------------------------------------------
Wed Feb 11 16:04:35 CET 2009 - jsmeix(a)suse.de
- V 2.18.0
Modified: trunk/scanner/src/Scanner.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/scanner/src/Scanner.ycp?rev=6019…
==============================================================================
--- trunk/scanner/src/Scanner.ycp (original)
+++ trunk/scanner/src/Scanner.ycp Wed Dec 23 15:36:04 2009
@@ -20,7 +20,6 @@
import "Package";
import "Label";
import "Service";
-import "SuSEFirewall";
import "Arch";
/**
@@ -181,23 +180,6 @@
global map< string, string > network_scanning_config = $[];
/**
- * Firewall network scanning configuration:
- * Determined at runtime via Scanner::DetermineNetworkScanningConfig()
- * which calls SuSEFirewall functions to fill the map @ref firewall_config
- * except "ui_no_firewall_for_int" and "ui_deny_from_ext" which are the user settings in the dialog.
- * The entries are such that "true" is the default, reasonable and intended setting.
- * @struct firewall_config
- * $[ "suse_firewall_used":"true if Suse Firewall and no other firewall is used",
- * "firewall_active":"true if Suse Firewall is actually running",
- * "no_firewall_for_int":"true if Suse Firewall does not potect the INT zone",
- * "ui_no_firewall_for_int":"true if user has set in dialog no Suse Firewall protection for INT",
- * "denied_from_ext":"true if saned access (sane-port 6566) is denied from EXT zone",
- * "ui_deny_from_ext":"true if user has set in dialog to deny access from EXT"
- * ]
- */
-global map< string, boolean > firewall_config = $[];
-
-/**
* Environment values:
* It is a map of @ref environment_values
* @struct environment_values
@@ -2428,8 +2410,6 @@
* which calls "grep ... /etc/sane.d/net.conf" and "grep ... /etc/sane.d/saned.conf"
* and processes its output and stores the results as YCP map in a temporary file
* and then read the temporary file (SCR::Read) to get the YCP map.
- * Additionally call SuSEFirewall functions to determine the firewall settings
- * regarding remote access to the saned (service "sane-port" 6566/tcp,6566/udp).
* @return true on success
*/
global boolean DetermineNetworkScanningConfig()
@@ -2469,77 +2449,6 @@
return false;
}
y2milestone( "Network scanning config: %1", network_scanning_config );
- // Determine the firewall settings regarding remote access to the saned:
- // Return successfully regardless of the result of this steps
- // because the mandatory network scanning config was successfully determined.
- // SuSEFirewall::Read shows a Progress.
- // Save previous Progress state and disable showing Progress:
- boolean progress_previous_state = Progress::set( false );
- if( ! SuSEFirewall::Read() )
- { // If firewall_config is the empty map, the user
- // cannot change a firewall setting and in SetupNetworkScanningConfig()
- // noting will be committed.
- y2milestone( "SuSEFirewall::Read failed." );
- firewall_config = $[];
- // Restore previous Progress state:
- Progress::set( progress_previous_state );
- return true;
- }
- // Restore previous Progress state:
- Progress::set( progress_previous_state );
- // Preset the firewall_config map with the
- // defaults after a default system installation
- // to have a reasonable fallback if the actual values regarding
- // firewall access permissions for the saned cannot be determined:
- firewall_config = $[ "suse_firewall_used":true,
- "firewall_active":true,
- "no_firewall_for_int":true,
- "ui_no_firewall_for_int":true,
- "denied_from_ext":true,
- "ui_deny_from_ext":true
- ];
- // Determine whether the Suse Firewall is used:
- if( SuSEFirewall::IsOtherFirewallRunning() )
- { // If not the Suse Firewall is used, the dialogs will not show
- // any firewall settings and therefore the user cannot change them.
- firewall_config["suse_firewall_used"] = false;
- y2milestone( "Not the Suse Firewall is used, i.e. another firewall is running." );
- return true;
- }
- // Determine whether the Suse Firewall is active:
- if( ! SuSEFirewall::IsStarted()
- || ! SuSEFirewall::GetStartService()
- )
- { // If the Suse Firewall is not active, the dialogs will not show
- // any firewall settings because it is useless and confusing
- // to let the user change firewall settings regarding saned
- // when the user had decided to have no firewall currently running
- // or if the firewall would not be started in SuSEFirewall::Write()
- firewall_config["firewall_active"] = false;
- y2milestone( "The Suse Firewall is not active or would not be started in SuSEFirewall::Write." );
- return true;
- }
- // Determine the actual settings regarding firewall access permissions for saned
- // and preset the user interface settings with the actual settings:
- if( SuSEFirewall::GetProtectFromInternalZone() )
- { firewall_config["no_firewall_for_int"] = false;
- firewall_config["ui_no_firewall_for_int"] = false;
- }
- else
- { firewall_config["no_firewall_for_int"] = true;
- firewall_config["ui_no_firewall_for_int"] = true;
- }
- if( SuSEFirewall::HaveService( "sane-port", "TCP", "EXT" )
- || SuSEFirewall::HaveService( "sane-port", "UDP", "EXT" )
- )
- { firewall_config["denied_from_ext"] = false;
- firewall_config["ui_deny_from_ext"] = false;
- }
- else
- { firewall_config["denied_from_ext"] = true;
- firewall_config["ui_deny_from_ext"] = true;
- }
- y2milestone( "Firewall network scanning config: %1", firewall_config );
return true;
}
@@ -2548,8 +2457,6 @@
* activates or deactivates the "net" backend and which writes into
* /etc/sane.d/net.conf, /etc/sane.d/saned.conf, and /etc/xinetd.d/sane-port
* and reloads or starts the xinetd dependig on whether it is running or not.
- * Additionally call SuSEFirewall functions to commit changed firewall settings
- * regarding remote access to the saned (service "sane-port" 6566/tcp,6566/udp).
* @return true on success
*/
global boolean SetupNetworkScanningConfig()
@@ -2574,69 +2481,6 @@
);
return false;
}
- // If the Suse Firewall is used and
- // if the Suse Firewall is active and
- // if firewall settings have been changed by the user,
- // then set and commit the new firewall settings.
- // Use safe fallback values - i.e. in case of doubt don't do anything:
- if( firewall_config["suse_firewall_used"]:false
- && firewall_config["firewall_active"]:false
- && ( firewall_config["ui_no_firewall_for_int"]:true != firewall_config["no_firewall_for_int"]:true
- || firewall_config["ui_deny_from_ext"]:true != firewall_config["denied_from_ext"]:true
- )
- )
- { // Set new firewall settings in SuSEFirewall:
- y2milestone( "Set and commit new firewall network scanning config: %1", firewall_config );
- // Set new firewall settings regarding access allow from INT zone:
- if( ! firewall_config["no_firewall_for_int"]:true
- && firewall_config["ui_no_firewall_for_int"]:false )
- { // Firewall protects internal zone
- // but user has set no protection for internal zone.
- // The SuSEFirewall::SetProtectFromInternalZone returns void,
- // therefore there is no test possible whether it had worked.
- SuSEFirewall::SetProtectFromInternalZone(false);
- y2milestone( "SuSEFirewall::SetProtectFromInternalZone(false)" );
- }
- // Set new firewall settings regarding saned access deny from EXT zone:
- if( ! firewall_config["denied_from_ext"]:true
- && firewall_config["ui_deny_from_ext"]:false )
- { // Firewall allows saned access from the external zone
- // but user has set in dialog to deny saned access from the external zone:
- if( ! SuSEFirewall::RemoveService( "sane-port", "TCP", "EXT" )
- || ! SuSEFirewall::RemoveService( "sane-port", "UDP", "EXT" )
- )
- { y2milestone( "Error: SuSEFirewall::AddService(sane-port,TCP+UDP,EXT) failed." );
- Popup::Error( // Message of a Popup::Error.
- // Only a simple message because this error does not happen on a normal system
- // (i.e. a system which is not totally broken or totally messed up).
- // Do not confuse this error with the case when no firewall stuff is to be set up.
- // The latter results no error.
- _("Failed to deny saned access from external zone in firewall.")
- );
- return false;
- }
- y2milestone( "Success: SuSEFirewall::RemoveService(sane-port,TCP+UDP,EXT)" );
- }
- // Commit the new firewall settings:
- // SuSEFirewall::Write shows a Progress.
- // Save previous Progress state and disable showing Progress:
- boolean progress_previous_state = Progress::set( false );
- if( ! SuSEFirewall::Write() )
- { y2milestone( "Error: SuSEFirewall::Write failed to commit firewall settings regarding scanning via network." );
- Popup::Error( // Message of a Popup::Error.
- // Only a simple message because this error does not happen on a normal system
- // (i.e. a system which is not totally broken or totally messed up).
- // Do not confuse this error with the case when no firewall stuff is to be set up.
- // The latter results no error.
- _("Failed to write firewall settings regarding scanning via network.")
- );
- // Restore previous Progress state:
- Progress::set( progress_previous_state );
- return false;
- }
- // Restore previous Progress state:
- Progress::set( progress_previous_state );
- }
// Determine active scanners and active backends anew.
// Return successfully regardless of the result of this steps
// because scanning via network was successfully set up.
@@ -2649,6 +2493,39 @@
return true;
}
+/**
+ * Determine if any kind of firewall seems to be active by calling
+ * "iptables -n -L | egrep -q 'DROP|REJECT'"
+ * to find out if there are currently dropping or rejecting packet filter rules.
+ * One might use a more specific test via
+ * "iptables -n -L | grep -v '^LOG' | egrep -q '^DROP|^REJECT'"
+ * to match only for DROP and REJECT targets and exclude LOG targets
+ * but it does not cause real problems when there is a false positive result here
+ * because all what happens it that then a needless firewall info popup would be shown.
+ * If any kind of firewall seems to be active, show a popup message
+ * regarding scanning via network and firewall.
+ * @return true if any kind of firewall seems to be active
+ */
+global boolean ShowFirewallPopup()
+{ // Note the '-n' (only numeric output) option to avoid long reverse DNS lookups:
+ if( ExecuteBashCommand( "iptables -n -L | egrep -q 'DROP|REJECT'" ) )
+ { y2milestone("A firewall seems to be active.");
+ Popup::MessageDetails( // Popup::MessageDetails message:
+ _("Check that your firewall allows scanning via network."),
+ // Popup::MessageDetails information regarding details:
+ _("For details regarding firewall see the help text of this dialog.")
+ );
+ return true;
+ }
+ // Return 'false' also as fallback value when the above command fails
+ // because of whatever reason because this fallback value is safe
+ // because it only results that no firewall info popup is shown
+ // the "Print via Network" and/or "Share Printers" dialogs
+ // but also the help text of those dialogs explains firewall stuff
+ // so that sufficient information is available in any case:
+ return false;
+}
+
/*
* Autoinstallation stuff:
*
Modified: trunk/scanner/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/scanner/src/dialogs.ycp?rev=6019…
==============================================================================
--- trunk/scanner/src/dialogs.ycp (original)
+++ trunk/scanner/src/dialogs.ycp Wed Dec 23 15:36:04 2009
@@ -633,15 +633,15 @@
Label::NextButton()
);
// According to http://en.opensuse.org/YaST/Style_Guide#Configuration_Wizard
+ // the button with the "back" functionality must be disabled
+ // only when it is the first dialog of a wizard stlye dialog sequence.
+ Wizard::HideBackButton();
+ // According to http://en.opensuse.org/YaST/Style_Guide#Configuration_Wizard
// there is no longer a "abort" functionality which exits the whole module.
// Instead this button is now named "Cancel" and its functionality is
// to go back to the Overview dialog (i.e. what the "back" button would do)
// because it reads "Cancel - Closes the window and returns to the overview."
Wizard::SetAbortButton( `back, Label::CancelButton() );
- // According to http://en.opensuse.org/YaST/Style_Guide#Configuration_Wizard
- // the button with the "back" functionality must be disabled
- // when it is the first dialog of a wizard stlye dialog sequence.
- Wizard::DisableBackButton();
any ret = nil;
while(true)
{ ret = UI::UserInput();
@@ -850,122 +850,13 @@
* @return dialog result
*/
any ConfigureNetworkScanningDialog()
-{ // Determine the network scanning config
+{ boolean firewall_popup_was_shown = false;
+ // Determine the network scanning config
// but don't care if this fails because then empty strings are used as secure fallback
// and empty strings will disable scanning via network (i.e. the net backend and the saned):
Scanner::DetermineNetworkScanningConfig();
string net_backend_hosts = Scanner::network_scanning_config["net_backend_hosts"]:"";
string saned_hosts = Scanner::network_scanning_config["saned_hosts"]:"";
- // Dialog contents regarding firewall settings:
- // Predefine it for the case when not the Suse Firewall is used:
- term firewall_contents = `Label( // User information when not the Suse Firewall is used.
- _("No SUSE Firewall, but another kind of firewall is used")
- );
- if( Scanner::firewall_config["suse_firewall_used"]:false )
- { // The Suse Firewall is used:
- if( ! Scanner::firewall_config["firewall_active"]:true )
- { // The Suse Firewall is used but it is not active:
- firewall_contents = `Label( // User information when the Suse Firewall is not active.
- _("Firewall is not or should not be running")
- );
- }
- else
- { // The Suse Firewall is used and it is active:
- // Predefine the contents for the current Suse Firewall status
- // according to what the usual defaults are (e.g. after the installation):
- term firewall_active_content = `Label( // User information when the Suse Firewall is used and active.
- _("Firewall is active")
- );
- term no_firewall_for_int_content = `Label( // User information when the Suse Firewall does not potect the INT zone.
- // Be careful when you change or translate "internal", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "internal zone" is used.
- _("No firewall protection for the internal network zone")
- );
- term denied_from_ext_content = `Label( // User information when saned access is denied from the EXT zone.
- // Do not change or translate "saned", it is a program (sane daemon) name.
- // Be careful when you change or translate "external", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "external zone" is used.
- _("saned access denied from the external network zone")
- );
- // Label of a CheckBox:
- // Be careful when you change or translate "internal", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "internal zone" is used.
- string ui_no_firewall_for_int_checkbox_label = _("No Firewall Protection for the &Internal Network Zone");
- // Label of a CheckBox:
- // Do not change or translate "saned", it is a program (sane daemon) name.
- // Be careful when you change or translate "external", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "external zone" is used.
- string ui_deny_from_ext_checkbox_label = _("Deny saned Access from the &External Network Zone");
- // Predefine the CheckBoxes according to what the usual defaults are (e.g. after the installation).
- // The defaults are: No protection for internal zone but protection from external zone.
- // Those defaults are o.k. for scanning via internal network and should not be changed.
- // Therefore the CheckBoxes are disabled:
- term ui_no_firewall_for_int_checkbox_content = `CheckBox( `id(`ui_no_firewall_for_int_checkbox),
- `opt(`disabled),
- ui_no_firewall_for_int_checkbox_label,
- true
- );
- term ui_deny_from_ext_checkbox_content = `CheckBox( `id(`ui_deny_from_ext_checkbox),
- `opt(`disabled),
- ui_deny_from_ext_checkbox_label,
- true
- );
- // Determine and set the actual contents regarding firewall settings:
- if( ! Scanner::firewall_config["no_firewall_for_int"]:true )
- { // There is protection for internal zone:
- no_firewall_for_int_content = `Label( // User information when the Suse Firewall potects the INT zone.
- // Be careful when you change or translate "internal", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "internal zone" is used.
- _("Firewall protection enabled for the internal network zone")
- );
- // When firewall protection is enabled for internal network zone
- // have an active CheckBox to disable it but don't have it checked by default
- // to be on the safe side because the user must intentionally disable the
- // firewall protection for internal zone:
- ui_no_firewall_for_int_checkbox_content = `CheckBox( `id(`ui_no_firewall_for_int_checkbox),
- ui_no_firewall_for_int_checkbox_label,
- false
- );
- }
- if( ! Scanner::firewall_config["denied_from_ext"]:true )
- { // There is no protection from external zone:
- denied_from_ext_content = `Label( // User information when saned access is allowed from the EXT zone.
- // Do not change or translate "saned", it is a program (sane daemon) name.
- // Be careful when you change or translate "external", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "external zone" is used.
- _("saned access allowed from the external network zone")
- );
- // When firewall protection is disabled for external zone
- // have an active CheckBox to enable it and have it checked by default
- // to be on the safe side because saned access from external is insecure:
- ui_deny_from_ext_checkbox_content = `CheckBox( `id(`ui_deny_from_ext_checkbox),
- ui_deny_from_ext_checkbox_label,
- true
- );
- }
- // Assemble the parts of the firewall_contents:
- firewall_contents = `VBox( `Frame( // Label of a Frame for the current firewall status.
- _("Current Firewall Status"),
- `VBox( `Left( firewall_active_content ),
- `Left( no_firewall_for_int_content ),
- `Left( denied_from_ext_content )
- )
- ),
- `Frame( // Label of a Frame for the firewall settings for scanning via network.
- _("Firewall Settings"),
- `VBox( `Left( ui_no_firewall_for_int_checkbox_content ),
- `Left( ui_deny_from_ext_checkbox_content )
- )
- )
- );
- }
- }
// Caption of the ConfigureNetworkScanningDialog:
string caption = _("Set Up Scanning via Network");
// Header of a TextEntry user input field.
@@ -985,12 +876,10 @@
term contents = `VBox( `VStretch(),
`Frame( // Label of a Frame for the server settings for scanning via network.
_("Server Settings"),
- `VBox( `TextEntry( `id(`saned_hosts_input),
- saned_hosts_input_label,
- saned_hosts
- ),
- firewall_contents
- )
+ `TextEntry( `id(`saned_hosts_input),
+ saned_hosts_input_label,
+ saned_hosts
+ )
),
`VStretch(),
`Frame( // Label of a Frame for the client settings for scanning via network.
@@ -1040,6 +929,23 @@
Label::OKButton()
);
Wizard::HideAbortButton();
+ if( ( "" != filterchars( net_backend_hosts, Scanner::alnum_chars )
+ || "" != filterchars( saned_hosts, Scanner::alnum_chars )
+ )
+ &&
+ ( net_backend_hosts_input_local_host_config_value != net_backend_hosts
+ || saned_hosts_input_local_host_config_value != saned_hosts
+ )
+ )
+ { // When the current net_backend_hosts value is effectively non-empty
+ // or when the current saned_hosts value is effectively non-empty
+ // and when at least one is not only those of a "Local Host Configuration"
+ // test whether or not a firewall seems to be active and
+ // if yes show a popup regarding firewall:
+ if( Scanner::ShowFirewallPopup() )
+ { firewall_popup_was_shown = true;
+ }
+ }
any ret = nil;
while(true)
{ ret = UI::UserInput();
@@ -1070,71 +976,29 @@
/* set up the configuration */
if( ret == `next )
{ // Get the mandatory vaules to set up scanning via network:
- Scanner::network_scanning_config["net_backend_hosts"] = (string)UI::QueryWidget( `id(`net_backend_hosts_input),
- `Value
- );
- Scanner::network_scanning_config["saned_hosts"] = (string)UI::QueryWidget( `id(`saned_hosts_input),
- `Value
- );
- // Only when the Suse Firewall is used and when it is active
- // the checkbox for the firewall settings exist:
- if( Scanner::firewall_config["suse_firewall_used"]:false
- && Scanner::firewall_config["firewall_active"]:false
+ net_backend_hosts = (string)UI::QueryWidget( `id(`net_backend_hosts_input), `Value );
+ saned_hosts = (string)UI::QueryWidget( `id(`saned_hosts_input), `Value );
+ if( ( "" != filterchars( net_backend_hosts, Scanner::alnum_chars )
+ || "" != filterchars( saned_hosts, Scanner::alnum_chars )
+ )
+ &&
+ ( net_backend_hosts_input_local_host_config_value != net_backend_hosts
+ || saned_hosts_input_local_host_config_value != saned_hosts
+ )
)
- { // Get the vaules of the checkboxes for the firewall settings:
- Scanner::firewall_config["ui_no_firewall_for_int"] = (boolean)UI::QueryWidget( `id(`ui_no_firewall_for_int_checkbox),
- `Value
- );
- Scanner::firewall_config["ui_deny_from_ext"] = (boolean)UI::QueryWidget( `id(`ui_deny_from_ext_checkbox),
- `Value
- );
- // Test whether the vaules of the checkboxes for the firewall settings make sense:
- if( ! Scanner::firewall_config["ui_deny_from_ext"]:true )
- { // User has set in dialog to allow saned access from the external zone.
- // This is only possible when saned access from the external zone is allowed in firewall
- // because otherwise the CheckBox is disabled:
- if( Scanner::network_scanning_config["saned_hosts"]:"" != "" )
- { // There are clients which should be able to access saned,
- // therefore saned will be started and then it must be protected from external zone:
- Popup::Notify ( // Message of a Popup::Notify.
- // The help text of the "Scanning via Network" dialog explains
- // why it doesn't make sense and is insecure to allow saned access
- // from the external network zone.
- // Do not change or translate "saned", it is a program (sane daemon) name.
- // Be careful when you change or translate "external", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "external zone" is used.
- _("saned access from the external zone cannot be allowed.")
- );
- UI::ChangeWidget( `id(`ui_deny_from_ext_checkbox),
- `Value,
- true
- );
- continue;
- }
- }
- if( ! Scanner::firewall_config["ui_no_firewall_for_int"]:true )
- { // User has set in dialog to potect the internal zone.
- // This is only possible when firewall protection is enabled for internal zone
- // because otherwise the CheckBox is disabled:
- if( Scanner::network_scanning_config["saned_hosts"]:"" != ""
- && Scanner::network_scanning_config["saned_hosts"]:"" != saned_hosts_input_local_host_config_value )
- { // There are non-localnet clients which should be able to access saned:
- if( ! Popup::ContinueCancel( // Message of a Popup::ContinueCancel.
- // Be careful when you change or translate "local host configuration"
- // because this term is used also in the help text and as a label
- // of a PushButton for a predefined configuration.
- // Be careful when you change or translate "internal", and "zone"
- // to keep the relationship to the matching term in the YaST firewall
- // setup module where also "internal zone" is used.
- _("Only a local host configuration works with firewall protection for the internal zone.")
- )
- )
- { continue;
- }
+ { // When the current net_backend_hosts value is effectively non-empty
+ // or when the current saned_hosts value is effectively non-empty
+ // and when at least one is not only those of a "Local Host Configuration"
+ // test whether or not a firewall seems to be active and
+ // if yes show a popup regarding firewall if it was not yet shown:
+ if( ! firewall_popup_was_shown )
+ { if( Scanner::ShowFirewallPopup() )
+ { firewall_popup_was_shown = true;
}
}
}
+ Scanner::network_scanning_config["net_backend_hosts"] = net_backend_hosts;
+ Scanner::network_scanning_config["saned_hosts"] = saned_hosts;
Wizard::DisableBackButton();
Wizard::DisableNextButton();
if( ! Scanner::SetupNetworkScanningConfig() )
@@ -1149,7 +1013,7 @@
if( ret == `back )
{ break;
}
- y2milestone( "Ignoring unexpected returncode in ConfigureBackendDialog: %1", ret );
+ y2milestone( "Ignoring unexpected returncode in ConfigureNetworkScanningDialog: %1", ret );
continue;
}
return ret;
Modified: trunk/scanner/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/scanner/src/helps.ycp?rev=60192&…
==============================================================================
--- trunk/scanner/src/helps.ycp (original)
+++ trunk/scanner/src/helps.ycp Wed Dec 23 15:36:04 2009
@@ -235,7 +235,7 @@
</p>"),
"configure_network_scanning" :
-// ConfigureNetworkScanning dialog help 1/4:
+// ConfigureNetworkScanning dialog help 1/5:
// Do not confuse "scanning via network" (i.e. use a remote scanner via another host in the network)
// with "scanning the network" (i.e. scan the network for other hosts or services).
_("<p>
@@ -243,16 +243,11 @@
Enter the appropriate information and press <b>Next</b>
to set up scanning via network.
</p>") +
-// ConfigureNetworkScanning dialog help 2/4:
+// ConfigureNetworkScanning dialog help 2/5:
// Do not change or translate "saned", it is a program (sane daemon) name.
// Do not change or translate "CIDR", it is a (sub)-network notation name.
// Do not change or translate "192.168.1.0/24", it is an intentionally selected actually working example.
// Do not change or translate "xinetd", it is a program (daemon) name.
-// Do not change or translate "sane-port", it is a port name (see /etc/services).
-// Be careful when you change or translate "external", "internal", and "zone"
-// to keep the relationship to the matching terms in the YaST firewall setup module
-// where also "external zone", and "internal zone" is used.
-// Keep the information that external access is useless and insecure (see "man saned").
_("<p>
<b><big>Server Settings</big></b><br>
If you have locally connected scanners and want to make them accessible via the network,
@@ -262,19 +257,60 @@
or subnets (CIDR notation, such as 192.168.1.0/24).
If no client hosts are permitted, saned is not activated.
If saned is activated, xinetd is also activated and set up for saned.
-Clients contact saned via the sane-port (TCP port 6566)
+</p>") +
+// ConfigureNetworkScanning dialog help 3/5:
+// Do not change or translate "saned", it is a program (sane daemon) name.
+// Do not change or translate "sane-port", it is a port name (see /etc/services).
+// Be careful when you change or translate "external", "internal", and "zone"
+// to keep the relationship to the matching terms in the YaST firewall setup module
+// where also "external zone", and "internal zone" is used.
+// Keep the information that external access is useless and insecure (see "man saned").
+_("<p>
+<b><big>Regarding Firewall</big></b><br>
+Clients contact the saned via the sane-port (TCP port 6566)
but scanning data is transferred via an additional random port.
-The default <b>Firewall Settings</b> during system installation
-protect your host from external access.
-This is not a problem when using scanners in an internal network
-(when the network interface belongs to the internal network zone)
+Therefore is is not sufficient for scanning via network
+to open only port 6566 in the firewall.<br>
+You can specify a port range for the data connection
+in the saned config file /etc/sane.d/saned.conf
+via an entry like 'data_portrange = 30000 - 30100'
+and then open port 6566 and the port range 30000:30100
+in the firewall.<br>
+The default firewall settings protect your host from external access.
+Allowing access from the external network (i.e. for the external zone)
+does not make sense because scanning documents requires
+physical scanner access by trusted users.<br>
+On the other hand the default firewall settings allow
+any access from an internal (i.e. trusted) network
unless you have firewall protection enabled for the internal zone.
-Allowing access from an external network does not make sense
-because scanning documents requires physical scanner access.
-Therefore access from the external zone can only be denied
-if it was accidentally allowed by insecure firewall settings.
+But an active firewall for the internal zone (i.e. for the
+trusted network zone) does usually also not make much sense
+because this makes the internal zone effectively the same
+as the external zone.<br>
+The simplest and most secure way to do scanning via network
+is when the trusted network has a well separated network interface
+to have the trusted network well separated from the rest.
+Then those network interface can be assigned to the internal zone
+via the YaST Firewall setup module and scanning via network
+will work without any further firewall setup.<br>
+Anything else may result a problematic mix-up of trusted and
+non-trusted network traffic in one same network environment.
+For example when both the internal network and the connection
+to the Internet happens via one same 'router-box' device.
+In such a case the 'router-box' device is the crucial point
+(in particular the crucial point of possible failure)
+regarding network security.<br>
+In any case a plain opening of a port for the external zone
+is dangerous because it allows access from any foreign host
+to those port but does not provide any protection for
+the service which is accessed via this port (e.g. the saned).
+Instead of plain opening of ports for arbitrary access
+one should additionally specify in the firewall setup
+from which hosts and networks the access is allowed.
+The YaST Firewall setup module can also be used
+for such kind of more sophisticated firewall setup.
</p>") +
-// ConfigureNetworkScanning dialog help 3/4:
+// ConfigureNetworkScanning dialog help 4/5:
// Do not change or translate "net", it is a metadriver name.
// Do not simply use "driver" because net is no normal driver but a metadriver.
// Do not change or translate "saned", it is a program (sane daemon) name.
@@ -287,7 +323,7 @@
Enter a comma-separated list of servers (server names or IP addresses).
If no servers are entered, net is not activated.
</p>") +
-// ConfigureNetworkScanning dialog help 4/4:
+// ConfigureNetworkScanning dialog help 5/5:
// Be careful when you change or translate "local host configuration"
// because this term is used also in a message of a Popup::ContinueCancel
// and as label of a PushButton for a predefined configuration.
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r60191 - in /branches/SuSE-Code-11-SP1-Branch/autoinstallation: package/autoyast2.changes src/include/io.ycp
by ug@svn.opensuse.org 23 Dec '09
by ug@svn.opensuse.org 23 Dec '09
23 Dec '09
Author: ug
Date: Wed Dec 23 14:15:16 2009
New Revision: 60191
URL: http://svn.opensuse.org/viewcvs/yast?rev=60191&view=rev
Log:
fix for already mounted USB devices (bnc#565558)
Modified:
branches/SuSE-Code-11-SP1-Branch/autoinstallation/package/autoyast2.changes
branches/SuSE-Code-11-SP1-Branch/autoinstallation/src/include/io.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/autoinstallation/package/autoyast2.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/autoinstallation/package/autoyast2.changes Wed Dec 23 14:15:16 2009
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Wed Dec 23 14:14:11 CET 2009 - ug(a)suse.de
+
+- fix for already mounted USB devices (bnc#565558)
+
+-------------------------------------------------------------------
Wed Nov 25 15:57:35 CET 2009 - ug(a)suse.de
- mountby was not cloned correctly (bnc#557759)
Modified: branches/SuSE-Code-11-SP1-Branch/autoinstallation/src/include/io.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/autoi…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/autoinstallation/src/include/io.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/autoinstallation/src/include/io.ycp Wed Dec 23 14:15:16 2009
@@ -217,7 +217,20 @@
integer i = 0;
string dev = d["dev_name"]:"";
while( SCR::Read(.target.lstat, dev) != $[] || i < 5 ) {
- if( !(boolean)WFM::Execute(.local.mount, [ dev, mount_point ]) ) {
+ string mounts = (string)(SCR::Read (.target.string, "/proc/mounts"));
+ list<string> mount_list = splitstring( mounts, "\n" );
+ boolean already_mounted = false;
+ foreach( string m, mount_list, ``{
+ list<string> entries = splitstring( m, " " );
+ // FIXME: check for bind-mounted
+ if( entries[0]:"" == dev ) {
+ already_mounted = true;
+ mount_point = entries[1]:"";
+ break;
+ }
+ });
+ y2milestone("already mounted=%1 mountpoint=%2",already_mounted,mount_point);
+ if( ! already_mounted && !(boolean)WFM::Execute(.local.mount, [ dev, mount_point ]) ) {
y2milestone("mount failed for %1", dev);
i = i + 1;
dev = d["dev_name"]:"" + sformat("%1",i);
@@ -230,7 +243,8 @@
GET_error = "";
ok = true;
}
- SCR::Execute(.target.umount, mount_point);
+ if( !already_mounted )
+ SCR::Execute(.target.umount, mount_point);
if( ok == true )
break;
i = i + 1;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r60190 - in /trunk/autoinstallation: package/autoyast2.changes src/include/io.ycp
by ug@svn.opensuse.org 23 Dec '09
by ug@svn.opensuse.org 23 Dec '09
23 Dec '09
Author: ug
Date: Wed Dec 23 11:34:24 2009
New Revision: 60190
URL: http://svn.opensuse.org/viewcvs/yast?rev=60190&view=rev
Log:
merged autoyast=device and autoyast=usb (bnc#565558)
Modified:
trunk/autoinstallation/package/autoyast2.changes
trunk/autoinstallation/src/include/io.ycp
Modified: trunk/autoinstallation/package/autoyast2.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/package/autoyas…
==============================================================================
--- trunk/autoinstallation/package/autoyast2.changes (original)
+++ trunk/autoinstallation/package/autoyast2.changes Wed Dec 23 11:34:24 2009
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Wed Dec 23 11:30:12 CET 2009 - ug(a)suse.de
+
+- merged the code for autoyast=device and autoyast=usb to reduce
+ redundancy and fix the "already mounted" bug for USB (bnc#565558)
+
+-------------------------------------------------------------------
Wed Dec 16 18:44:20 CET 2009 - aschnell(a)suse.de
- adapted encryption password setting to new yast2-storage
Modified: trunk/autoinstallation/src/include/io.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/autoinstallation/src/include/io.…
==============================================================================
--- trunk/autoinstallation/src/include/io.ycp (original)
+++ trunk/autoinstallation/src/include/io.ycp Wed Dec 23 11:34:24 2009
@@ -238,7 +238,8 @@
WFM::Execute(.local.umount, mount_point);
}
- else if (Scheme == "floppy" || Scheme == "usb")
+// else if (Scheme == "floppy" || Scheme == "usb")
+ else if (Scheme == "floppy")
{
if (StorageDevices::FloppyReady() && Scheme == "floppy")
{
@@ -254,6 +255,8 @@
ok = true;
}
SCR::Execute(.target.umount, mount_point);
+ }
+ /*
} else {
y2milestone("looking for %1 on USB", Path);
list<map> probe = (list<map>)SCR::Read(.probe.usb);
@@ -286,15 +289,19 @@
break;
});
}
+ */
}
- else if (Scheme == "device") // Device
+ else if (Scheme == "device" || Scheme == "usb" ) // Device or USB
{
if ( Path != "")
{
list<string> deviceList = [];
if( Host == "" ) {
- list<map> disks = (list<map>)SCR::Read(.probe.disk);
+ list<map> disks = (Scheme == "device") ? (list<map>)SCR::Read(.probe.disk) : (list<map>)SCR::Read(.probe.usb);
foreach( map m, disks, ``{
+ if( Scheme == "usb" &&
+ m["bus"]:"USB" != "SCSI" )
+ continue;
if( haskey( m, "dev_name") ) {
integer i = 0;
string dev = m["dev_name"]:"";
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
23 Dec '09
Author: jsmeix
Date: Wed Dec 23 11:09:09 2009
New Revision: 60189
URL: http://svn.opensuse.org/viewcvs/yast?rev=60189&view=rev
Log:
Added iptables to Recommends in yast2-printer.spec.in
because it is called in FirewallSeemsToBeActive().
Modified:
trunk/printer/yast2-printer.spec.in
Modified: trunk/printer/yast2-printer.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/printer/yast2-printer.spec.in?re…
==============================================================================
--- trunk/printer/yast2-printer.spec.in (original)
+++ trunk/printer/yast2-printer.spec.in Wed Dec 23 11:09:09 2009
@@ -4,7 +4,7 @@
BuildRequires: update-desktop-files xorg-x11-libX11-devel yast2 yast2-core-devel yast2-devtools yast2-testsuite
-Recommends: cups-client netcat samba-client
+Recommends: cups-client iptables netcat samba-client
Requires: /bin/mktemp /bin/ping /usr/bin/sed
Requires: yast2 >= 2.16.12
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
23 Dec '09
Author: jsmeix
Date: Wed Dec 23 10:43:40 2009
New Revision: 60188
URL: http://svn.opensuse.org/viewcvs/yast?rev=60188&view=rev
Log:
Added X-KDE-SubstituteUID=true
to src/scanner.desktop (bnc#550073).
Modified:
trunk/scanner/src/scanner.desktop
Modified: trunk/scanner/src/scanner.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/scanner/src/scanner.desktop?rev=…
==============================================================================
--- trunk/scanner/src/scanner.desktop (original)
+++ trunk/scanner/src/scanner.desktop Wed Dec 23 10:43:40 2009
@@ -1,13 +1,12 @@
[Desktop Entry]
Type=Application
Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Hardware;
-
X-KDE-ModuleType=Library
X-KDE-RootOnly=true
X-KDE-HasReadOnlyMode=true
X-KDE-Library=yast2
+X-KDE-SubstituteUID=true
X-SuSE-YaST-Call=scanner
-
X-SuSE-YaST-Group=Hardware
X-SuSE-YaST-Argument=
X-SuSE-YaST-RootOnly=true
@@ -15,11 +14,8 @@
X-SuSE-YaST-Geometry=
X-SuSE-YaST-SortKey=
X-SuSE-YaST-AutoInstResource=
-
Icon=yast-scanner
Exec=/sbin/yast2 scanner
-
Name=Scanner
GenericName=Configure a scanner
-
StartupNotify=true
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r60187 - /tags/branch-Code-11-SP1-2_17_87/storage/
by fehr@svn.opensuse.org 22 Dec '09
by fehr@svn.opensuse.org 22 Dec '09
22 Dec '09
Author: fehr
Date: Tue Dec 22 17:58:07 2009
New Revision: 60187
URL: http://svn.opensuse.org/viewcvs/yast?rev=60187&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_87 for storage
Added:
tags/branch-Code-11-SP1-2_17_87/storage/ (props changed)
- copied from r60186, branches/SuSE-Code-11-SP1-Branch/storage/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
22 Dec '09
Author: fehr
Date: Tue Dec 22 17:58:06 2009
New Revision: 60186
URL: http://svn.opensuse.org/viewcvs/yast?rev=60186&view=rev
Log:
Created tag branch-Code-11-SP1-2_17_87
Added:
tags/branch-Code-11-SP1-2_17_87/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r60185 - in /branches/SuSE-Code-11-SP1-Branch/storage: ./ libstorage/src/ libstorage/testsuite/ libstorage/testsuite/single.out/ package/ storage/src/include/ storage/src/modules/
by fehr@svn.opensuse.org 22 Dec '09
by fehr@svn.opensuse.org 22 Dec '09
22 Dec '09
Author: fehr
Date: Tue Dec 22 17:57:36 2009
New Revision: 60185
URL: http://svn.opensuse.org/viewcvs/yast?rev=60185&view=rev
Log:
backported crypt related fixes from HEAD
Modified:
branches/SuSE-Code-11-SP1-Branch/storage/VERSION
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Container.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/DmCo.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Loop.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageTmpl.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.h
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/fstab1.cc
branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/single.out/fstab1.out
branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes
branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp
branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp
branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-dialogs.ycp
branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp
Modified: branches/SuSE-Code-11-SP1-Branch/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/VERSION Tue Dec 22 17:57:36 2009
@@ -1 +1 @@
-2.17.86
+2.17.87
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Container.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Container.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Container.cc Tue Dec 22 17:57:36 2009
@@ -162,11 +162,13 @@
ret = doCreate( vol );
else if( vol->needExtend() )
ret = doResize( vol );
- if (vol->needCrsetup())
+ if (vol->needCrsetup(false))
ret = vol->doCrsetup();
break;
case FORMAT:
+ if (vol->needCrsetup(true))
+ ret = vol->doCrsetup();
if( ret==0 && vol->getFormat() )
ret = vol->doFormat();
if( ret==0 && vol->needLabel() )
@@ -175,7 +177,11 @@
case MOUNT:
if( vol->needRemount() )
+ {
+ if (vol->needCrsetup(true))
+ vol->doCrsetup();
ret = vol->doMount();
+ }
if( ret==0 && vol->needFstabUpdate() )
{
ret = vol->doFstabUpdate();
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/DmCo.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/DmCo.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/DmCo.cc Tue Dec 22 17:57:36 2009
@@ -122,7 +122,7 @@
keysize = extractNthWord( 1, line );
}
- if( cipher == "aes-cbc-essiv:sha256" )
+ if( cipher == "aes-cbc-essiv:sha256" || cipher == "aes-cbc-plain")
ret = ENC_LUKS;
else if( cipher == "twofish-cbc-plain" )
ret = ENC_TWOFISH;
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.cc Tue Dec 22 17:57:36 2009
@@ -24,7 +24,6 @@
Textdomain "storage"
*/
-
#include <fstream>
#include <algorithm>
@@ -94,6 +93,8 @@
if( i!=l.end() )
*i++ >> p->old.passno;
p->old.calcDependent();
+ if( checkNormalFile(p->old.device) )
+ p->old.loop = true;
p->nnew = p->old;
co.push_back( *p );
delete p;
@@ -494,14 +495,15 @@
{
ls.push_back( e.loop_dev );
}
- ls.push_back( e.dentry );
+ if( e.dmcrypt && e.optUser() )
+ ls.push_back( e.device );
+ else
+ ls.push_back( e.dentry );
ls.push_back( e.mount );
- if( e.dmcrypt && e.noauto )
+ if( e.dmcrypt && e.optUser() )
ls.push_back( "crypt" );
else
- {
ls.push_back( (e.fs!="ntfs")?e.fs:"ntfs-3g" );
- }
if( e.cryptotab )
{
ls.push_back( Volume::encTypeString(e.encr) );
@@ -545,8 +547,7 @@
string EtcFstab::createTabLine( const FstabEntry& e ) const
{
- y2mil("dentry:" << e.dentry << " mount:" << e.mount << "device:" << e.device);
- y2mil( "entry:" << e );
+ y2mil("dentry:" << e.dentry << " mount:" << e.mount << " device:" << e.device);
const list<string> ls = makeStringList(e);
y2mil( "list:" << ls );
unsigned max_fields = e.cryptotab ? lengthof(cryptotabFields)
@@ -759,6 +760,15 @@
i->old = i->nnew;
i->op = Entry::NONE;
}
+ else if( findCrtab( i->nnew, crypttab, lineno ))
+ {
+ string line = createTabLine( i->nnew );
+ if (!i->nnew.mount.empty())
+ fstab->append( line );
+ if( i->old.crypttab > i->nnew.crypttab &&
+ findCrtab( i->old, crypttab, lineno ))
+ crypttab.remove( lineno, 1 );
+ }
else
ret = FSTAB_UPDATE_ENTRY_NOT_FOUND;
break;
@@ -896,7 +906,11 @@
return( txt );
}
-
+bool
+FstabEntry::optUser() const
+ {
+ return find( opts.begin(), opts.end(), "user" ) != opts.end();
+ }
unsigned EtcFstab::fstabFields[] = { 20, 20, 10, 21, 1, 1 };
unsigned EtcFstab::cryptotabFields[] = { 11, 15, 20, 10, 10, 1 };
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/EtcFstab.h Tue Dec 22 17:57:36 2009
@@ -65,6 +65,7 @@
storage::MountByType mount_by;
void calcDependent();
+ bool optUser() const;
};
inline std::ostream& operator<< (std::ostream& s, const FstabEntry &v )
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Loop.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Loop.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Loop.cc Tue Dec 22 17:57:36 2009
@@ -74,7 +74,7 @@
else
{
numeric = false;
- setEncryption( ENC_LUKS );
+ initEncryption( ENC_LUKS );
if( !dm_dev.empty() )
{
setDmcryptDev( dm_dev );
@@ -123,7 +123,7 @@
else
{
numeric = false;
- setEncryption( ENC_LUKS );
+ initEncryption( ENC_LUKS );
if( dmcrypt_dev.empty() )
dmcrypt_dev = getDmcryptName();
setDmcryptDev( dmcrypt_dev, false );
@@ -143,13 +143,15 @@
void
Loop::init()
{
- reuseFile = delFile = false;
+ delFile = false;
+ reuseFile = true;
}
void
Loop::setDmcryptDev( const string& dm_dev, bool active )
{
dev = dm_dev;
+ y2mil( "dm_dev:" << dm_dev << " active:" << active );
nm = dm_dev.substr( dm_dev.find_last_of( '/' )+1);
if( active )
{
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.cc Tue Dec 22 17:57:36 2009
@@ -601,6 +601,13 @@
return( ret );
}
+string Md::mdDevice( unsigned num )
+ {
+ string dev( "/dev/md" );
+ dev += decString(num);
+ return( dev );
+ }
+
void Md::setPersonality( MdType val )
{
md_type=val;
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Md.h Tue Dec 22 17:57:36 2009
@@ -65,6 +65,8 @@
static const string& pName( storage::MdType t ) { return md_names[t]; }
static bool mdStringNum( const string& name, unsigned& num );
+ static string mdDevice( unsigned num );
+
friend std::ostream& operator<< (std::ostream& s, const Md& m );
virtual void print( std::ostream& s ) const { s << *this; }
string removeText( bool doing ) const;
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.cc Tue Dec 22 17:57:36 2009
@@ -1138,6 +1138,8 @@
else
{
ret = i->createPartition( type, start, size, device, true );
+ if( ret==0 )
+ checkPwdBuf( device );
}
}
}
@@ -1152,6 +1154,8 @@
else
{
ret = i->createPartition( type, start, size, device, true );
+ if( ret==0 )
+ checkPwdBuf( device );
}
}
}
@@ -2306,6 +2310,40 @@
}
int
+Storage::verifyCryptFilePassword( const string& file, const string& pwd )
+ {
+ int ret = VOLUME_CRYPT_NOT_DETECTED;
+ assertInit();
+ y2mil("file:" << file << " l:" << pwd.length());
+#ifdef DEBUG_LOOP_CRYPT_PASSWORD
+ y2mil("password:" << pwd);
+#endif
+
+ VolIterator vol;
+ if (readonly())
+ {
+ ret = STORAGE_CHANGE_READONLY;
+ }
+ else
+ {
+ ProcPart ppart;
+ LoopCo* co = new LoopCo(this, false, ppart);
+ if( co )
+ {
+ Loop* loop = new Loop( *co, file, true, 0, true );
+ if( loop && loop->setCryptPwd( pwd )==0 &&
+ loop->detectEncryption()!=ENC_UNKNOWN )
+ ret = 0;
+ if( loop )
+ delete loop;
+ delete co;
+ }
+ }
+ y2mil("ret:" << ret);
+ return( ret );
+ }
+
+int
Storage::changeMkfsOptVolume( const string& device, const string& opts )
{
int ret = 0;
@@ -2637,6 +2675,8 @@
{
ret = STORAGE_VOLUME_NOT_FOUND;
}
+ if( !val )
+ pwdBuf.erase(device);
if( ret==0 )
{
ret = checkCache();
@@ -2666,7 +2706,7 @@
}
int
-Storage::setCryptPassword( const string& device, const string& pwd )
+Storage::verifyCryptPassword( const string& device, const string& pwd )
{
int ret = 0;
assertInit();
@@ -2683,10 +2723,43 @@
else if( findVolume( device, vol ) )
{
ret = vol->setCryptPwd( pwd );
+ if( ret==0 && vol->detectEncryption()==ENC_UNKNOWN )
+ ret = VOLUME_CRYPT_NOT_DETECTED;
+ vol->clearCryptPwd();
}
else
{
- ret = STORAGE_VOLUME_NOT_FOUND;
+ ret = verifyCryptFilePassword( device, pwd );
+ }
+ y2mil("ret:" << ret);
+ return( ret );
+ }
+
+int
+Storage::setCryptPassword( const string& device, const string& pwd )
+ {
+ int ret = 0;
+ assertInit();
+ y2mil("device:" << device << " l:" << pwd.length());
+#ifdef DEBUG_LOOP_CRYPT_PASSWORD
+ y2mil("password:" << pwd);
+#endif
+
+ VolIterator vol;
+ map<string,string>::iterator i = pwdBuf.find(device);
+ if (readonly())
+ {
+ ret = STORAGE_CHANGE_READONLY;
+ }
+ else if( findVolume( device, vol ) )
+ {
+ ret = vol->setCryptPwd( pwd );
+ if( i!=pwdBuf.end() )
+ pwdBuf.erase(i);
+ }
+ else
+ {
+ mapInsertOrReplace( pwdBuf, device, pwd );
}
if( ret==0 )
{
@@ -2714,11 +2787,45 @@
}
else
{
- ret = STORAGE_VOLUME_NOT_FOUND;
+ map<string,string>::iterator i = pwdBuf.find(device);
+ if( i!=pwdBuf.end() )
+ pwdBuf.erase(i);
+ else
+ ret = STORAGE_VOLUME_NOT_FOUND;
}
- if( ret==0 )
+ y2mil("ret:" << ret);
+ return( ret );
+ }
+
+bool
+Storage::needCryptPassword( const string& device )
+ {
+ bool ret = true;
+ bool volFound = false;
+ assertInit();
+ y2mil("device:" << device);
+
+ VolIterator vol;
+ if( checkNormalFile(device) )
{
- ret = checkCache();
+ ConstLoopPair p = loopPair(Loop::notDeleted);
+ ConstLoopIterator i = p.begin();
+ while( i != p.end() && i->loopFile()!=device )
+ ++i;
+ if( i != p.end() )
+ {
+ ret = i->needCryptPwd();
+ volFound = true;
+ }
+ }
+ else if( findVolume( device, vol ) )
+ {
+ ret = vol->needCryptPwd();
+ volFound = true;
+ }
+ if( !volFound )
+ {
+ ret = pwdBuf.find( device )==pwdBuf.end();
}
y2mil("ret:" << ret);
return( ret );
@@ -2739,11 +2846,11 @@
}
else
{
- ret = STORAGE_VOLUME_NOT_FOUND;
- }
- if( ret==0 )
- {
- ret = checkCache();
+ map<string,string>::const_iterator i = pwdBuf.find(device);
+ if( i!=pwdBuf.end() )
+ pwd = i->second;
+ else
+ ret = STORAGE_VOLUME_NOT_FOUND;
}
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
y2milestone( "password:%s", pwd.c_str() );
@@ -3066,6 +3173,8 @@
else if( i != lvgEnd() )
{
ret = i->createLv( name, sizeM*1024, stripe, device );
+ if( ret==0 )
+ checkPwdBuf( device );
}
else
{
@@ -3309,6 +3418,8 @@
list<string> d;
d.insert( d.end(), devs.begin(), devs.end() );
ret = md->createMd( num, rtype, d );
+ if( ret==0 )
+ checkPwdBuf( Md::mdDevice(num) );
}
if( !have_md )
{
@@ -3353,6 +3464,8 @@
list<string> d;
d.insert( d.end(), devs.begin(), devs.end() );
ret = md->createMd( num, rtype, d );
+ if( ret==0 )
+ checkPwdBuf( Md::mdDevice(num) );
}
if( !have_md )
{
@@ -6414,6 +6527,20 @@
}
}
+void Storage::checkPwdBuf( const string& device )
+ {
+ if( !pwdBuf.empty() )
+ {
+ map<string,string>::iterator i=pwdBuf.find(device);
+ if( i!=pwdBuf.end() )
+ {
+ VolIterator vol;
+ if( findVolume( device, vol ) )
+ vol->setCryptPwd( i->second );
+ pwdBuf.erase(i);
+ }
+ }
+ }
int
Storage::zeroDevice(const string& device, unsigned long long sizeK, bool random,
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Storage.h Tue Dec 22 17:57:36 2009
@@ -382,6 +382,9 @@
int addFstabOptions( const string&, const string& options );
int removeFstabOptions( const string&, const string& options );
int setCryptPassword( const string& device, const string& pwd );
+ int verifyCryptPassword( const string& device, const string& pwd );
+ int verifyCryptFilePassword( const string& file, const string& pwd );
+ bool needCryptPassword( const string& device );
int forgetCryptPassword( const string& device );
int getCryptPassword( const string& device, string& pwd );
int setCrypt( const string& device, bool val );
@@ -1875,6 +1878,7 @@
bool also_del=false );
bool findContainer( const string& device, ContIterator& c );
+ void checkPwdBuf( const string& device );
bool haveMd( MdCo*& md );
bool haveDm(DmCo*& dm);
bool haveNfs( NfsCo*& co );
@@ -1935,6 +1939,7 @@
string extendedError;
std::map<string,CCont> backups;
std::map<string,FreeInfo> freeInfo;
+ std::map<string,string> pwdBuf;
std::list<std::pair<string,string> > infoPopupTxts;
};
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageInterface.h Tue Dec 22 17:57:36 2009
@@ -1396,6 +1396,22 @@
virtual int getCryptPassword( const string& device, string& pwd ) = 0;
/**
+ * Verify password of a volume
+ *
+ * @param device name of volume, e.g. /dev/hda1
+ * @param pwd crypt password for this volume
+ * @return zero if password is ok, a negative number to indicate an error
+ */
+ virtual int verifyCryptPassword( const string& device, const string& pwd ) = 0;
+ /**
+ * Check if crypt password is required
+ *
+ * @param device name of volume, e.g. /dev/hda1
+ * @return true if password is required, false otherwise
+ */
+ virtual bool needCryptPassword( const string& device ) = 0;
+
+ /**
* Set encryption state of a volume
*
* @param device name of volume, e.g. /dev/hda1
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageTmpl.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageTmpl.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/StorageTmpl.h Tue Dec 22 17:57:36 2009
@@ -144,6 +144,16 @@
l.insert( i, e );
}
+template<typename Map, typename Key, typename Value>
+typename Map::iterator mapInsertOrReplace(Map& m, const Key& k, const Value& v)
+ {
+ typename Map::iterator pos = m.lower_bound(k);
+ if (pos != m.end() && !typename Map::key_compare()(k, pos->first))
+ pos->second = v;
+ else
+ pos = m.insert(pos, typename Map::value_type(k, v));
+ return pos;
+ }
template<class Num> string decString(Num number)
{
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.cc Tue Dec 22 17:57:36 2009
@@ -308,7 +308,7 @@
classic(file);
file.read( buf, sizeof(buf) );
if( file.good() && strncmp( buf, "LUKS", 4 )==0 )
- setEncryption( ENC_LUKS );
+ initEncryption( ENC_LUKS );
file.close();
}
}
@@ -1006,6 +1006,8 @@
int Volume::cryptUnsetup( bool force )
{
int ret=0;
+ y2mil( "force:" << force << " active:" << dmcrypt_active <<
+ " table:" << dmcrypt_dev );
if( dmcrypt_active || force )
{
string table = dmcrypt_dev;
@@ -1342,13 +1344,22 @@
{
is_loop = false;
encryption = ENC_NONE;
- dmcrypt_dev.clear();
crypt_pwd.erase();
+ orig_crypt_pwd.erase();
}
else
{
- if( !loop_active && !isTmpCryptMp(mp) && crypt_pwd.empty() )
- ret = VOLUME_CRYPT_NO_PWD;
+ if( !isTmpCryptMp(mp) )
+ {
+ if( !dmcrypt_active && crypt_pwd.empty() )
+ ret = VOLUME_CRYPT_NO_PWD;
+ if( ret==0 && !dmcrypt_active &&
+ !pwdLengthOk(typ,crypt_pwd,format) )
+ {
+ ret = VOLUME_CRYPT_PWD_TOO_SHORT;
+ clearCryptPwd();
+ }
+ }
if( ret == 0 && cType()==NFSC )
ret = VOLUME_CRYPT_NFS_IMPOSSIBLE;
if (ret == 0 && (create || format || loop_active || mp.empty()))
@@ -1607,6 +1618,26 @@
return( cmd );
}
+bool Volume::pwdLengthOk( storage::EncryptType typ, const string& val,
+ bool fmt ) const
+ {
+ bool ret = true;
+ if( fmt )
+ {
+ ret = val.size()>=8;
+ }
+ else
+ {
+ if( typ==ENC_TWOFISH_OLD )
+ ret = val.size()>=5;
+ else if( typ==ENC_TWOFISH || typ==ENC_TWOFISH256_OLD )
+ ret = val.size()>=8;
+ else
+ ret = val.size()>=1;
+ }
+ return( ret );
+ }
+
int
Volume::setCryptPwd( const string& val )
{
@@ -1615,18 +1646,12 @@
#endif
int ret = 0;
- if( ((encryption==ENC_UNKNOWN||encryption==ENC_TWOFISH_OLD||
- encryption==ENC_NONE) && val.size()<5) ||
- ((encryption==ENC_TWOFISH||encryption==ENC_TWOFISH256_OLD) &&
- val.size()<8) ||
- (encryption==ENC_LUKS && val.size()<1))
- {
- if( !isTmpCryptMp(mp) )
- ret = VOLUME_CRYPT_PWD_TOO_SHORT;
- }
+ if( !pwdLengthOk(encryption,val,format) && !isTmpCryptMp(mp) )
+ ret = VOLUME_CRYPT_PWD_TOO_SHORT;
else
{
- crypt_pwd=val;
+ orig_crypt_pwd = crypt_pwd;
+ crypt_pwd = val;
if( encryption==ENC_UNKNOWN )
detectEncryption();
}
@@ -1634,25 +1659,47 @@
return( ret );
}
-bool Volume::needLosetup() const
+bool
+Volume::needCryptPwd() const
{
- return( (is_loop!=loop_active) &&
- (encryption==ENC_NONE || !crypt_pwd.empty() ||
- (dmcrypt()&&cont->type()==LOOP)) );
+ bool ret = crypt_pwd.empty();
+ if( ret && is_loop )
+ ret = ret && !loop_active;
+ if( ret && dmcrypt() )
+ ret = ret && !dmcrypt_active;
+ y2mil("ret:" << ret);
+ return( ret );
}
-bool Volume::needCryptsetup() const
+bool Volume::needLosetup( bool urgent ) const
{
- if (dmcrypt() && encryption != orig_encryption)
- return true;
+ bool ret = (is_loop!=loop_active) &&
+ (encryption==ENC_NONE || !crypt_pwd.empty() ||
+ (dmcrypt() && cType() == LOOP));
+ if( !urgent && loop_dev.empty() )
+ ret = false;
+ if( is_loop && encryption!=ENC_NONE &&
+ !crypt_pwd.empty() && crypt_pwd!=orig_crypt_pwd )
+ ret = true;
+ return( ret );
+ }
- return( dmcrypt()!=dmcrypt_active &&
- (encryption==ENC_NONE || !crypt_pwd.empty() || isTmpCryptMp(mp)));
+bool Volume::needCryptsetup() const
+ {
+ bool ret = (dmcrypt()!=dmcrypt_active) &&
+ (encryption==ENC_NONE || encryption!=orig_encryption ||
+ !crypt_pwd.empty() || isTmpCryptMp(mp));
+ if( dmcrypt() && encryption!=ENC_NONE &&
+ !crypt_pwd.empty() && crypt_pwd!=orig_crypt_pwd )
+ ret = true;
+ y2mil( "vol:" << *this );
+ y2mil( "ret:" << ret );
+ return( ret );
}
-bool Volume::needCrsetup() const
+bool Volume::needCrsetup( bool urgent ) const
{
- return( needLosetup()||needCryptsetup() );
+ return( needLosetup(urgent)||needCryptsetup() );
}
bool Volume::needFstabUpdate() const
@@ -1758,12 +1805,15 @@
{
is_loop = cont->type()==LOOP;
ret = encryption = orig_encryption = try_order[pos];
+ orig_crypt_pwd = crypt_pwd;
}
else
{
is_loop = false;
dmcrypt_dev.erase();
loop_dev.erase();
+ crypt_pwd.erase();
+ orig_crypt_pwd.erase();
ret = encryption = orig_encryption = ENC_UNKNOWN;
}
unlink( fname.c_str() );
@@ -1807,6 +1857,8 @@
SystemCmd c( getLosetupCmd( encryption, fname ));
if( c.retcode()!=0 )
ret = VOLUME_LOSETUP_FAILED;
+ else
+ orig_crypt_pwd = crypt_pwd;
if( !fname.empty() )
{
unlink( fname.c_str() );
@@ -1934,6 +1986,8 @@
ret = VOLUME_CRYPTSETUP_FAILED;
}
}
+ if( ret==0 )
+ orig_crypt_pwd = crypt_pwd;
unlink( fname.c_str() );
rmdir( cont->getStorage()->tmpDir().c_str() );
cont->getStorage()->waitForDevice( dmcrypt_dev );
@@ -1973,7 +2027,7 @@
{
int ret = 0;
bool losetup_done = false;
- if( needLosetup() )
+ if( needLosetup(true) )
{
ret = doLosetup();
losetup_done = ret==0;
@@ -2300,7 +2354,7 @@
l.push_back( new commitAction( FORMAT, cont->type(),
formatText(false), this, true ));
}
- else if ( encryption != ENC_NONE )
+ else if ( needCrsetup(false) )
{
l.push_back(new commitAction(mp.empty()?INCREASE:FORMAT, cont->type(),
crsetupText(false), this, mp.empty()));
@@ -2486,7 +2540,7 @@
changed = true;
che.dentry = de;
}
- if( fs != detected_fs )
+ if( fs != detected_fs || che.fs!=fs_names[fs] )
{
changed = true;
che.fs = fs_names[fs];
@@ -2806,6 +2860,9 @@
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
if( is_loop && encryption!=ENC_NONE && !crypt_pwd.empty() )
file << " pwd:" << crypt_pwd;
+ if( is_loop && encryption!=ENC_NONE && !orig_crypt_pwd.empty() &&
+ orig_crypt_pwd!=crypt_pwd )
+ file << " orig_pwd:" << orig_crypt_pwd;
#endif
file << endl;
return( file );
@@ -2847,7 +2904,7 @@
encryption = orig_encryption = toEncType(i->second);
i = m.find( "pwd" );
if( i!=m.end() )
- crypt_pwd = i->second;
+ orig_crypt_pwd = crypt_pwd = i->second;
}
namespace storage
@@ -2944,6 +3001,8 @@
s << " orig_encr:" << v.enc_names[v.orig_encryption];
#ifdef DEBUG_LOOP_CRYPT_PASSWORD
s << " pwd:" << v.crypt_pwd;
+ if( v.orig_crypt_pwd.empty() && v.crypt_pwd!=v.orig_crypt_pwd )
+ s << " orig_pwd:" << v.orig_crypt_pwd;
#endif
}
if( !v.dmcrypt_dev.empty() )
@@ -3145,6 +3204,7 @@
loop_dev = rhs.loop_dev;
fstab_loop_dev = rhs.fstab_loop_dev;
crypt_pwd = rhs.crypt_pwd;
+ orig_crypt_pwd = rhs.orig_crypt_pwd;
uby = rhs.uby;
alt_names = rhs.alt_names;
return( *this );
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.h (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/src/Volume.h Tue Dec 22 17:57:36 2009
@@ -92,19 +92,20 @@
bool dmcrypt() const { return encryption != ENC_NONE && encryption != ENC_UNKNOWN; }
bool loopActive() const { return( is_loop&&loop_active ); }
bool dmcryptActive() const { return( dmcrypt()&&dmcrypt_active ); }
- bool needCrsetup() const;
+ bool needCrsetup( bool urgent=true ) const;
const string& getUuid() const { return uuid; }
const string& getLabel() const { return label; }
int setLabel( const string& val );
int eraseLabel() { label.erase(); orig_label.erase(); return 0; }
bool needLabel() const { return( label!=orig_label ); }
storage::EncryptType getEncryption() const { return encryption; }
- void setEncryption( storage::EncryptType val=storage::ENC_LUKS )
+ void initEncryption( storage::EncryptType val=storage::ENC_LUKS )
{ encryption=orig_encryption=val; }
virtual int setEncryption(bool val, storage::EncryptType typ = storage::ENC_LUKS );
const string& getCryptPwd() const { return crypt_pwd; }
int setCryptPwd( const string& val );
- void clearCryptPwd() { crypt_pwd.erase(); }
+ void clearCryptPwd() { crypt_pwd.erase(); orig_crypt_pwd.erase(); }
+ bool needCryptPwd() const;
const string& getMount() const { return mp; }
bool hasOrigMount() const { return !orig_mp.empty(); }
bool needRemount() const;
@@ -244,12 +245,14 @@
bool getLoopFile( string& fname ) const;
void setExtError( const SystemCmd& cmd, bool serr=true );
string getDmcryptName();
- bool needLosetup() const;
+ bool needLosetup( bool urgent ) const;
bool needCryptsetup() const;
int doLosetup();
int doCryptsetup();
int loUnsetup( bool force=false );
int cryptUnsetup( bool force=false );
+ bool pwdLengthOk( storage::EncryptType typ, const string& val,
+ bool format ) const;
std::ostream& logVolume( std::ostream& file ) const;
string getLosetupCmd( storage::EncryptType, const string& pwdfile ) const;
@@ -292,6 +295,7 @@
string dmcrypt_dev;
string fstab_loop_dev;
string crypt_pwd;
+ string orig_crypt_pwd;
string nm;
std::list<string> alt_names;
unsigned num;
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/fstab1.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/fstab1.cc (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/fstab1.cc Tue Dec 22 17:57:36 2009
@@ -105,10 +105,15 @@
bool val = false;
+ cout << s->changeFormatVolume("/dev/hda1", true, EXT3 ) << '\n';
cout << s->setCryptPassword ("/dev/hda1", "test") << '\n'; // FAILS
-
cout << s->setCrypt ("/dev/hda1", true) << '\n'; // FAILS
+ cout << s->changeFormatVolume("/dev/hda1", false, EXT3 ) << '\n';
+ cout << s->setCryptPassword("/dev/hda1", "test") << '\n';
+ cout << s->setCrypt("/dev/hda1", true) << '\n';
+
+ cout << s->changeFormatVolume("/dev/hda1", true, EXT3 ) << '\n';
cout << s->setCryptPassword ("/dev/hda1", "hello-world") << '\n';
cout << s->setCrypt ("/dev/hda1", true) << '\n';
Modified: branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/single.out/fstab1.out
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/single.out/fstab1.out (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/libstorage/testsuite/single.out/fstab1.out Tue Dec 22 17:57:36 2009
@@ -35,11 +35,16 @@
0
user_xattr,noauto
crypt1
+0
-3015
-3014
0
0
0
+0
+0
+0
+0
1
0
0
Modified: branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/package/yast2-storage.changes Tue Dec 22 17:57:36 2009
@@ -1,4 +1,20 @@
-------------------------------------------------------------------
+Mon Dec 21 13:03:03 CET 2009 - fehr(a)suse.de
+
+- backported crypt related fixes from HEAD
+ fix detection of encrypted swap and temp filesystems (bnc#435337)
+ fix various bugs handling encrypted devices
+ fix handling of inactive swap file entry in fstab (bnc#504497)
+ do some changes in handling of encrypted passwords (bnc#466196, bnc#480739)
+ use "crypt" fstab entry when "user" is set, not any more when "noauto" set
+ add capability to verify passwords of file based loop devices (bnc#467987)
+ check crypt password different depending on format flag
+ fix detection of existing file based loop devices
+ fix edit mode for existing file based loop devices (bnc#480736)
+ get rid of ClassifiedSettings in Storage.ycp
+ make removal of loop based files work again (bnc#480738)
+
+-------------------------------------------------------------------
Thu Dec 17 10:48:33 CET 2009 - aschnell(a)suse.de
- fixed BIOS ID for MDs (bnc #565222)
@@ -11,14 +27,14 @@
-------------------------------------------------------------------
Thu Dec 10 17:58:03 CET 2009 - aschnell(a)suse.de
-- run swapon with --fixpgsz (see bnc #433028) (requires util-linux
+- run swapon with --fixpgsz (see bnc#433028) (requires util-linux
2.16)
-------------------------------------------------------------------
Thu Dec 03 10:38:39 CET 2009 - fehr(a)suse.de
- avoid data loss on encrypted partitions using non-LUKS encryption
- when integrating them into system (#557607)
+ when integrating them into system (bnc #557607)
- 2.17.86
-------------------------------------------------------------------
Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/custom_part_lib.ycp Tue Dec 22 17:57:36 2009
@@ -626,8 +626,6 @@
ret["ok"] = Storage::SetCryptPwd( dev, fs_passwd ) &&
(new["format"]:false ||
Storage::SetCrypt( dev, true, new["format"]:false ));
- if( ret["ok"]:false && new["type"]:`unknown == `loop )
- Storage::UpdateClassified( new["fpath"]:"", fs_passwd );
if( popup )
UI::CloseDialog();
}
Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/do_proposal_flexible.ycp Tue Dec 22 17:57:36 2009
@@ -183,7 +183,7 @@
if (contains(devices, part_device))
{
partition["enc_type"] = `luks;
- Storage::UpdateClassified(part_device, Storage::ProposalPassword());
+ Storage::SetCryptPwd(part_device, Storage::ProposalPassword());
}
return partition;
});
Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-dialogs.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/include/ep-dialogs.ycp Tue Dec 22 17:57:36 2009
@@ -71,15 +71,13 @@
boolean AskPassword()
{
- if (!NeedPassword())
- return false;
-
- // TODO: this is ugly
- string key = (data["type"]:`unknown != `loop) ? (data["device"]:"error") : (data["fpath"]:"error");
- if (Storage::HasClassified(key))
- return false;
-
- return true;
+ boolean ret = NeedPassword();
+ if( ret && !do_format && size(data["mount"]:"")>0 )
+ {
+ string key = (data["type"]:`unknown != `loop) ? (data["device"]:"error") : (data["fpath"]:"error");
+ ret = Storage::NeedCryptPwd(key);
+ }
+ return ret;
}
@@ -488,6 +486,8 @@
UI::ChangeWidget(`id(`pw1), `Value, "");
UI::ChangeWidget(`id(`pw2), `Value, "");
+ string dev = (data["type"]:`unknown != `loop) ? data["device"]:""
+ : data["fpath"]:"";
repeat
{
widget = MiniWorkflow::UserInput();
@@ -496,8 +496,11 @@
{
password = (string) UI::QueryWidget(`id(`pw1), `Value);
string tmp = (string) UI::QueryWidget(`id(`pw2), `Value);
+ boolean need_verify = !data["format"]:false &&
+ size(data["mount"]:"")>0;
- if (!Storage::CheckEncryptionPasswords(password, tmp, min_pw_len, empty_pw_allowed))
+ if (!Storage::CheckEncryptionPasswords(password, tmp, min_pw_len, empty_pw_allowed) ||
+ (need_verify && !Storage::CheckCryptOk(dev, password)) )
{
UI::SetFocus(`id(`pw1) );
widget = `again;
@@ -508,10 +511,7 @@
if (widget == `next)
{
- if (data["type"]:`unknown != `loop)
- Storage::UpdateClassified(data["device"]:"", password);
- else
- Storage::UpdateClassified(data["fpath"]:"", password);
+ Storage::SetCryptPwd(dev, password);
widget = `finish;
}
Modified: branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/stora…
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp (original)
+++ branches/SuSE-Code-11-SP1-Branch/storage/storage/src/modules/Storage.ycp Tue Dec 22 17:57:36 2009
@@ -72,9 +72,6 @@
import "LibStorage::Environment";
-global void UpdateClassified(string key, string pwd);
-
-
map<string,any> conv_ctype =
$[ "def_sym" : `CT_UNKNOWN,
"def_int" : LibStorage::CUNKNOWN(),
@@ -169,7 +166,6 @@
map DiskMapVersion = $[];
map DiskMap = $[];
-map<string, string> ClassifiedSettings = $[];
map type_order = $[ `CT_DISK : 0, `CT_MD : 1, `CT_MDPART : 2, `CT_DMRAID : 3,
`CT_DMMULTIPATH : 4, `CT_LOOP : 5, `CT_DM : 6, `CT_LVM : 7,
`CT_NFS : 8 ];
@@ -753,6 +749,12 @@
``(p["device"]:""==device ));
pa = part[0]:$[];
}
+ if( size(pa)==0 && search(device, "/dev/mapper/")==0 )
+ {
+ part = filter( map p, tg["/dev/loop","partitions"]:[],
+ ``(p["device"]:""==device ));
+ pa = part[0]:$[];
+ }
if( size(pa)>0 )
ret = add( ret, pa );
});
@@ -2716,21 +2718,6 @@
else
y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
}
- if( ret==0 &&
- part["enc_type"]:`none != `none && haskey( ClassifiedSettings, dev ) )
- {
- changed = true;
- if( size(ClassifiedSettings[dev]:"")>0 )
- {
- string pwd = ClassifiedSettings[dev]:"";
- ret = LibStorage::StorageInterface::setCryptPassword( sint, dev,
- pwd );
- if( ret<0 )
- y2error( "ChangeVolumeProperties sint ret:%1", ret );
- else
- y2milestone( "ChangeVolumeProperties sint ret:%1", ret );
- }
- }
if( ret==0 && part["enc_type"]:`none != curr["enc_type"]:`none )
{
changed = true;
@@ -3075,23 +3062,52 @@
return ret;
}
+global string GetCryptPwd( string device )
+ {
+ string pwd="";
+ y2milestone( "GetCryptPwd device:%1", device );
+ integer ret = 0;
+ ret = LibStorage::StorageInterface::getCryptPassword( sint, device, pwd );
+ if( ret<0 )
+ y2error( "GetCryptPwd sint ret:%1", ret );
+ else
+ y2milestone( "GetCryptPwd empty:%1", size(pwd)==0 );
+ return( pwd );
+ }
+
+global boolean SetCryptPwd( string device, string pwd )
+ {
+ y2milestone( "SetCryptPwd device:%1", device );
+ integer ret = 0;
+ ret = LibStorage::StorageInterface::setCryptPassword( sint, device, pwd );
+ if( ret<0 )
+ y2error( "SetCryptPwd sint ret:%1", ret );
+ else
+ y2milestone( "SetCryptPwd sint ret:%1", ret );
+ return( ret==0 );
+ }
+
+global boolean NeedCryptPwd( string device )
+ {
+ boolean ret = false;
+ ret = LibStorage::StorageInterface::needCryptPassword( sint, device );
+ y2milestone( "NeedCryptPwd device:%1 ret:%2", device, ret );
+ return( ret );
+ }
+
global string CreateLoop( string file, boolean create, integer sizeK,
string mp )
{
y2milestone( "CreateLoop file:%1 create:%2 sizeK:%3 mp:%4", file, create,
sizeK, mp );
string dev = "";
- integer ret = -9999;
- if( haskey( ClassifiedSettings, file ))
- {
- string pwd = ClassifiedSettings[file]:"";
- ret = LibStorage::StorageInterface::createFileLoop( sint, file, !create,
- sizeK, mp, pwd,
- dev );
- UpdateClassified(dev, pwd);
- }
+ integer ret = 0;
+ string pwd = GetCryptPwd( file );
+ ret = LibStorage::StorageInterface::createFileLoop( sint, file, !create,
+ sizeK, mp, pwd, dev );
if( ret<0 )
y2error( "CreateLoop sint ret:%1", ret );
+ LibStorage::StorageInterface::forgetCryptPassword( sint, file );
UpdateTargetMapDisk( "/dev/loop" );
y2milestone( "CreateLoop dev:%1", dev );
return( dev );
@@ -3121,17 +3137,9 @@
global void UpdateClassified( string key, string pwd )
{
- ClassifiedSettings[key] = pwd;
- //y2milestone( "ClassifiedSettings %1", ClassifiedSettings );
+ LibStorage::StorageInterface::setCryptPassword( sint, key, pwd );
}
-
-global boolean HasClassified(string key)
-{
- return haskey(ClassifiedSettings, key);
-}
-
-
define void HandleModulesOnBoot( map<string,map> targetMap );
global boolean UpdateLoop( string dev, string file, boolean create,
@@ -3161,43 +3169,6 @@
return( ret==0 );
}
-global string GetCryptPwd( string device )
- {
- string pwd="";
- y2milestone( "GetCryptPwd device:%1", device );
- if( size(ClassifiedSettings[device]:"")>0 )
- pwd = ClassifiedSettings[device]:"";
- else
- {
- integer ret = 0;
- ret = LibStorage::StorageInterface::getCryptPassword( sint, device,
- pwd );
- if( ret<0 )
- y2error( "GetCryptPwd sint ret:%1", ret );
- }
- y2milestone( "GetCryptPwd empty:%1", size(pwd)==0 );
- return( pwd );
- }
-
-global boolean SetCryptPwd( string device, string pwd )
- {
- y2milestone( "SetCryptPwd device:%1", device );
- integer ret = LibStorage::StorageInterface::setCryptPassword( sint, device,
- pwd );
- y2milestone( "SetCryptPwd sint ret:%1", ret );
- map p = GetPartition( GetTargetMap(), device );
- if( ret==LibStorage::STORAGE_VOLUME_NOT_FOUND() || p["create"]:false )
- {
- ClassifiedSettings[device] = pwd;
- y2milestone( "setting classified %1 pwd size %2", device, size(pwd) );
- ret = 0;
- }
- else if( ret<0 )
- y2error( "SetCryptPwd sint ret:%1", ret );
- return( ret==0 );
- }
-
-
global string DefaultDiskLabel(integer size_k)
{
y2milestone("DefaultDiskLabel size_k:%1", size_k );
@@ -3814,7 +3785,6 @@
integer ret = LibStorage::StorageInterface::commit( sint );
if( ret<0 )
y2error( "CommitChanges sint ret:%1", ret );
- ClassifiedSettings = $[];
return( ret );
}
@@ -6733,5 +6703,20 @@
return true;
}
+global boolean CheckCryptOk( string dev, string fs_passwd )
+ {
+ integer i = LibStorage::StorageInterface::verifyCryptPassword( sint, dev, fs_passwd );
+ if( i!=0 )
+ Popup::Error( sformat(_("Could not set encryption.
+System error code is %1.
+
+The crypt password provided could be incorrect.
+"), i ));
+ y2milestone( "CheckCryptOk dev:%1 pwlen:%2 ret:%3",
+ dev, size(fs_passwd), i==0 );
+ return( i==0 );
+ }
+
}
+
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
ref: refs/heads/master
commit 3608d56794d894b9ddcd5b5aae819b719de83df7
Author: Stefan Schubert <schubi(a)suse.de>
Date: Tue Dec 22 17:07:47 2009 +0100
cleanuped exceptions
---
.../status/app/controllers/metrics_controller.rb | 14 ++++++--------
plugins/status/app/models/metric.rb | 2 +-
2 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/plugins/status/app/controllers/metrics_controller.rb b/plugins/status/app/controllers/metrics_controller.rb
index 719b6ee..8adfbfe 100644
--- a/plugins/status/app/controllers/metrics_controller.rb
+++ b/plugins/status/app/controllers/metrics_controller.rb
@@ -17,6 +17,8 @@ require 'uri'
class MetricsController < ApplicationController
before_filter :login_required
+ DEFAULT_TIMEFRAME=300
+
private
def create_limit(status, label = "", limits = {})
@@ -91,13 +93,9 @@ class MetricsController < ApplicationController
# GET /status/1.xml
def show
#permission_check("org.opensuse.yast.system.status.read")
- begin
- @metric = Metric.find(params[:id])
- @stop = params[:stop].blank? ? Time.now : Time.at(params[:stop].to_i)
- @start = params[:start].blank? ? @stop - 300 : Time.at(params[:start].to_i)
- @data = true
- rescue Exception => e
- render ErrorResult.error(400, 108, e.to_s) and return
- end
+ @metric = Metric.find(params[:id])
+ @stop = params[:stop].blank? ? Time.now : Time.at(params[:stop].to_i)
+ @start = params[:start].blank? ? @stop - DEFAULT_TIMEFRAME : Time.at(params[:start].to_i)
+ @data = true
end
end
diff --git a/plugins/status/app/models/metric.rb b/plugins/status/app/models/metric.rb
index 91d209d..556eefb 100644
--- a/plugins/status/app/models/metric.rb
+++ b/plugins/status/app/models/metric.rb
@@ -211,7 +211,7 @@ class Metric
matched = true
# match each attribute passed in opts
opts.each do |key, val|
- raise "Unknown attribute #{key}" if not metric.respond_to?(key)
+ raise InvalidParameters.new :key => key if not metric.respond_to?(key)
# if the val is a regexp we do different matching
if val.is_a?(Regexp)
matched = false if not metric.send(key) =~ val
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] <web-client> jr-yastmodel : clean systemtime plugin to demonstrate yast model
by Josef Reidinger 22 Dec '09
by Josef Reidinger 22 Dec '09
22 Dec '09
ref: refs/heads/jr-yastmodel
commit 8bc8ec72d19a55340b8b15af37d18bb92eaf5f66
Author: Josef Reidinger <jreidinger(a)suse.cz>
Date: Tue Dec 22 16:36:06 2009 +0100
clean systemtime plugin to demonstrate yast model
rewrite test to use http mock
create ntp model
move functionality from lib and controller to time model
TODO: create tests for models
---
.../app/controllers/systemtime_controller.rb | 91 +-
plugins/systemtime/app/models/ntp.rb | 10 +
plugins/systemtime/app/models/stime.rb | 4 -
plugins/systemtime/app/models/systemtime.rb | 34 +
.../systemtime/app/views/systemtime/index.rhtml | 196 +-
plugins/systemtime/lib/systemtime.rb | 16 -
plugins/systemtime/test/fixtures/ntp.xml | 6 +
plugins/systemtime/test/fixtures/success.xml | 2064 ++++++++++++++++++++
.../test/functional/systemtime_controller_test.rb | 129 +--
webclient/lib/yast_model/base.rb | 4 +-
10 files changed, 2258 insertions(+), 296 deletions(-)
diff --git a/plugins/systemtime/app/controllers/systemtime_controller.rb b/plugins/systemtime/app/controllers/systemtime_controller.rb
index 7fff4aa..ffaf698 100644
--- a/plugins/systemtime/app/controllers/systemtime_controller.rb
+++ b/plugins/systemtime/app/controllers/systemtime_controller.rb
@@ -11,40 +11,21 @@ require 'systemtime'
class SystemtimeController < ApplicationController
before_filter :login_required
layout 'main'
- include ProxyLoader
#helpers
private
- # Fills @+valid+ field that represents valid regions with informations from
- # @+timezone+ field.
- def fill_valid_timezones
- @valid = @@timezones.collect { |region| region.name }
- end
-
- # Fills current region name in field @+region+. Requires filled @+timezones+
- # and @+timezone+ fields
- # throws:: Exception if current timezone is not in any known region. @+region+
- # field in this case is +nil+.
- def fill_current_region
- @region = @@timezones.find { |region|
- region.entries.find { |entry| entry.id==@timezone } }
- raise _("Unknown timezone %s on host") % @timezone unless @region
- end
-
- def clear_time(proxy)
- proxy.time = ""
- proxy.date = ""
- end
-
def available_ntp
begin
- ntp = load_proxy 'org.opensuse.yast.modules.yapi.ntp'
+ unless Ntp.permissions[:available] && Ntp.permissions[:synchronize]
+ logger.info "ntp doesn't have permissions available : #{Ntp.permissions[:available]} synchronize: #{Ntp.permissions[:synchronize]}"
+ return false
+ end
+ ntp = Ntp.find :one
rescue Exception => e #available call, so don't show anything, just log
logger.warn e
return false
end
- return false unless ntp
- return ntp.respond_to? :synchronize
+ return ntp.available?
end
public
@@ -64,22 +45,9 @@ class SystemtimeController < ApplicationController
# fields is filled. In case of errors redirect to help page, main page or just
# show flash with partial problem.
def index
- @ntp = available_ntp
- systemtime = Stime.find :one
- @permissions = Stime.permissions
- @@timezones = systemtime.timezones
- @timezone = systemtime.timezone
- @utcstatus = systemtime.utcstatus
- @time = systemtime.time
- @date = systemtime.date
- fill_valid_timezones
- begin
- fill_current_region
- rescue Exception => e
- flash[:warning] = e.message
- logger.warn e
- redirect_to root_path
- end
+ @ntp_available = available_ntp
+ @stime = Systemtime.find :one
+ @permissions = Systemtime.permissions
end
# Update time handler. Sets to backend new timezone and time.
@@ -87,18 +55,16 @@ class SystemtimeController < ApplicationController
# still shows problems. Now it invalidate session for logged user.If
# everything goes fine it redirect to index
def update
- t = Stime.find :one
-
- fill_proxy_with_timezone t, params, t.timezones
- clear_time t #do nothing
+ t = Systemtime.find :one
+ t.load_timezone params
+ t.clear_time #do not set time by default
case params[:timeconfig]
when "manual"
- fill_proxy_with_time t,params
+ t.load_time params
when "ntp_sync"
- ntp = load_proxy 'org.opensuse.yast.modules.yapi.ntp'
- return false unless ntp
- ntp.synchronize = true
- ntp.synchronize_utc = (t.utcstatus=="UTC")
+ ntp = Ntp.find :one
+ ntp.actions.synchronize = true
+ ntp.actions.synchronize_utc = (t.utcstatus=="UTC")
begin
ntp.save #FIXME check return value
rescue Timeout::Error => e
@@ -109,18 +75,17 @@ class SystemtimeController < ApplicationController
else
logger.error "Unknown value for timeconfig #{params[:timeconfig]}"
end
-
t.timezones = [] #save bandwitch
begin
- t.save
+ t.save #TODO check return value
flash[:notice] = _('Time settings have been written.')
rescue Timeout::Error => e
#do nothing as if you move time to future it throws this exception
log.debug "Time moved to future"
flash[:notice] = _('Time settings have been written.')
- end
+ end
redirect_success
end
@@ -129,20 +94,16 @@ class SystemtimeController < ApplicationController
#AJAX function that renders new timezones for selected region. Expected
# initialized values from index call.
def timezones_for_region
- if @@timezones.empty?
- # since while calling this function there is different instance of the class
- # than when calling index, @@timezones were empty; reinitialize them
- # possible FIXME: how does it increase the amount of data transferred?
- systemtime = Stime.find :one
+ #FIXME do not use AJAX use java script instead as reload of data is not needed
+ # since while calling this function there is different instance of the class
+ # than when calling index, @@timezones were empty; reinitialize them
+ # possible FIXME: how does it increase the amount of data transferred?
+ systemtime = Systemtime.find :one
- @@timezones = systemtime.timezones
- end
+ timezones = systemtime.timezones
- region = @@timezones.find { |r| r.name == params[:value] } #possible FIXME later it gets class, not a string
-
- unless region
- return false; #possible FIXME: is returnign false for AJAX correct?
- end
+ region = timezones.find { |r| r.name == params[:value] } #possible FIXME later it gets class, not a string
+ return false unless region #possible FIXME: is returnign false for AJAX correct?
render(:partial => 'timezones',
:locals => {:region => region, :default => region.central,
diff --git a/plugins/systemtime/app/models/ntp.rb b/plugins/systemtime/app/models/ntp.rb
new file mode 100644
index 0000000..5abd214
--- /dev/null
+++ b/plugins/systemtime/app/models/ntp.rb
@@ -0,0 +1,10 @@
+class Ntp < ActiveResource::Base
+ extend YastModel::Base
+ model_interface :"org.opensuse.yast.modules.yapi.ntp"
+
+ def available?
+ ret = actions.respond_to? :synchronize
+ Rails.logger.info "ntp available : #{ret}"
+ return ret
+ end
+end
diff --git a/plugins/systemtime/app/models/stime.rb b/plugins/systemtime/app/models/stime.rb
deleted file mode 100644
index 540b6b5..0000000
--- a/plugins/systemtime/app/models/stime.rb
+++ /dev/null
@@ -1,4 +0,0 @@
-class Stime < ActiveResource::Base
- extend YastModel::Base
- model_interface :"org.opensuse.yast.modules.yapi.time"
-end
diff --git a/plugins/systemtime/app/models/systemtime.rb b/plugins/systemtime/app/models/systemtime.rb
new file mode 100644
index 0000000..4cfbd8e
--- /dev/null
+++ b/plugins/systemtime/app/models/systemtime.rb
@@ -0,0 +1,34 @@
+class Systemtime < ActiveResource::Base
+ extend YastModel::Base
+ model_interface :"org.opensuse.yast.modules.yapi.time"
+
+ def region
+ reg = self.timezones.find { |region|
+ region.entries.find { |entry| entry.id==self.timezone } }
+ raise _("Unknown timezone %s on host") % timezone unless reg
+ return reg
+ end
+
+ def regions
+ return @regions if @regions
+ @regions = self.timezones.collect { |region| region.name }
+ end
+
+ def load_timezone(params)
+ treg = self.timezones.find { |reg| reg.name == params[:region] } || Hash.new
+
+ tmz = treg.entries.find { |e| e.name == params[:timezone]}
+ self.timezone = tmz.id if tmz
+ self.utcstatus = params[:utc] == "true"
+ end
+
+ def load_time(params)
+ self.date = params[:date][:date]
+ self.time = params[:currenttime]
+ end
+
+ def clear_time
+ self.date = nil
+ self.time = nil
+ end
+end
diff --git a/plugins/systemtime/app/views/systemtime/index.rhtml b/plugins/systemtime/app/views/systemtime/index.rhtml
index d2aab05..0038312 100644
--- a/plugins/systemtime/app/views/systemtime/index.rhtml
+++ b/plugins/systemtime/app/views/systemtime/index.rhtml
@@ -1,112 +1,110 @@
-<% if @permissions %>
- <% disabled = ! @permissions[:write] %>
+<% disabled = !@permissions[:write] %>
- <% content_for :head do %>
- <%= javascript_include_tag :defaults %>
- <link rel="stylesheet" href="/inc/smoothness/jquery.ui.custom.css" type="text/css" media="screen" title="default" charset="utf-8" />
+<% content_for :head do %>
+ <%= javascript_include_tag :defaults %>
+ <link rel="stylesheet" href="/inc/smoothness/jquery.ui.custom.css" type="text/css" media="screen" title="default" charset="utf-8" />
- <% javascript_tag do -%>
- $(document).ready( function() {
- $("#date_date").datepicker( { dateFormat: 'dd/mm/yy'} );
- });
- <% end -%>
+ <% javascript_tag do -%>
+ $(document).ready( function() {
+ $("#date_date").datepicker( { dateFormat: 'dd/mm/yy'} );
+ });
+ <% end -%>
- <!-- FIXME move javascript function outside of index -->
- <% javascript_tag do -%>
- function submitTime() {
- if (!$("#timeconfig_manual")[0].checked){
- return true;
- }
- if (!$("#date_date")[0].value.match( /^\d{2}\/\d{2}\/\d{4}$/)){
- alert ("<%= _("Invalid date format. Correct one is dd/mm/yyyy") %>");
- return false;
- }
- if (!$("#currenttime")[0].value.match( /^\d{2}:\d{2}:\d{2}$/)) {
- alert ("<%= _("Invalid time format. Correct one is hh:mm:ss") %>");
- return false;
- }
- $('#progress').show();
+ <!-- FIXME move javascript function outside of index -->
+ <% javascript_tag do -%>
+ function submitTime() {
+ if (!$("#timeconfig_manual")[0].checked){
return true;
- };
- <% end -%>
- <% javascript_tag do -%>
- function enable() {
- if ( !<%= disabled %> ){
- $("#date_date")[0].disabled = false;
- $("#currenttime")[0].disabled = false;
- }
- };
- function disable() {
- $("#date_date")[0].disabled = true;
- $("#currenttime")[0].disabled = true;
+ }
+ if (!$("#date_date")[0].value.match( /^\d{2}\/\d{2}\/\d{4}$/)){
+ alert ("<%= _("Invalid date format. Correct one is dd/mm/yyyy") %>");
+ return false;
+ }
+ if (!$("#currenttime")[0].value.match( /^\d{2}:\d{2}:\d{2}$/)) {
+ alert ("<%= _("Invalid time format. Correct one is hh:mm:ss") %>");
+ return false;
+ }
+ $('#progress').show();
+ return true;
+ };
+ <% end -%>
+ <% javascript_tag do -%>
+ function enable() {
+ if ( !<%= disabled %> ){
+ $("#date_date")[0].disabled = false;
+ $("#currenttime")[0].disabled = false;
}
+ };
+ function disable() {
+ $("#date_date")[0].disabled = true;
+ $("#currenttime")[0].disabled = true;
+ }
- <% end -%>
- <% end %>
-
- <div class='plugin-icon'><img src='/icons/yast-ntp-client.png' alt="time module"/><%=_("Time")%></div>
-
- <div class="plugin-content grid_12">
- <% form_tag '/systemtime/update', {:class => 'container', :onsubmit => "submitTime();"} do %>
- <% #TODO tooltip for form <div> _("Table for settings timezone for target machine.") </div>
- %>
- <fieldset id="" class="">
- <p>
- <label for="region"><%=_("Region")%></label>
- <%= select_tag "region", options_for_select(@valid, @region.name), :disabled => disabled %>
- </p>
- <p>
- <label for="timezone"><%=_("Timezone")%></label>
- <span id="timezones">
- <%= render(:partial => 'timezones',
- :locals => {:region => @region, :default => @timezone,
- :disabled => disabled}) %>
- </span>
- </p>
- <% unless @utcstatus.nil? %>
+ <% end -%>
+<% end %>
+
+<div class='plugin-icon'><img src='/icons/yast-ntp-client.png' alt="time module"/><%=_("Time")%></div>
+
+<div class="plugin-content grid_12">
+ <% form_tag '/systemtime/update', {:class => 'container', :onsubmit => "submitTime();"} do %>
+ <% #TODO tooltip for form <div> _("Table for settings timezone for target machine.") </div>
+ %>
+ <fieldset id="" class="">
<p>
- <% #don't use check_box helper as it generate also hidden opposite value
- %>
- <input type="checkbox" name="utc" id="utc" value="true"
- <%= "checked=\"checked\"" if @utcstatus %>
- <%= "disabled=\"disabled\"" if disabled %> />
- <span class="form-details"><%=_("Hardware clock is set to UTC")%></span>
+ <label for="region"><%=_("Region")%></label>
+ <%= select_tag "region", options_for_select((a)stime.regions, @stime.region.name), :disabled => disabled %>
</p>
- <% end %>
- </fieldset>
- <fieldset>
<p>
- <input type="radio" name="timeconfig" value="manual" onclick="enable();" id="timeconfig_manual"
- <%= "disabled=\"disabled\"" if disabled %>
- >
- <%=_("Manually configure time")%>
- </p>
- <% #TODO for tooltip _("Manual time configuration table, where user selects data and time for target machine")
+ <label for="timezone"><%=_("Timezone")%></label>
+ <span id="timezones">
+ <%= render(:partial => 'timezones',
+ :locals => {:region => @stime.region, :default => @stime.timezone,
+ :disabled => disabled}) %>
+ </span>
+ </p>
+ <% unless @stime.utcstatus.nil? %>
+ <p>
+ <% #don't use check_box helper as it generate also hidden opposite value
%>
- <p>
- <label for="date_date"><%= _("Date") %></label>
- <%= text_field "date","date", :disabled=> "true", :value => @date %>
- </p>
- <p>
- <label for="currenttime"><%= _("Time") %></label>
- <%= text_field_tag "currenttime", @time, :disabled=> "true"%>
- </p>
- <p>
- <input id="timeconfig" type="radio" name="timeconfig" value="ntp_sync" onclick="disable();"
- <%= "disabled=\"disabled\"" if disabled || !@ntp %>
- > <%=_("Synchronize via Network Time Protocol (NTP)")%>
- </p>
- </fieldset>
- <%= form_send_buttons :disabled => disabled, :class => "button" %>
- <% end %>
- </div>
-
+ <input type="checkbox" name="utc" id="utc" value="true"
+ <%= "checked=\"checked\"" if @stime.utcstatus %>
+ <%= "disabled=\"disabled\"" if disabled %> />
+ <span class="form-details"><%=_("Hardware clock is set to UTC")%></span>
+ </p>
+ <% end %>
+</fieldset>
+<fieldset>
+ <p>
+ <input type="radio" name="timeconfig" value="manual" onclick="enable();" id="timeconfig_manual"
+ <%= "disabled=\"disabled\"" if disabled %>
+ >
+ <%=_("Manually configure time")%>
+ </p>
+ <% #TODO for tooltip _("Manual time configuration table, where user selects data and time for target machine")
+ %>
+ <p>
+ <label for="date_date"><%= _("Date") %></label>
+ <%= text_field "date","date", :disabled=> "true", :value => @stime.date %>
+ </p>
+ <p>
+ <label for="currenttime"><%= _("Time") %></label>
+ <%= text_field_tag "currenttime", @stime.time, :disabled=> "true"%>
+ </p>
+ <p>
+ <input id="timeconfig" type="radio" name="timeconfig" value="ntp_sync" onclick="disable();"
+ <%= "disabled=\"disabled\"" if disabled || !@ntp_available %>
+ > <%=_("Synchronize via Network Time Protocol (NTP)")%>
+ </p>
+</fieldset>
+ <%= form_send_buttons :disabled => disabled, :class => "button" %>
+ <% end %>
+</div>
- <%= observe_field(:region,
- :frequency => 0.25,
- :update => :timezones,
- :url => { :action => :timezones_for_region },
- :with => "'disabled=' + "+ (disabled ? "true":"false")+" + '&value=' +value") %>
-<% end %>
+
+<%= observe_field(:region,
+ :frequency => 0.25,
+ :update => :timezones,
+ :url => { :action => :timezones_for_region },
+ :with => "'disabled=' + "+ (disabled ? "true":"false")+" + '&value=' +value") %>
diff --git a/plugins/systemtime/lib/systemtime.rb b/plugins/systemtime/lib/systemtime.rb
deleted file mode 100644
index 9fe22c3..0000000
--- a/plugins/systemtime/lib/systemtime.rb
+++ /dev/null
@@ -1,16 +0,0 @@
-# Systemtime
-
-#fills proxy with time parameters and set rest parameters to empty value
-def fill_proxy_with_time(proxy,params)
- proxy.date = params[:date][:date]
- proxy.time = params[:currenttime]
-end
-
-#fills proxy with timezone parameters and set rest parameters to empty value
-def fill_proxy_with_timezone(proxy,params,timezones)
- region = timezones.find { |reg| reg.name == params[:region] } || Hash.new
-
- tmz = region.entries.find { |e| e.name == params[:timezone]}
- proxy.timezone = tmz.id if tmz
- proxy.utcstatus = params[:utc] == "true"
-end
diff --git a/plugins/systemtime/test/fixtures/ntp.xml b/plugins/systemtime/test/fixtures/ntp.xml
new file mode 100644
index 0000000..d750e75
--- /dev/null
+++ b/plugins/systemtime/test/fixtures/ntp.xml
@@ -0,0 +1,6 @@
+<ntp>
+ <actions>
+ <synchronize_utc type="boolean">true</synchronize_utc>
+ <synchronize type="boolean">false</synchronize>
+ </actions>
+</ntp>
diff --git a/plugins/systemtime/test/fixtures/success.xml b/plugins/systemtime/test/fixtures/success.xml
new file mode 100644
index 0000000..6674d4e
--- /dev/null
+++ b/plugins/systemtime/test/fixtures/success.xml
@@ -0,0 +1,2064 @@
+<systemtime>
+ <timezones type="array">
+ <timezones>
+ <name>Africa</name>
+ <entries type="array">
+ <entries>
+ <name>Maputo</name>
+ <id>Africa/Maputo</id>
+ </entries>
+ <entries>
+ <name>Johannesburg</name>
+ <id>Africa/Johannesburg</id>
+ </entries>
+ <entries>
+ <name>Casablanca</name>
+ <id>Africa/Casablanca</id>
+ </entries>
+ <entries>
+ <name>Banjul</name>
+ <id>Africa/Banjul</id>
+ </entries>
+ <entries>
+ <name>Windhoek</name>
+ <id>Africa/Windhoek</id>
+ </entries>
+ <entries>
+ <name>Maseru</name>
+ <id>Africa/Maseru</id>
+ </entries>
+ <entries>
+ <name>Luanda</name>
+ <id>Africa/Luanda</id>
+ </entries>
+ <entries>
+ <name>Lagos</name>
+ <id>Africa/Lagos</id>
+ </entries>
+ <entries>
+ <name>Kigali</name>
+ <id>Africa/Kigali</id>
+ </entries>
+ <entries>
+ <name>Douala</name>
+ <id>Africa/Douala</id>
+ </entries>
+ <entries>
+ <name>Asmara</name>
+ <id>Africa/Asmara</id>
+ </entries>
+ <entries>
+ <name>Malabo</name>
+ <id>Africa/Malabo</id>
+ </entries>
+ <entries>
+ <name>Lusaka</name>
+ <id>Africa/Lusaka</id>
+ </entries>
+ <entries>
+ <name>Kinshasa</name>
+ <id>Africa/Kinshasa</id>
+ </entries>
+ <entries>
+ <name>El Aaiun</name>
+ <id>Africa/El_Aaiun</id>
+ </entries>
+ <entries>
+ <name>Ceuta</name>
+ <id>Africa/Ceuta</id>
+ </entries>
+ <entries>
+ <name>Nouakchott</name>
+ <id>Africa/Nouakchott</id>
+ </entries>
+ <entries>
+ <name>Lubumbashi</name>
+ <id>Africa/Lubumbashi</id>
+ </entries>
+ <entries>
+ <name>Dar es Salaam</name>
+ <id>Africa/Dar_es_Salaam</id>
+ </entries>
+ <entries>
+ <name>Dakar</name>
+ <id>Africa/Dakar</id>
+ </entries>
+ <entries>
+ <name>Reunion</name>
+ <id>Indian/Reunion</id>
+ </entries>
+ <entries>
+ <name>Ndjamena</name>
+ <id>Africa/Ndjamena</id>
+ </entries>
+ <entries>
+ <name>Mbabane</name>
+ <id>Africa/Mbabane</id>
+ </entries>
+ <entries>
+ <name>Khartoum</name>
+ <id>Africa/Khartoum</id>
+ </entries>
+ <entries>
+ <name>Addis Ababa</name>
+ <id>Africa/Addis_Ababa</id>
+ </entries>
+ <entries>
+ <name>Ouagadougou</name>
+ <id>Africa/Ouagadougou</id>
+ </entries>
+ <entries>
+ <name>Harare</name>
+ <id>Africa/Harare</id>
+ </entries>
+ <entries>
+ <name>Bissau</name>
+ <id>Africa/Bissau</id>
+ </entries>
+ <entries>
+ <name>Bangui</name>
+ <id>Africa/Bangui</id>
+ </entries>
+ <entries>
+ <name>Bamako</name>
+ <id>Africa/Bamako</id>
+ </entries>
+ <entries>
+ <name>Tunis</name>
+ <id>Africa/Tunis</id>
+ </entries>
+ <entries>
+ <name>Monrovia</name>
+ <id>Africa/Monrovia</id>
+ </entries>
+ <entries>
+ <name>Djibouti</name>
+ <id>Africa/Djibouti</id>
+ </entries>
+ <entries>
+ <name>Brazzaville</name>
+ <id>Africa/Brazzaville</id>
+ </entries>
+ <entries>
+ <name>Algiers</name>
+ <id>Africa/Algiers</id>
+ </entries>
+ <entries>
+ <name>Abidjan</name>
+ <id>Africa/Abidjan</id>
+ </entries>
+ <entries>
+ <name>Porto-Novo</name>
+ <id>Africa/Porto-Novo</id>
+ </entries>
+ <entries>
+ <name>Nairobi</name>
+ <id>Africa/Nairobi</id>
+ </entries>
+ <entries>
+ <name>Lome</name>
+ <id>Africa/Lome</id>
+ </entries>
+ <entries>
+ <name>Gaborone</name>
+ <id>Africa/Gaborone</id>
+ </entries>
+ <entries>
+ <name>Accra</name>
+ <id>Africa/Accra</id>
+ </entries>
+ <entries>
+ <name>Antananarivo</name>
+ <id>Indian/Antananarivo</id>
+ </entries>
+ <entries>
+ <name>Sao Tome</name>
+ <id>Africa/Sao_Tome</id>
+ </entries>
+ <entries>
+ <name>Libreville</name>
+ <id>Africa/Libreville</id>
+ </entries>
+ <entries>
+ <name>Freetown</name>
+ <id>Africa/Freetown</id>
+ </entries>
+ <entries>
+ <name>Bujumbura</name>
+ <id>Africa/Bujumbura</id>
+ </entries>
+ <entries>
+ <name>Tripoli</name>
+ <id>Africa/Tripoli</id>
+ </entries>
+ <entries>
+ <name>Niamey</name>
+ <id>Africa/Niamey</id>
+ </entries>
+ <entries>
+ <name>Mogadishu</name>
+ <id>Africa/Mogadishu</id>
+ </entries>
+ <entries>
+ <name>Kampala</name>
+ <id>Africa/Kampala</id>
+ </entries>
+ <entries>
+ <name>Conakry</name>
+ <id>Africa/Conakry</id>
+ </entries>
+ <entries>
+ <name>Cairo</name>
+ <id>Africa/Cairo</id>
+ </entries>
+ <entries>
+ <name>Blantyre</name>
+ <id>Africa/Blantyre</id>
+ </entries>
+ </entries>
+ <central>Africa/Kampala</central>
+ </timezones>
+ <timezones>
+ <name>Argentina</name>
+ <entries type="array">
+ <entries>
+ <name>San Juan</name>
+ <id>America/Argentina/San_Juan</id>
+ </entries>
+ <entries>
+ <name>Mendoza</name>
+ <id>America/Argentina/Mendoza</id>
+ </entries>
+ <entries>
+ <name>La Rioja</name>
+ <id>America/Argentina/La_Rioja</id>
+ </entries>
+ <entries>
+ <name>Jujuy</name>
+ <id>America/Argentina/Jujuy</id>
+ </entries>
+ <entries>
+ <name>Buenos Aires</name>
+ <id>America/Argentina/Buenos_Aires</id>
+ </entries>
+ <entries>
+ <name>Rio Gallegos</name>
+ <id>America/Argentina/Rio_Gallegos</id>
+ </entries>
+ <entries>
+ <name>Ushuaia</name>
+ <id>America/Argentina/Ushuaia</id>
+ </entries>
+ <entries>
+ <name>San Luis</name>
+ <id>America/Argentina/San_Luis</id>
+ </entries>
+ <entries>
+ <name>Cordoba</name>
+ <id>America/Argentina/Cordoba</id>
+ </entries>
+ <entries>
+ <name>Tucuman</name>
+ <id>America/Argentina/Tucuman</id>
+ </entries>
+ <entries>
+ <name>Catamarca</name>
+ <id>America/Argentina/Catamarca</id>
+ </entries>
+ </entries>
+ <central>America/Argentina/Buenos_Aires</central>
+ </timezones>
+ <timezones>
+ <name>Asia</name>
+ <entries type="array">
+ <entries>
+ <name>Yerevan</name>
+ <id>Asia/Yerevan</id>
+ </entries>
+ <entries>
+ <name>Ulan Bator</name>
+ <id>Asia/Ulaanbaatar</id>
+ </entries>
+ <entries>
+ <name>Magadan</name>
+ <id>Asia/Magadan</id>
+ </entries>
+ <entries>
+ <name>Choibalsan</name>
+ <id>Asia/Choibalsan</id>
+ </entries>
+ <entries>
+ <name>Baghdad</name>
+ <id>Asia/Baghdad</id>
+ </entries>
+ <entries>
+ <name>Mideast Riyadh87</name>
+ <id>Mideast/Riyadh87</id>
+ </entries>
+ <entries>
+ <name>Yakutsk</name>
+ <id>Asia/Yakutsk</id>
+ </entries>
+ <entries>
+ <name>Pontianak</name>
+ <id>Asia/Pontianak</id>
+ </entries>
+ <entries>
+ <name>Mideast Riyadh88</name>
+ <id>Mideast/Riyadh88</id>
+ </entries>
+ <entries>
+ <name>Dushanbe</name>
+ <id>Asia/Dushanbe</id>
+ </entries>
+ <entries>
+ <name>Singapore</name>
+ <id>Asia/Singapore</id>
+ </entries>
+ <entries>
+ <name>Mideast Riyadh89</name>
+ <id>Mideast/Riyadh89</id>
+ </entries>
+ <entries>
+ <name>Vientiane</name>
+ <id>Asia/Vientiane</id>
+ </entries>
+ <entries>
+ <name>Tehran</name>
+ <id>Asia/Tehran</id>
+ </entries>
+ <entries>
+ <name>Damascus</name>
+ <id>Asia/Damascus</id>
+ </entries>
+ <entries>
+ <name>Karachi</name>
+ <id>Asia/Karachi</id>
+ </entries>
+ <entries>
+ <name>Baku</name>
+ <id>Asia/Baku</id>
+ </entries>
+ <entries>
+ <name>Hongkong</name>
+ <id>Asia/Hong_Kong</id>
+ </entries>
+ <entries>
+ <name>Sakhalin</name>
+ <id>Asia/Sakhalin</id>
+ </entries>
+ <entries>
+ <name>Tashkent</name>
+ <id>Asia/Tashkent</id>
+ </entries>
+ <entries>
+ <name>Qatar</name>
+ <id>Asia/Qatar</id>
+ </entries>
+ <entries>
+ <name>Seoul</name>
+ <id>Asia/Seoul</id>
+ </entries>
+ <entries>
+ <name>Harbin</name>
+ <id>Asia/Harbin</id>
+ </entries>
+ <entries>
+ <name>Oral</name>
+ <id>Asia/Oral</id>
+ </entries>
+ <entries>
+ <name>Jayapura</name>
+ <id>Asia/Jayapura</id>
+ </entries>
+ <entries>
+ <name>Beijing</name>
+ <id>Asia/Beijing</id>
+ </entries>
+ <entries>
+ <name>Shanghai</name>
+ <id>Asia/Shanghai</id>
+ </entries>
+ <entries>
+ <name>Dubai</name>
+ <id>Asia/Dubai</id>
+ </entries>
+ <entries>
+ <name>Urumqi</name>
+ <id>Asia/Urumqi</id>
+ </entries>
+ <entries>
+ <name>Afghanistan</name>
+ <id>Asia/Kabul</id>
+ </entries>
+ <entries>
+ <name>Bangkok</name>
+ <id>Asia/Bangkok</id>
+ </entries>
+ <entries>
+ <name>Samarkand</name>
+ <id>Asia/Samarkand</id>
+ </entries>
+ <entries>
+ <name>Amman</name>
+ <id>Asia/Amman</id>
+ </entries>
+ <entries>
+ <name>Taipei</name>
+ <id>Asia/Taipei</id>
+ </entries>
+ <entries>
+ <name>Krasnoyarsk</name>
+ <id>Asia/Krasnoyarsk</id>
+ </entries>
+ <entries>
+ <name>Vladivostok</name>
+ <id>Asia/Vladivostok</id>
+ </entries>
+ <entries>
+ <name>Kuching</name>
+ <id>Asia/Kuching</id>
+ </entries>
+ <entries>
+ <name>Muscat</name>
+ <id>Asia/Muscat</id>
+ </entries>
+ <entries>
+ <name>Omsk</name>
+ <id>Asia/Omsk</id>
+ </entries>
+ <entries>
+ <name>Aqtau</name>
+ <id>Asia/Aqtau</id>
+ </entries>
+ <entries>
+ <name>Myanmar</name>
+ <id>Asia/Rangoon</id>
+ </entries>
+ <entries>
+ <name>Gaza</name>
+ <id>Asia/Gaza</id>
+ </entries>
+ <entries>
+ <name>Israel</name>
+ <id>Asia/Jerusalem</id>
+ </entries>
+ <entries>
+ <name>Chongqing</name>
+ <id>Asia/Chongqing</id>
+ </entries>
+ <entries>
+ <name>Brunei</name>
+ <id>Asia/Brunei</id>
+ </entries>
+ <entries>
+ <name>Qyzylorda</name>
+ <id>Asia/Qyzylorda</id>
+ </entries>
+ <entries>
+ <name>Aqtobe</name>
+ <id>Asia/Aqtobe</id>
+ </entries>
+ <entries>
+ <name>Kuwait</name>
+ <id>Asia/Kuwait</id>
+ </entries>
+ <entries>
+ <name>Kamchatka</name>
+ <id>Asia/Kamchatka</id>
+ </entries>
+ <entries>
+ <name>Colombo</name>
+ <id>Asia/Colombo</id>
+ </entries>
+ <entries>
+ <name>Riyadh</name>
+ <id>Asia/Riyadh</id>
+ </entries>
+ <entries>
+ <name>Beirut</name>
+ <id>Asia/Beirut</id>
+ </entries>
+ <entries>
+ <name>Kashgar</name>
+ <id>Asia/Kashgar</id>
+ </entries>
+ <entries>
+ <name>Almaty</name>
+ <id>Asia/Almaty</id>
+ </entries>
+ <entries>
+ <name>Thimphu</name>
+ <id>Asia/Thimphu</id>
+ </entries>
+ <entries>
+ <name>Manila</name>
+ <id>Asia/Manila</id>
+ </entries>
+ <entries>
+ <name>Macao</name>
+ <id>Asia/Macau</id>
+ </entries>
+ <entries>
+ <name>Bishkek</name>
+ <id>Asia/Bishkek</id>
+ </entries>
+ <entries>
+ <name>Ashgabat</name>
+ <id>Asia/Ashgabat</id>
+ </entries>
+ <entries>
+ <name>Nicosia</name>
+ <id>Asia/Nicosia</id>
+ </entries>
+ <entries>
+ <name>Jakarta</name>
+ <id>Asia/Jakarta</id>
+ </entries>
+ <entries>
+ <name>Makassar</name>
+ <id>Asia/Makassar</id>
+ </entries>
+ <entries>
+ <name>Phnom Penh</name>
+ <id>Asia/Phnom_Penh</id>
+ </entries>
+ <entries>
+ <name>Aden</name>
+ <id>Asia/Aden</id>
+ </entries>
+ <entries>
+ <name>Anadyr</name>
+ <id>Asia/Anadyr</id>
+ </entries>
+ <entries>
+ <name>Dhaka</name>
+ <id>Asia/Dhaka</id>
+ </entries>
+ <entries>
+ <name>Kuala Lumpur</name>
+ <id>Asia/Kuala_Lumpur</id>
+ </entries>
+ <entries>
+ <name>Irkutsk</name>
+ <id>Asia/Irkutsk</id>
+ </entries>
+ <entries>
+ <name>Tbilisi</name>
+ <id>Asia/Tbilisi</id>
+ </entries>
+ <entries>
+ <name>Yekaterinburg</name>
+ <id>Asia/Yekaterinburg</id>
+ </entries>
+ <entries>
+ <name>Japan</name>
+ <id>Asia/Tokyo</id>
+ </entries>
+ <entries>
+ <name>Katmandu</name>
+ <id>Asia/Katmandu</id>
+ </entries>
+ <entries>
+ <name>Kolkata</name>
+ <id>Asia/Kolkata</id>
+ </entries>
+ <entries>
+ <name>Dili</name>
+ <id>Asia/Dili</id>
+ </entries>
+ <entries>
+ <name>Pyongyang</name>
+ <id>Asia/Pyongyang</id>
+ </entries>
+ <entries>
+ <name>Hovd</name>
+ <id>Asia/Hovd</id>
+ </entries>
+ <entries>
+ <name>Novosibirsk</name>
+ <id>Asia/Novosibirsk</id>
+ </entries>
+ <entries>
+ <name>Saigon</name>
+ <id>Asia/Ho_Chi_Minh</id>
+ </entries>
+ <entries>
+ <name>Bahrain</name>
+ <id>Asia/Bahrain</id>
+ </entries>
+ </entries>
+ <central>Asia/Kolkata</central>
+ </timezones>
+ <timezones>
+ <name>Atlantic</name>
+ <entries type="array">
+ <entries>
+ <name>Stanley</name>
+ <id>Atlantic/Stanley</id>
+ </entries>
+ <entries>
+ <name>St Helena</name>
+ <id>Atlantic/St_Helena</id>
+ </entries>
+ <entries>
+ <name>Jan Mayen</name>
+ <id>Atlantic/Jan_Mayen</id>
+ </entries>
+ <entries>
+ <name>Miquelon</name>
+ <id>America/Miquelon</id>
+ </entries>
+ <entries>
+ <name>Canary Islands</name>
+ <id>Atlantic/Canary</id>
+ </entries>
+ <entries>
+ <name>Bermuda</name>
+ <id>Atlantic/Bermuda</id>
+ </entries>
+ <entries>
+ <name>Iceland</name>
+ <id>Atlantic/Reykjavik</id>
+ </entries>
+ <entries>
+ <name>Greenland (Thule)</name>
+ <id>America/Thule</id>
+ </entries>
+ <entries>
+ <name>Greenland (Nuuk)</name>
+ <id>America/Godthab</id>
+ </entries>
+ <entries>
+ <name>Faroe Islands</name>
+ <id>Atlantic/Faroe</id>
+ </entries>
+ <entries>
+ <name>Greenland (Scoresbysund)</name>
+ <id>America/Scoresbysund</id>
+ </entries>
+ <entries>
+ <name>Madeira</name>
+ <id>Atlantic/Madeira</id>
+ </entries>
+ <entries>
+ <name>Azores</name>
+ <id>Atlantic/Azores</id>
+ </entries>
+ <entries>
+ <name>South Georgia</name>
+ <id>Atlantic/South_Georgia</id>
+ </entries>
+ <entries>
+ <name>Cape Verde</name>
+ <id>Atlantic/Cape_Verde</id>
+ </entries>
+ <entries>
+ <name>Greenland (Danmarkshavn)</name>
+ <id>America/Danmarkshavn</id>
+ </entries>
+ </entries>
+ <central>Atlantic/Madeira</central>
+ </timezones>
+ <timezones>
+ <name>Australia</name>
+ <entries type="array">
+ <entries>
+ <name>New South Wales (Sydney)</name>
+ <id>Australia/Sydney</id>
+ </entries>
+ <entries>
+ <name>Lindeman</name>
+ <id>Australia/Lindeman</id>
+ </entries>
+ <entries>
+ <name>Northern Territory (Darwin)</name>
+ <id>Australia/Darwin</id>
+ </entries>
+ <entries>
+ <name>South Australia (Adelaide)</name>
+ <id>Australia/Adelaide</id>
+ </entries>
+ <entries>
+ <name>Tasmania (Hobart)</name>
+ <id>Australia/Hobart</id>
+ </entries>
+ <entries>
+ <name>Eucla</name>
+ <id>Australia/Eucla</id>
+ </entries>
+ <entries>
+ <name>New South Wales (Broken Hill)</name>
+ <id>Australia/Broken_Hill</id>
+ </entries>
+ <entries>
+ <name>Tasmania (Currie)</name>
+ <id>Australia/Currie</id>
+ </entries>
+ <entries>
+ <name>Western Australia (Perth)</name>
+ <id>Australia/Perth</id>
+ </entries>
+ <entries>
+ <name>Victoria (Melbourne)</name>
+ <id>Australia/Melbourne</id>
+ </entries>
+ <entries>
+ <name>Lord Howe Island</name>
+ <id>Australia/Lord_Howe</id>
+ </entries>
+ <entries>
+ <name>Queensland (Brisbane)</name>
+ <id>Australia/Brisbane</id>
+ </entries>
+ </entries>
+ <central>Australia/Sydney</central>
+ </timezones>
+ <timezones>
+ <name>Brazil</name>
+ <entries type="array">
+ <entries>
+ <name>Porto Velho</name>
+ <id>America/Porto_Velho</id>
+ </entries>
+ <entries>
+ <name>Eirunepe</name>
+ <id>America/Eirunepe</id>
+ </entries>
+ <entries>
+ <name>Bahia</name>
+ <id>America/Bahia</id>
+ </entries>
+ <entries>
+ <name>Fernando de Noronha</name>
+ <id>America/Noronha</id>
+ </entries>
+ <entries>
+ <name>Cuiaba</name>
+ <id>America/Cuiaba</id>
+ </entries>
+ <entries>
+ <name>Campo Grande</name>
+ <id>America/Campo_Grande</id>
+ </entries>
+ <entries>
+ <name>Boa Vista</name>
+ <id>America/Boa_Vista</id>
+ </entries>
+ <entries>
+ <name>Recife</name>
+ <id>America/Recife</id>
+ </entries>
+ <entries>
+ <name>Manaus</name>
+ <id>America/Manaus</id>
+ </entries>
+ <entries>
+ <name>Araguaina</name>
+ <id>America/Araguaina</id>
+ </entries>
+ <entries>
+ <name>Maceio</name>
+ <id>America/Maceio</id>
+ </entries>
+ <entries>
+ <name>Sao Paulo</name>
+ <id>America/Sao_Paulo</id>
+ </entries>
+ <entries>
+ <name>Rio Branco</name>
+ <id>America/Rio_Branco</id>
+ </entries>
+ <entries>
+ <name>Belem</name>
+ <id>America/Belem</id>
+ </entries>
+ <entries>
+ <name>Fortaleza</name>
+ <id>America/Fortaleza</id>
+ </entries>
+ </entries>
+ <central>America/Sao_Paulo</central>
+ </timezones>
+ <timezones>
+ <name>Canada</name>
+ <entries type="array">
+ <entries>
+ <name>Saskatchewan (Regina)</name>
+ <id>America/Regina</id>
+ </entries>
+ <entries>
+ <name>Rankin Inlet</name>
+ <id>America/Rankin_Inlet</id>
+ </entries>
+ <entries>
+ <name>Thunder Bay</name>
+ <id>America/Thunder_Bay</id>
+ </entries>
+ <entries>
+ <name>Resolute</name>
+ <id>America/Resolute</id>
+ </entries>
+ <entries>
+ <name>Goose Bay</name>
+ <id>America/Goose_Bay</id>
+ </entries>
+ <entries>
+ <name>Dawson Creek</name>
+ <id>America/Dawson_Creek</id>
+ </entries>
+ <entries>
+ <name>Atikokan</name>
+ <id>America/Atikokan</id>
+ </entries>
+ <entries>
+ <name>Yukon (Whitehorse)</name>
+ <id>America/Whitehorse</id>
+ </entries>
+ <entries>
+ <name>Swift Current</name>
+ <id>America/Swift_Current</id>
+ </entries>
+ <entries>
+ <name>Newfoundland (St Johns)</name>
+ <id>America/St_Johns</id>
+ </entries>
+ <entries>
+ <name>Iqaluit</name>
+ <id>America/Iqaluit</id>
+ </entries>
+ <entries>
+ <name>Blanc-Sablon</name>
+ <id>America/Blanc-Sablon</id>
+ </entries>
+ <entries>
+ <name>Glace Bay</name>
+ <id>America/Glace_Bay</id>
+ </entries>
+ <entries>
+ <name>Yellowknife</name>
+ <id>America/Yellowknife</id>
+ </entries>
+ <entries>
+ <name>Inuvik</name>
+ <id>America/Inuvik</id>
+ </entries>
+ <entries>
+ <name>Dawson</name>
+ <id>America/Dawson</id>
+ </entries>
+ <entries>
+ <name>Rainy River</name>
+ <id>America/Rainy_River</id>
+ </entries>
+ <entries>
+ <name>Pangnirtung</name>
+ <id>America/Pangnirtung</id>
+ </entries>
+ <entries>
+ <name>Nipigon</name>
+ <id>America/Nipigon</id>
+ </entries>
+ <entries>
+ <name>Eastern (Toronto)</name>
+ <id>America/Toronto</id>
+ </entries>
+ <entries>
+ <name>Montreal</name>
+ <id>America/Montreal</id>
+ </entries>
+ <entries>
+ <name>Moncton</name>
+ <id>America/Moncton</id>
+ </entries>
+ <entries>
+ <name>Mountain (Edmonton)</name>
+ <id>America/Edmonton</id>
+ </entries>
+ <entries>
+ <name>Cambridge Bay</name>
+ <id>America/Cambridge_Bay</id>
+ </entries>
+ <entries>
+ <name>Central (Winnipeg)</name>
+ <id>America/Winnipeg</id>
+ </entries>
+ <entries>
+ <name>Pacific (Vancouver)</name>
+ <id>America/Vancouver</id>
+ </entries>
+ <entries>
+ <name>Atlantic (Halifax)</name>
+ <id>America/Halifax</id>
+ </entries>
+ </entries>
+ <central>America/Winnipeg</central>
+ </timezones>
+ <timezones>
+ <name>Central and South America</name>
+ <entries type="array">
+ <entries>
+ <name>Stanley</name>
+ <id>Atlantic/Stanley</id>
+ </entries>
+ <entries>
+ <name>Uruguay</name>
+ <id>America/Montevideo</id>
+ </entries>
+ <entries>
+ <name>Martinique</name>
+ <id>America/Martinique</id>
+ </entries>
+ <entries>
+ <name>Managua</name>
+ <id>America/Managua</id>
+ </entries>
+ <entries>
+ <name>La Paz</name>
+ <id>America/La_Paz</id>
+ </entries>
+ <entries>
+ <name>Grenada</name>
+ <id>America/Grenada</id>
+ </entries>
+ <entries>
+ <name>Cayman Islands</name>
+ <id>America/Cayman</id>
+ </entries>
+ <entries>
+ <name>Caracas</name>
+ <id>America/Caracas</id>
+ </entries>
+ <entries>
+ <name>Anguilla</name>
+ <id>America/Anguilla</id>
+ </entries>
+ <entries>
+ <name>Saint Lucia</name>
+ <id>America/St_Lucia</id>
+ </entries>
+ <entries>
+ <name>Costa Rica</name>
+ <id>America/Costa_Rica</id>
+ </entries>
+ <entries>
+ <name>Havana</name>
+ <id>America/Havana</id>
+ </entries>
+ <entries>
+ <name>Aruba</name>
+ <id>America/Aruba</id>
+ </entries>
+ <entries>
+ <name>St Thomas</name>
+ <id>America/St_Thomas</id>
+ </entries>
+ <entries>
+ <name>Port-au-Prince</name>
+ <id>America/Port-au-Prince</id>
+ </entries>
+ <entries>
+ <name>Guyana</name>
+ <id>America/Guyana</id>
+ </entries>
+ <entries>
+ <name>Guatemala</name>
+ <id>America/Guatemala</id>
+ </entries>
+ <entries>
+ <name>El Salvador</name>
+ <id>America/El_Salvador</id>
+ </entries>
+ <entries>
+ <name>Dominica</name>
+ <id>America/Dominica</id>
+ </entries>
+ <entries>
+ <name>Paramaribo</name>
+ <id>America/Paramaribo</id>
+ </entries>
+ <entries>
+ <name>Panama</name>
+ <id>America/Panama</id>
+ </entries>
+ <entries>
+ <name>Guayaquil</name>
+ <id>America/Guayaquil</id>
+ </entries>
+ <entries>
+ <name>Grand Turk</name>
+ <id>America/Grand_Turk</id>
+ </entries>
+ <entries>
+ <name>Bogota</name>
+ <id>America/Bogota</id>
+ </entries>
+ <entries>
+ <name>Belize</name>
+ <id>America/Belize</id>
+ </entries>
+ <entries>
+ <name>St Vincent</name>
+ <id>America/St_Vincent</id>
+ </entries>
+ <entries>
+ <name>Saint Kitts and Nevis</name>
+ <id>America/St_Kitts</id>
+ </entries>
+ <entries>
+ <name>Curacao</name>
+ <id>America/Curacao</id>
+ </entries>
+ <entries>
+ <name>Galapagos</name>
+ <id>Pacific/Galapagos</id>
+ </entries>
+ <entries>
+ <name>Puerto Rico</name>
+ <id>America/Puerto_Rico</id>
+ </entries>
+ <entries>
+ <name>Montserrat</name>
+ <id>America/Montserrat</id>
+ </entries>
+ <entries>
+ <name>Jamaica</name>
+ <id>America/Jamaica</id>
+ </entries>
+ <entries>
+ <name>Barbados</name>
+ <id>America/Barbados</id>
+ </entries>
+ <entries>
+ <name>Antigua</name>
+ <id>America/Antigua</id>
+ </entries>
+ <entries>
+ <name>Nassau</name>
+ <id>America/Nassau</id>
+ </entries>
+ <entries>
+ <name>Asuncion</name>
+ <id>America/Asuncion</id>
+ </entries>
+ <entries>
+ <name>Easter Island</name>
+ <id>Pacific/Easter</id>
+ </entries>
+ <entries>
+ <name>Tegucigalpa</name>
+ <id>America/Tegucigalpa</id>
+ </entries>
+ <entries>
+ <name>Lima</name>
+ <id>America/Lima</id>
+ </entries>
+ <entries>
+ <name>Guadeloupe</name>
+ <id>America/Guadeloupe</id>
+ </entries>
+ <entries>
+ <name>Tortola</name>
+ <id>America/Tortola</id>
+ </entries>
+ <entries>
+ <name>Santo Domingo</name>
+ <id>America/Santo_Domingo</id>
+ </entries>
+ <entries>
+ <name>Chile Continental</name>
+ <id>America/Santiago</id>
+ </entries>
+ <entries>
+ <name>Port of Spain</name>
+ <id>America/Port_of_Spain</id>
+ </entries>
+ <entries>
+ <name>Cayenne</name>
+ <id>America/Cayenne</id>
+ </entries>
+ </entries>
+ <central>America/La_Paz</central>
+ </timezones>
+ <timezones>
+ <name>Etc</name>
+ <entries type="array">
+ <entries>
+ <name>Zulu</name>
+ <id>Etc/Zulu</id>
+ </entries>
+ <entries>
+ <name>UTC</name>
+ <id>Etc/UTC</id>
+ </entries>
+ <entries>
+ <name>Greenwich</name>
+ <id>Etc/Greenwich</id>
+ </entries>
+ <entries>
+ <name>GMT-9</name>
+ <id>Etc/GMT-9</id>
+ </entries>
+ <entries>
+ <name>GMT-14</name>
+ <id>Etc/GMT-14</id>
+ </entries>
+ <entries>
+ <name>GMT+7</name>
+ <id>Etc/GMT+7</id>
+ </entries>
+ <entries>
+ <name>UCT</name>
+ <id>Etc/UCT</id>
+ </entries>
+ <entries>
+ <name>GMT-0</name>
+ <id>Etc/GMT-0</id>
+ </entries>
+ <entries>
+ <name>GMT+8</name>
+ <id>Etc/GMT+8</id>
+ </entries>
+ <entries>
+ <name>GMT-1</name>
+ <id>Etc/GMT-1</id>
+ </entries>
+ <entries>
+ <name>GMT+9</name>
+ <id>Etc/GMT+9</id>
+ </entries>
+ <entries>
+ <name>GMT-2</name>
+ <id>Etc/GMT-2</id>
+ </entries>
+ <entries>
+ <name>GMT+0</name>
+ <id>Etc/GMT+0</id>
+ </entries>
+ <entries>
+ <name>GMT-3</name>
+ <id>Etc/GMT-3</id>
+ </entries>
+ <entries>
+ <name>GMT+10</name>
+ <id>Etc/GMT+10</id>
+ </entries>
+ <entries>
+ <name>GMT+1</name>
+ <id>Etc/GMT+1</id>
+ </entries>
+ <entries>
+ <name>GMT-4</name>
+ <id>Etc/GMT-4</id>
+ </entries>
+ <entries>
+ <name>GMT+2</name>
+ <id>Etc/GMT+2</id>
+ </entries>
+ <entries>
+ <name>GMT+11</name>
+ <id>Etc/GMT+11</id>
+ </entries>
+ <entries>
+ <name>Universal</name>
+ <id>Etc/Universal</id>
+ </entries>
+ <entries>
+ <name>GMT0</name>
+ <id>Etc/GMT0</id>
+ </entries>
+ <entries>
+ <name>GMT-5</name>
+ <id>Etc/GMT-5</id>
+ </entries>
+ <entries>
+ <name>GMT-10</name>
+ <id>Etc/GMT-10</id>
+ </entries>
+ <entries>
+ <name>GMT+3</name>
+ <id>Etc/GMT+3</id>
+ </entries>
+ <entries>
+ <name>GMT+12</name>
+ <id>Etc/GMT+12</id>
+ </entries>
+ <entries>
+ <name>GMT-6</name>
+ <id>Etc/GMT-6</id>
+ </entries>
+ <entries>
+ <name>GMT-11</name>
+ <id>Etc/GMT-11</id>
+ </entries>
+ <entries>
+ <name>GMT+4</name>
+ <id>Etc/GMT+4</id>
+ </entries>
+ <entries>
+ <name>GMT-7</name>
+ <id>Etc/GMT-7</id>
+ </entries>
+ <entries>
+ <name>GMT-12</name>
+ <id>Etc/GMT-12</id>
+ </entries>
+ <entries>
+ <name>GMT+5</name>
+ <id>Etc/GMT+5</id>
+ </entries>
+ <entries>
+ <name>GMT-8</name>
+ <id>Etc/GMT-8</id>
+ </entries>
+ <entries>
+ <name>GMT-13</name>
+ <id>Etc/GMT-13</id>
+ </entries>
+ <entries>
+ <name>GMT+6</name>
+ <id>Etc/GMT+6</id>
+ </entries>
+ <entries>
+ <name>GMT</name>
+ <id>Etc/GMT</id>
+ </entries>
+ </entries>
+ <central>Etc/GMT</central>
+ </timezones>
+ <timezones>
+ <name>Europe</name>
+ <entries type="array">
+ <entries>
+ <name>Uzhgorod</name>
+ <id>Europe/Uzhgorod</id>
+ </entries>
+ <entries>
+ <name>Russia (Moscow)</name>
+ <id>Europe/Moscow</id>
+ </entries>
+ <entries>
+ <name>Jersey</name>
+ <id>Europe/Jersey</id>
+ </entries>
+ <entries>
+ <name>Belgium</name>
+ <id>Europe/Brussels</id>
+ </entries>
+ <entries>
+ <name>Netherlands</name>
+ <id>Europe/Amsterdam</id>
+ </entries>
+ <entries>
+ <name>Miquelon</name>
+ <id>America/Miquelon</id>
+ </entries>
+ <entries>
+ <name>Ukraine (Zaporozhye)</name>
+ <id>Europe/Zaporozhye</id>
+ </entries>
+ <entries>
+ <name>France</name>
+ <id>Europe/Paris</id>
+ </entries>
+ <entries>
+ <name>Norway</name>
+ <id>Europe/Oslo</id>
+ </entries>
+ <entries>
+ <name>Malta</name>
+ <id>Europe/Malta</id>
+ </entries>
+ <entries>
+ <name>Finland</name>
+ <id>Europe/Helsinki</id>
+ </entries>
+ <entries>
+ <name>Greece</name>
+ <id>Europe/Athens</id>
+ </entries>
+ <entries>
+ <name>Canary Islands</name>
+ <id>Atlantic/Canary</id>
+ </entries>
+ <entries>
+ <name>Macedonia</name>
+ <id>Europe/Skopje</id>
+ </entries>
+ <entries>
+ <name>Monaco</name>
+ <id>Europe/Monaco</id>
+ </entries>
+ <entries>
+ <name>Iceland</name>
+ <id>Atlantic/Reykjavik</id>
+ </entries>
+ <entries>
+ <name>San Marino</name>
+ <id>Europe/San_Marino</id>
+ </entries>
+ <entries>
+ <name>Italy</name>
+ <id>Europe/Rome</id>
+ </entries>
+ <entries>
+ <name>Portugal</name>
+ <id>Europe/Lisbon</id>
+ </entries>
+ <entries>
+ <name>Turkey</name>
+ <id>Europe/Istanbul</id>
+ </entries>
+ <entries>
+ <name>Ireland</name>
+ <id>Europe/Dublin</id>
+ </entries>
+ <entries>
+ <name>Slovakia</name>
+ <id>Europe/Bratislava</id>
+ </entries>
+ <entries>
+ <name>Germany</name>
+ <id>Europe/Berlin</id>
+ </entries>
+ <entries>
+ <name>Spain</name>
+ <id>Europe/Madrid</id>
+ </entries>
+ <entries>
+ <name>Isle of Man</name>
+ <id>Europe/Isle_of_Man</id>
+ </entries>
+ <entries>
+ <name>Guernsey</name>
+ <id>Europe/Guernsey</id>
+ </entries>
+ <entries>
+ <name>Denmark</name>
+ <id>Europe/Copenhagen</id>
+ </entries>
+ <entries>
+ <name>Switzerland</name>
+ <id>Europe/Zurich</id>
+ </entries>
+ <entries>
+ <name>Croatia</name>
+ <id>Europe/Zagreb</id>
+ </entries>
+ <entries>
+ <name>Estonia</name>
+ <id>Europe/Tallinn</id>
+ </entries>
+ <entries>
+ <name>Ukraine (Kiev)</name>
+ <id>Europe/Kiev</id>
+ </entries>
+ <entries>
+ <name>Poland</name>
+ <id>Europe/Warsaw</id>
+ </entries>
+ <entries>
+ <name>Lithuania</name>
+ <id>Europe/Vilnius</id>
+ </entries>
+ <entries>
+ <name>Vatican</name>
+ <id>Europe/Vatican</id>
+ </entries>
+ <entries>
+ <name>Czech Republic</name>
+ <id>Europe/Prague</id>
+ </entries>
+ <entries>
+ <name>Aaland Islands</name>
+ <id>Europe/Mariehamn</id>
+ </entries>
+ <entries>
+ <name>Russia (Kaliningrad)</name>
+ <id>Europe/Kaliningrad</id>
+ </entries>
+ <entries>
+ <name>Gibraltar</name>
+ <id>Europe/Gibraltar</id>
+ </entries>
+ <entries>
+ <name>Serbia</name>
+ <id>Europe/Belgrade</id>
+ </entries>
+ <entries>
+ <name>Austria</name>
+ <id>Europe/Vienna</id>
+ </entries>
+ <entries>
+ <name>Liechtenstein</name>
+ <id>Europe/Vaduz</id>
+ </entries>
+ <entries>
+ <name>Luxembourg</name>
+ <id>Europe/Luxembourg</id>
+ </entries>
+ <entries>
+ <name>Slovenia</name>
+ <id>Europe/Ljubljana</id>
+ </entries>
+ <entries>
+ <name>Andorra</name>
+ <id>Europe/Andorra</id>
+ </entries>
+ <entries>
+ <name>Azores</name>
+ <id>Atlantic/Azores</id>
+ </entries>
+ <entries>
+ <name>Ukraine (Simferopol)</name>
+ <id>Europe/Simferopol</id>
+ </entries>
+ <entries>
+ <name>Belarus</name>
+ <id>Europe/Minsk</id>
+ </entries>
+ <entries>
+ <name>United Kingdom</name>
+ <id>Europe/London</id>
+ </entries>
+ <entries>
+ <name>Romania</name>
+ <id>Europe/Bucharest</id>
+ </entries>
+ <entries>
+ <name>Russia (Volgograd)</name>
+ <id>Europe/Volgograd</id>
+ </entries>
+ <entries>
+ <name>Albania</name>
+ <id>Europe/Tirane</id>
+ </entries>
+ <entries>
+ <name>Sweden</name>
+ <id>Europe/Stockholm</id>
+ </entries>
+ <entries>
+ <name>Bulgaria</name>
+ <id>Europe/Sofia</id>
+ </entries>
+ <entries>
+ <name>Bosnia & Herzegovina</name>
+ <id>Europe/Sarajevo</id>
+ </entries>
+ <entries>
+ <name>Russia (Samara)</name>
+ <id>Europe/Samara</id>
+ </entries>
+ <entries>
+ <name>Latvia</name>
+ <id>Europe/Riga</id>
+ </entries>
+ <entries>
+ <name>Montenegro</name>
+ <id>Europe/Podgorica</id>
+ </entries>
+ <entries>
+ <name>Moldova</name>
+ <id>Europe/Chisinau</id>
+ </entries>
+ <entries>
+ <name>Hungary</name>
+ <id>Europe/Budapest</id>
+ </entries>
+ </entries>
+ <central>Europe/Prague</central>
+ </timezones>
+ <timezones>
+ <name>Global</name>
+ <entries type="array">
+ <entries>
+ <name>NZ</name>
+ <id>NZ</id>
+ </entries>
+ <entries>
+ <name>GMT+0</name>
+ <id>GMT+0</id>
+ </entries>
+ <entries>
+ <name>GMT0</name>
+ <id>GMT0</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Syowa)</name>
+ <id>Antarctica/Syowa</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Mawson)</name>
+ <id>Antarctica/Mawson</id>
+ </entries>
+ <entries>
+ <name>Navajo</name>
+ <id>Navajo</id>
+ </entries>
+ <entries>
+ <name>MST</name>
+ <id>MST</id>
+ </entries>
+ <entries>
+ <name>GMT</name>
+ <id>GMT</id>
+ </entries>
+ <entries>
+ <name>CST6CDT</name>
+ <id>CST6CDT</id>
+ </entries>
+ <entries>
+ <name>Arctic Longyearbyen</name>
+ <id>Arctic/Longyearbyen</id>
+ </entries>
+ <entries>
+ <name>Universal</name>
+ <id>Universal</id>
+ </entries>
+ <entries>
+ <name>UTC</name>
+ <id>UTC</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Casey)</name>
+ <id>Antarctica/Casey</id>
+ </entries>
+ <entries>
+ <name>PST8PDT</name>
+ <id>PST8PDT</id>
+ </entries>
+ <entries>
+ <name>NZ-CHAT</name>
+ <id>NZ-CHAT</id>
+ </entries>
+ <entries>
+ <name>Greenland (Thule)</name>
+ <id>America/Thule</id>
+ </entries>
+ <entries>
+ <name>Greenland (Nuuk)</name>
+ <id>America/Godthab</id>
+ </entries>
+ <entries>
+ <name>Zulu</name>
+ <id>Zulu</id>
+ </entries>
+ <entries>
+ <name>WET</name>
+ <id>WET</id>
+ </entries>
+ <entries>
+ <name>W-SU</name>
+ <id>W-SU</id>
+ </entries>
+ <entries>
+ <name>UCT</name>
+ <id>UCT</id>
+ </entries>
+ <entries>
+ <name>MET</name>
+ <id>MET</id>
+ </entries>
+ <entries>
+ <name>Greenwich</name>
+ <id>Greenwich</id>
+ </entries>
+ <entries>
+ <name>EST</name>
+ <id>EST</id>
+ </entries>
+ <entries>
+ <name>Greenland (Scoresbysund)</name>
+ <id>America/Scoresbysund</id>
+ </entries>
+ <entries>
+ <name>CET</name>
+ <id>CET</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Vostok)</name>
+ <id>Antarctica/Vostok</id>
+ </entries>
+ <entries>
+ <name>Antarctica (South Pole)</name>
+ <id>Antarctica/South_Pole</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Rothera)</name>
+ <id>Antarctica/Rothera</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Palmer)</name>
+ <id>Antarctica/Palmer</id>
+ </entries>
+ <entries>
+ <name>Antarctica (McMurdo)</name>
+ <id>Antarctica/McMurdo</id>
+ </entries>
+ <entries>
+ <name>MST7MDT</name>
+ <id>MST7MDT</id>
+ </entries>
+ <entries>
+ <name>HST</name>
+ <id>HST</id>
+ </entries>
+ <entries>
+ <name>EET</name>
+ <id>EET</id>
+ </entries>
+ <entries>
+ <name>Antarctica (DumontDUrville)</name>
+ <id>Antarctica/DumontDUrville</id>
+ </entries>
+ <entries>
+ <name>Antarctica (Davis)</name>
+ <id>Antarctica/Davis</id>
+ </entries>
+ <entries>
+ <name>Greenland (Danmarkshavn)</name>
+ <id>America/Danmarkshavn</id>
+ </entries>
+ <entries>
+ <name>GMT-0</name>
+ <id>GMT-0</id>
+ </entries>
+ <entries>
+ <name>EST5EDT</name>
+ <id>EST5EDT</id>
+ </entries>
+ </entries>
+ <central>America/Godthab</central>
+ </timezones>
+ <timezones>
+ <name>Indian Ocean</name>
+ <entries type="array">
+ <entries>
+ <name>Maldives</name>
+ <id>Indian/Maldives</id>
+ </entries>
+ <entries>
+ <name>Mauritius</name>
+ <id>Indian/Mauritius</id>
+ </entries>
+ <entries>
+ <name>Reunion</name>
+ <id>Indian/Reunion</id>
+ </entries>
+ <entries>
+ <name>Comoro</name>
+ <id>Indian/Comoro</id>
+ </entries>
+ <entries>
+ <name>Cocos Islands</name>
+ <id>Indian/Cocos</id>
+ </entries>
+ <entries>
+ <name>Mayotte</name>
+ <id>Indian/Mayotte</id>
+ </entries>
+ <entries>
+ <name>Mahe</name>
+ <id>Indian/Mahe</id>
+ </entries>
+ <entries>
+ <name>Chagos</name>
+ <id>Indian/Chagos</id>
+ </entries>
+ <entries>
+ <name>Kerguelen</name>
+ <id>Indian/Kerguelen</id>
+ </entries>
+ <entries>
+ <name>Christmas Island</name>
+ <id>Indian/Christmas</id>
+ </entries>
+ </entries>
+ <central>Indian/Maldives</central>
+ </timezones>
+ <timezones>
+ <name>Mexico</name>
+ <entries type="array">
+ <entries>
+ <name>Cancun</name>
+ <id>America/Cancun</id>
+ </entries>
+ <entries>
+ <name>Mazatlan</name>
+ <id>America/Mazatlan</id>
+ </entries>
+ <entries>
+ <name>Hermosillo</name>
+ <id>America/Hermosillo</id>
+ </entries>
+ <entries>
+ <name>Merida</name>
+ <id>America/Merida</id>
+ </entries>
+ <entries>
+ <name>Monterrey</name>
+ <id>America/Monterrey</id>
+ </entries>
+ <entries>
+ <name>Chihuahua</name>
+ <id>America/Chihuahua</id>
+ </entries>
+ <entries>
+ <name>Mexico City</name>
+ <id>America/Mexico_City</id>
+ </entries>
+ <entries>
+ <name>Tijuana</name>
+ <id>America/Tijuana</id>
+ </entries>
+ </entries>
+ <central>America/Mexico_City</central>
+ </timezones>
+ <timezones>
+ <name>Pacific</name>
+ <entries type="array">
+ <entries>
+ <name>Port_Moresby</name>
+ <id>Pacific/Port_Moresby</id>
+ </entries>
+ <entries>
+ <name>Palau</name>
+ <id>Pacific/Palau</id>
+ </entries>
+ <entries>
+ <name>Nauru</name>
+ <id>Pacific/Nauru</id>
+ </entries>
+ <entries>
+ <name>Guam</name>
+ <id>Pacific/Guam</id>
+ </entries>
+ <entries>
+ <name>Efate</name>
+ <id>Pacific/Efate</id>
+ </entries>
+ <entries>
+ <name>Gambier</name>
+ <id>Pacific/Gambier</id>
+ </entries>
+ <entries>
+ <name>Funafuti</name>
+ <id>Pacific/Funafuti</id>
+ </entries>
+ <entries>
+ <name>Fiji</name>
+ <id>Pacific/Fiji</id>
+ </entries>
+ <entries>
+ <name>Kosrae</name>
+ <id>Pacific/Kosrae</id>
+ </entries>
+ <entries>
+ <name>Chatham</name>
+ <id>Pacific/Chatham</id>
+ </entries>
+ <entries>
+ <name>Apia</name>
+ <id>Pacific/Apia</id>
+ </entries>
+ <entries>
+ <name>Wake</name>
+ <id>Pacific/Wake</id>
+ </entries>
+ <entries>
+ <name>Samoa</name>
+ <id>Pacific/Pago_Pago</id>
+ </entries>
+ <entries>
+ <name>Wallis</name>
+ <id>Pacific/Wallis</id>
+ </entries>
+ <entries>
+ <name>Pohnpei</name>
+ <id>Pacific/Ponape</id>
+ </entries>
+ <entries>
+ <name>New Zealand</name>
+ <id>Pacific/Auckland</id>
+ </entries>
+ <entries>
+ <name>Tongatapu</name>
+ <id>Pacific/Tongatapu</id>
+ </entries>
+ <entries>
+ <name>Tarawa</name>
+ <id>Pacific/Tarawa</id>
+ </entries>
+ <entries>
+ <name>Kiritimati</name>
+ <id>Pacific/Kiritimati</id>
+ </entries>
+ <entries>
+ <name>Guadalcanal</name>
+ <id>Pacific/Guadalcanal</id>
+ </entries>
+ <entries>
+ <name>Chuuk</name>
+ <id>Pacific/Truk</id>
+ </entries>
+ <entries>
+ <name>Midway</name>
+ <id>Pacific/Midway</id>
+ </entries>
+ <entries>
+ <name>Majuro</name>
+ <id>Pacific/Majuro</id>
+ </entries>
+ <entries>
+ <name>Kwajalein</name>
+ <id>Pacific/Kwajalein</id>
+ </entries>
+ <entries>
+ <name>Rarotonga</name>
+ <id>Pacific/Rarotonga</id>
+ </entries>
+ <entries>
+ <name>Noumea</name>
+ <id>Pacific/Noumea</id>
+ </entries>
+ <entries>
+ <name>Norfolk</name>
+ <id>Pacific/Norfolk</id>
+ </entries>
+ <entries>
+ <name>Niue</name>
+ <id>Pacific/Niue</id>
+ </entries>
+ <entries>
+ <name>Enderbury</name>
+ <id>Pacific/Enderbury</id>
+ </entries>
+ <entries>
+ <name>Tahiti</name>
+ <id>Pacific/Tahiti</id>
+ </entries>
+ <entries>
+ <name>Pitcairn</name>
+ <id>Pacific/Pitcairn</id>
+ </entries>
+ <entries>
+ <name>Saipan</name>
+ <id>Pacific/Saipan</id>
+ </entries>
+ <entries>
+ <name>Marquesas</name>
+ <id>Pacific/Marquesas</id>
+ </entries>
+ <entries>
+ <name>Johnston</name>
+ <id>Pacific/Johnston</id>
+ </entries>
+ <entries>
+ <name>Fakaofo</name>
+ <id>Pacific/Fakaofo</id>
+ </entries>
+ <entries>
+ <name>Dili</name>
+ <id>Pacific/Dili</id>
+ </entries>
+ </entries>
+ <central>Pacific/Tahiti</central>
+ </timezones>
+ <timezones>
+ <name>Russia</name>
+ <entries type="array">
+ <entries>
+ <name>Moscow</name>
+ <id>Europe/Moscow</id>
+ </entries>
+ <entries>
+ <name>Yekaterinburg</name>
+ <id>Asia/Yekaterinburg</id>
+ </entries>
+ <entries>
+ <name>Sakhalin</name>
+ <id>Asia/Sakhalin</id>
+ </entries>
+ <entries>
+ <name>Kamchatka</name>
+ <id>Asia/Kamchatka</id>
+ </entries>
+ <entries>
+ <name>Irkutsk</name>
+ <id>Asia/Irkutsk</id>
+ </entries>
+ <entries>
+ <name>Yakutsk</name>
+ <id>Asia/Yakutsk</id>
+ </entries>
+ <entries>
+ <name>Vladivostok</name>
+ <id>Asia/Vladivostok</id>
+ </entries>
+ <entries>
+ <name>Anadyr</name>
+ <id>Asia/Anadyr</id>
+ </entries>
+ <entries>
+ <name>Omsk</name>
+ <id>Asia/Omsk</id>
+ </entries>
+ <entries>
+ <name>Kaliningrad</name>
+ <id>Europe/Kaliningrad</id>
+ </entries>
+ <entries>
+ <name>Novosibirsk</name>
+ <id>Asia/Novosibirsk</id>
+ </entries>
+ <entries>
+ <name>Krasnoyarsk</name>
+ <id>Asia/Krasnoyarsk</id>
+ </entries>
+ <entries>
+ <name>Magadan</name>
+ <id>Asia/Magadan</id>
+ </entries>
+ <entries>
+ <name>Volgograd</name>
+ <id>Europe/Volgograd</id>
+ </entries>
+ <entries>
+ <name>Samara</name>
+ <id>Europe/Samara</id>
+ </entries>
+ </entries>
+ <central>Asia/Novosibirsk</central>
+ </timezones>
+ <timezones>
+ <name>USA</name>
+ <entries type="array">
+ <entries>
+ <name>Hawaii (Honolulu)</name>
+ <id>Pacific/Honolulu</id>
+ </entries>
+ <entries>
+ <name>Central (Chicago)</name>
+ <id>America/Chicago</id>
+ </entries>
+ <entries>
+ <name>Alaska (Anchorage)</name>
+ <id>America/Anchorage</id>
+ </entries>
+ <entries>
+ <name>Kentucky (Monticello)</name>
+ <id>America/Kentucky/Monticello</id>
+ </entries>
+ <entries>
+ <name>Juneau</name>
+ <id>America/Juneau</id>
+ </entries>
+ <entries>
+ <name>Indiana (Petersburg)</name>
+ <id>America/Indiana/Petersburg</id>
+ </entries>
+ <entries>
+ <name>East Indiana (Indianapolis)</name>
+ <id>America/Indiana/Indianapolis</id>
+ </entries>
+ <entries>
+ <name>Shiprock</name>
+ <id>America/Shiprock</id>
+ </entries>
+ <entries>
+ <name>Pacific (Los Angeles)</name>
+ <id>America/Los_Angeles</id>
+ </entries>
+ <entries>
+ <name>Indiana (Marengo)</name>
+ <id>America/Indiana/Marengo</id>
+ </entries>
+ <entries>
+ <name>Samoa (Pago Pago)</name>
+ <id>Pacific/Pago_Pago</id>
+ </entries>
+ <entries>
+ <name>Virgin Islands (St Thomas)</name>
+ <id>America/St_Thomas</id>
+ </entries>
+ <entries>
+ <name>North Dakota (New Salem)</name>
+ <id>America/North_Dakota/New_Salem</id>
+ </entries>
+ <entries>
+ <name>Indiana (Vevay)</name>
+ <id>America/Indiana/Vevay</id>
+ </entries>
+ <entries>
+ <name>Mountain (Denver)</name>
+ <id>America/Denver</id>
+ </entries>
+ <entries>
+ <name>Menominee</name>
+ <id>America/Menominee</id>
+ </entries>
+ <entries>
+ <name>Indiana (Winamac)</name>
+ <id>America/Indiana/Winamac</id>
+ </entries>
+ <entries>
+ <name>Boise</name>
+ <id>America/Boise</id>
+ </entries>
+ <entries>
+ <name>Arizona (Phoenix)</name>
+ <id>America/Phoenix</id>
+ </entries>
+ <entries>
+ <name>Indiana (Vincennes)</name>
+ <id>America/Indiana/Vincennes</id>
+ </entries>
+ <entries>
+ <name>Aleutian (Adak)</name>
+ <id>America/Adak</id>
+ </entries>
+ <entries>
+ <name>Eastern (New York)</name>
+ <id>America/New_York</id>
+ </entries>
+ <entries>
+ <name>Michigan (Detroit)</name>
+ <id>America/Detroit</id>
+ </entries>
+ <entries>
+ <name>Puerto Rico</name>
+ <id>America/Puerto_Rico</id>
+ </entries>
+ <entries>
+ <name>Nome</name>
+ <id>America/Nome</id>
+ </entries>
+ <entries>
+ <name>Kentucky (Louisville)</name>
+ <id>America/Kentucky/Louisville</id>
+ </entries>
+ <entries>
+ <name>Yakutat</name>
+ <id>America/Yakutat</id>
+ </entries>
+ <entries>
+ <name>North Dakota (Center)</name>
+ <id>America/North_Dakota/Center</id>
+ </entries>
+ <entries>
+ <name>Indiana Starke (Knox)</name>
+ <id>America/Indiana/Knox</id>
+ </entries>
+ <entries>
+ <name>Indiana (Tell City)</name>
+ <id>America/Indiana/Tell_City</id>
+ </entries>
+ </entries>
+ <central>America/Chicago</central>
+ </timezones>
+ </timezones>
+ <timezone>Europe/Prague</timezone>
+ <time>12:18:00</time>
+ <utcstatus type="boolean">false</utcstatus>
+ <date>07/02/2009</date>
+</systemtime>
diff --git a/plugins/systemtime/test/functional/systemtime_controller_test.rb b/plugins/systemtime/test/functional/systemtime_controller_test.rb
index 70e2995..5fa63d5 100644
--- a/plugins/systemtime/test/functional/systemtime_controller_test.rb
+++ b/plugins/systemtime/test/functional/systemtime_controller_test.rb
@@ -2,148 +2,57 @@ require File.expand_path(File.dirname(__FILE__) + "/../test_helper")
require 'test/unit'
require File.expand_path( File.join("test","validation_assert"), RailsParent.parent )
require 'mocha'
+require 'yast_mock'
class SystemtimeControllerTest < ActionController::TestCase
-
- class Proxy
- attr_accessor :result, :permissions, :timeout
- def find
- return result
- end
- end
-
- class NtpProxy
- attr_accessor :result, :permissions, :timeout
- def find
- return result
- end
- end
-
- class Ntp
- attr_accessor :synchronize, :synchronize_utc
-
- def initialize
- @synchronize = false
- @synchronize_utc = true
- end
-
- def save
- end
- end
-
- class Region
- attr_accessor :name, :central, :entries
- def initialize (name, central, entries)
- @name = name
- @central = central
- @entries = entries
- end
- end
-
- class Entry
- attr_accessor :id, :name
- def initialize (id,name)
- @id = id
- @name = name
- end
- end
-
-
-
- class Result
- attr_accessor :time, :date, :timezone, :utcstatus, :timezones, :saved
-
- def fill
- @timezones = [
- Region.new("Europe","Europe/Prague",[ Entry.new("Europe/Prague","Czech Republic" )])
-]
- @time = "12:18:00"
- @date = "07/02/2009"
- @utcstatus = false
- @timezone = "Europe/Prague"
- end
-
- def save
- @saved = true
- end
- end
-
+
def setup
SystemtimeController.any_instance.stubs(:login_required)
@controller = SystemtimeController.new
@request = ActionController::TestRequest.new
# http://railsforum.com/viewtopic.php?id=1719
@request.session[:account_id] = 1 # defined in fixtures
- @permissions = { :read => true, :write => true }
- @result = Result.new
- @result.fill
- @proxy = Proxy.new
- @proxy.permissions = @permissions
- @proxy.result = @result
+ response_time = IO.read(File.join(File.dirname(__FILE__),"..","fixtures","success.xml"))
+ response_ntp = IO.read(File.join(File.dirname(__FILE__),"..","fixtures","ntp.xml"))
+ ActiveResource::HttpMock.set_authentification
+ ActiveResource::HttpMock.respond_to do |mock|
+ header = ActiveResource::HttpMock.authentification_header
+ mock.resources :"org.opensuse.yast.modules.yapi.time" => "/systemtime", :"org.opensuse.yast.modules.yapi.ntp" => "/ntp"
+ mock.permissions "org.opensuse.yast.modules.yapi.time", { :read => true, :write => true }
+ mock.permissions "org.opensuse.yast.modules.yapi.ntp", { :available => true, :synchronize => true }
+ mock.get "/systemtime.xml", header, response_time, 200
+ mock.post "/systemtime.xml", header, response_time, 200
+ mock.get "/ntp.xml", header, response_ntp, 200
+ mock.post "/ntp.xml", header, response_ntp, 200
+ end
end
def test_index
- YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy)
-#debugger
- get :index
- assert_response :success
- assert_valid_markup
- assert assigns(:permissions)
- assert assigns(:permissions)[:read]
- assert assigns(:permissions)[:write]
- assert assigns(:time)
- assert assigns(:date)
- assert_equal assigns(:timezone), "Europe/Prague"
- end
-
- def test_access_without_write_permissions
- @permissions[:write] = false
- YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy)
-
get :index
-
assert_response :success
assert_valid_markup
- assert assigns(:permissions)
- assert assigns(:permissions)[:read]
- assert !assigns(:permissions)[:write]
- assert assigns(:time)
+ assert assigns(:stime)
end
-
def test_commit
- YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy)
- post :update, { :currenttime => "2009-07-02 - 12:18:00", :date => { :date => "2009-07-02 - 12:18:00/2009-07-02 - 12:18:00" } }
+ post :update, { :currenttime => "12:18:00", :date => { :date => "2009-07-02" } }
assert_response :redirect
assert_redirected_to :controller => "controlpanel", :action => "index"
-
- assert @result.saved
- assert_equal false,(a)result.utcstatus
end
def test_commit_wizard
- YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy)
session[:wizard_current] = "test"
session[:wizard_steps] = "systemtime,language"
- post :update, { :currenttime => "2009-07-02 - 12:18:00", :date => { :date => "2009-07-02 - 12:18:00/2009-07-02 - 12:18:00" }}
+ post :update, { :currenttime => "12:18:00", :date => { :date => "2009-07-02" }}
assert_response :redirect
assert_redirected_to :controller => "controlpanel", :action => "nextstep"
-
- assert @result.saved
- assert_equal false, @result.utcstatus
end
- def test_ntp_force
- YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.time').returns(@proxy)
- ntpproxy = NtpProxy.new
- ntpproxy.result = Ntp.new
- YaST::ServiceResource.stubs(:proxy_for).with('org.opensuse.yast.modules.yapi.ntp').returns(ntpproxy)
+ def test_ntp
post :update, { :timeconfig => "ntp_sync" }
assert_response :redirect
assert_redirected_to :controller => "controlpanel", :action => "index"
- assert ntpproxy.result.synchronize
- assert !ntpproxy.result.synchronize_utc
end
end
diff --git a/webclient/lib/yast_model/base.rb b/webclient/lib/yast_model/base.rb
index c1f0adf..a968e18 100644
--- a/webclient/lib/yast_model/base.rb
+++ b/webclient/lib/yast_model/base.rb
@@ -7,8 +7,8 @@ module YastModel
def site
ret = super
- if ret.nil? || ret != URI.parse(YaST::ServiceResource::Session.site) ||
- password != YaST::ServiceResource::Session.auth_token
+ if ret.nil? || ret != URI.parse(YaST::ServiceResource::Session.site) || password != YaST::ServiceResource::Session.auth_token
+ Rails.logger.debug "set new site for interface #{@interface}"
set_site
end
return super
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0