[PATCH] Clear the kickstart password if cleared by the user (#1133185)

Martin Kolman mkolman at redhat.com
Fri Sep 5 20:34:29 UTC 2014



----- Original Message -----
> From: "David Shea" <dshea at redhat.com>
> To: anaconda-patches at lists.fedorahosted.org
> Sent: Friday, September 5, 2014 10:28:10 PM
> Subject: [PATCH] Clear the kickstart password if cleared by the user (#1133185)
> 
> If the user re-enters the password spoke and clears the password,
> for-real clear the password instead of leaving it blank in the UI and
> set in ksdata. Treat empty passwords in the TUI as unset passwords.
> ---
>  pyanaconda/ui/gui/spokes/password.py | 14 +++++++++-----
>  pyanaconda/ui/tui/spokes/__init__.py |  5 +++++
>  2 files changed, 14 insertions(+), 5 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/password.py
> b/pyanaconda/ui/gui/spokes/password.py
> index ee2da7d..77fd2b1 100644
> --- a/pyanaconda/ui/gui/spokes/password.py
> +++ b/pyanaconda/ui/gui/spokes/password.py
> @@ -130,16 +130,20 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke,
> GUISpokeInputCheckHandler)
>  
>      def apply(self):
>          pw = self.pw.get_text()
> +
> +        # value from the kickstart changed
> +        self.data.rootpw.seen = False
> +        self._kickstarted = False
> +
> +        self.data.rootpw.lock = False
> +
>          if not pw:
> +            self.data.rootpw.password = None
> +            self.data.rootpw.isCrypted = False
>              return
>  
>          self.data.rootpw.password = cryptPassword(pw)
>          self.data.rootpw.isCrypted = True
> -        self.data.rootpw.lock = False
> -
> -        # value from the kickstart changed
> -        self.data.rootpw.seen = False
> -        self._kickstarted = False
>  
>          self.pw.set_placeholder_text("")
>          self.confirm.set_placeholder_text("")
> diff --git a/pyanaconda/ui/tui/spokes/__init__.py
> b/pyanaconda/ui/tui/spokes/__init__.py
> index dd27350..4f72600 100644
> --- a/pyanaconda/ui/tui/spokes/__init__.py
> +++ b/pyanaconda/ui/tui/spokes/__init__.py
> @@ -130,6 +130,11 @@ class EditTUIDialog(NormalTUISpoke):
>                  print(_(PASSWORD_CONFIRM_ERROR_TUI))
>                  return None
>  
> +            # If an empty password was provided, unset the value
> +            if not pw:
> +                self.value = ""
> +                return None
> +
>              valid, strength, message = validatePassword(pw, user=None)
>  
>              if not valid:
> --
> 2.0.0
ACK!

> 
> _______________________________________________
> anaconda-patches mailing list
> anaconda-patches at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/anaconda-patches
> 


More information about the anaconda-patches mailing list