* [PATCH] Correct pygrub return value
@ 2009-09-14 7:44 Michal Novotny
0 siblings, 0 replies; only message in thread
From: Michal Novotny @ 2009-09-14 7:44 UTC (permalink / raw)
To: 'xen-devel@lists.xensource.com'
[-- 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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-09-14 7:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-14 7:44 [PATCH] Correct pygrub return value Michal Novotny
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.