All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Novotny <minovotn@redhat.com>
To: "'xen-devel@lists.xensource.com'" <xen-devel@lists.xensource.com>
Subject: [PATCH] Correct pygrub return value
Date: Mon, 14 Sep 2009 09:44:28 +0200	[thread overview]
Message-ID: <4AADF45C.70408@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 409 bytes --]

Hi,
this is the patch to correct pygrub return value for checkPassword() 
function. It didn't return False at the end of the function. It returned 
None so it was working fine and it's most likely just a cosmetic issue.

Also, the missing () were added to checkPassword() function when calling 
hasPassword and the unnecessary comment was removed.

Signed-off-by: Michal Novotny <minovotn@redhat.com>

Michal

[-- Attachment #2: xen-pygrub-password-support-return-value-fix.patch --]
[-- Type: text/x-patch, Size: 878 bytes --]

diff -r d2a32e24fe50 tools/pygrub/src/GrubConf.py
--- a/tools/pygrub/src/GrubConf.py	Wed Sep 09 16:39:41 2009 +0100
+++ b/tools/pygrub/src/GrubConf.py	Mon Sep 14 09:41:58 2009 +0200
@@ -220,10 +220,9 @@ class GrubConfigFile(object):
 
     def checkPassword(self, password):
         # Always allow if no password defined in grub.conf
-        if not self.hasPassword:
+        if not self.hasPassword():
             return True
 
-        # If we're here, we're having 'password' attribute set
         pwd = getattr(self, 'password').split()
 
         # We check whether password is in MD5 hash for comparison
@@ -239,6 +238,8 @@ class GrubConfigFile(object):
         # ... and if not, we compare it as a plain text
         if pwd[0] == password:
             return True
+
+        return False
 
     def set(self, line):
         (com, arg) = grub_exact_split(line, 2)

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel

                 reply	other threads:[~2009-09-14  7:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AADF45C.70408@redhat.com \
    --to=minovotn@redhat.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.