From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal Novotny Subject: [PATCH] Correct pygrub return value Date: Mon, 14 Sep 2009 09:44:28 +0200 Message-ID: <4AADF45C.70408@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070103050004060408070606" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "'xen-devel@lists.xensource.com'" List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------070103050004060408070606 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Michal --------------070103050004060408070606 Content-Type: text/x-patch; name="xen-pygrub-password-support-return-value-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen-pygrub-password-support-return-value-fix.patch" 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) --------------070103050004060408070606 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --------------070103050004060408070606--