Commit 463ba28a authored by segfault's avatar segfault
Browse files

Greeter: Don't unlock persistence via the "Start Tails" button (refs: #17136)

We require to unlock the persistence via the "Unlock" button, to ensure
that the user gets some UI feedback when the persistent Greeter settings
are loaded.

The "Start Tails" is now insensitive if a password was entered in the
persistence password entry but persistence was not unlocked.
parent b47410a7
...@@ -176,20 +176,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -176,20 +176,6 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
# Actions # Actions
def check_and_login(self):
if (self.persistence_setting.has_persistence() and
self.entry_storage_passphrase.get_text() and
not self.persistence_setting.is_unlocked):
logging.debug("Unlocking persistent storage before login")
self.persistent_storage.unlock(unlocked_cb=self.finish_login)
else:
self.finish_login()
def finish_login(self):
logging.info("Starting the session")
self.greeter.login()
return False
def add_setting(self, id_=None): def add_setting(self, id_=None):
response = self.dialog_add_setting.run(id_) response = self.dialog_add_setting.run(id_)
if response == Gtk.ResponseType.YES: if response == Gtk.ResponseType.YES:
...@@ -298,7 +284,7 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -298,7 +284,7 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
return False return False
def cb_button_start_clicked(self, widget, user_data=None): def cb_button_start_clicked(self, widget, user_data=None):
self.check_and_login() self.greeter.login()
return False return False
def cb_button_storage_unlock_clicked(self, widget, user_data=None): def cb_button_storage_unlock_clicked(self, widget, user_data=None):
...@@ -311,6 +297,13 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow): ...@@ -311,6 +297,13 @@ class GreeterMainWindow(Gtk.Window, TranslatableWindow):
def cb_entry_storage_passphrase_changed(self, editable, user_data=None): def cb_entry_storage_passphrase_changed(self, editable, user_data=None):
self.persistent_storage.passphrase_changed(editable) self.persistent_storage.passphrase_changed(editable)
# Only allow starting if the password entry is empty. We used to
# attempt unlocking with the entered password when the "Start Tails"
# button was clicked, but changed that behavior (see #17136), so
# we now force users to click the "Unlock" button first before
# they can click "Start Tails".
allow_start = not bool(editable.get_text())
self.button_start.set_sensitive(allow_start)
return False return False
def cb_infobar_close(self, infobar, user_data=None): def cb_infobar_close(self, infobar, user_data=None):
......
...@@ -27,6 +27,7 @@ class PersistentStorage(object): ...@@ -27,6 +27,7 @@ class PersistentStorage(object):
self.infobar_persistence = builder.get_object('infobar_persistence') self.infobar_persistence = builder.get_object('infobar_persistence')
self.label_infobar_persistence = builder.get_object('label_infobar_persistence') self.label_infobar_persistence = builder.get_object('label_infobar_persistence')
self.spinner_storage_unlock = builder.get_object('spinner_storage_unlock') self.spinner_storage_unlock = builder.get_object('spinner_storage_unlock')
self.button_start = builder.get_object("button_start")
self.checkbutton_storage_show_passphrase.connect('toggled', self.cb_checkbutton_storage_show_passphrase_toggled) self.checkbutton_storage_show_passphrase.connect('toggled', self.cb_checkbutton_storage_show_passphrase_toggled)
...@@ -112,6 +113,7 @@ class PersistentStorage(object): ...@@ -112,6 +113,7 @@ class PersistentStorage(object):
Gtk.IconSize.BUTTON) Gtk.IconSize.BUTTON)
self.image_storage_state.set_visible(True) self.image_storage_state.set_visible(True)
self.box_storage_unlocked.set_visible(True) self.box_storage_unlocked.set_visible(True)
self.button_start.set_sensitive(True)
def cb_checkbutton_storage_show_passphrase_toggled(self, widget): def cb_checkbutton_storage_show_passphrase_toggled(self, widget):
self.entry_storage_passphrase.set_visibility(widget.get_active()) self.entry_storage_passphrase.set_visibility(widget.get_active())
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment