[PATCH] warn if vnc passwd is longer than 8 chars

Vratislav Podzimek vpodzime at redhat.com
Tue Nov 12 07:23:33 UTC 2013


On Mon, 2013-11-11 at 20:26 -0600, Mark Hamzy wrote:
> VNC passwords can be no longer than 8 characters.  If more than 8 characters are
> used then only the first 8 will match which will cause a security issue.
> 
> ---
>  pyanaconda/ui/tui/spokes/askvnc.py | 4 ++++
>  pyanaconda/vnc.py                  | 9 +++++----
>  2 files changed, 9 insertions(+), 4 deletions(-)
> 
> diff --git a/pyanaconda/ui/tui/spokes/askvnc.py b/pyanaconda/ui/tui/spokes/askvnc.py
> index d97763e..181778d 100644
> --- a/pyanaconda/ui/tui/spokes/askvnc.py
> +++ b/pyanaconda/ui/tui/spokes/askvnc.py
> @@ -146,6 +146,10 @@ class VNCPassSpoke(NormalTUISpoke):
>              print _("The password must be at least "
>                      "six characters long.")
>              return None
> +        elif len(p1) > 8:
> +            print _("The password cannot be more than "
> +                    "eight characters long.")
> +            return None
>          else:
>              self._password = p1
>              self.apply()
> diff --git a/pyanaconda/vnc.py b/pyanaconda/vnc.py
> index 85b729b..55c7055 100644
> --- a/pyanaconda/vnc.py
> +++ b/pyanaconda/vnc.py
> @@ -199,7 +199,7 @@ class VncServer:
>              stdoutLog.critical("Could not initialize the VNC server: %s", e)
>              sys.exit(1)
>  
> -        if self.password and len(self.password) < 6:
> +        if self.password and (len(self.password) < 6 or len(self.password) > 8):
>              self.changeVNCPasswdWindow()
>  
>          if not self.password:
> @@ -262,11 +262,12 @@ class VncServer:
>      def changeVNCPasswdWindow(self):
>          """ Change the password to a sane parameter.
>  
> -        We ask user to input a password that len(password) > 6
> -        or password == ''.
> +        We ask user to input a password that (len(password) > 6
> +        and len(password) <= 8) or password == ''.
>          """
>  
> -        message = _("VNC password provided was not at least 6 characters long.\n"
> +        message = _("VNC password provided was not at least 6 characters long. "
> +                    "or more than 8 characters long.\n"
>                      "Please enter a new one.  Leave blank for no password.")
>          app = App("VNC PASSWORD")
>          spoke = VNCPassSpoke(app, self.anaconda.ksdata, None, None, None,
Looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list