Security declaration of non-existing method

Bug #1221624 reported by Thomas Rasmussen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Products.LDAPUserFolder
Fix Committed
Low
Unassigned

Bug Description

I was installing LDAPUserFolder 2.26 on Centos 6.4 (Zenoss 4.2.4 guide on http://blogs.oregonstate.edu/sig/2013/03/28/enabling-ldap-authentication-in-zenoss-core-4-2-and-centos-6/). I was getting these errors when restarting zenoss:

WARNING:Init:Class Products.LDAPUserFolder.LDAPUserFolder.LDAPUserFolder has a security declaration for nonexistent method 'getEncryptedPassword'

I was browsing through the code for LDAPUserFolder and noticed a inconsistency (for what I could understand). In Products.LDAPUserFolder-2.26-py2.7.egg/Products/LDAPUserFolder/LDAPUserFolder.py

  security.declareProtected(manage_users, 'getEncryptedPassword')
  def getEncryptedBindPassword(self):
         """ Return a hashed bind password for safe use in forms etc.
         """
         return sha_new(self.getProperty('_bindpwd')).hexdigest()

It seems as though this was the cause for the error, so I changed the def call to getEncryptedPassword and made a new local version (2.26.1) and installed this via easy_install and now the warning has disappeared.

This is a patch I have made:
--- Products.LDAPUserFolder-2.26-py2.7.egg/Products/LDAPUserFolder/LDAPUserFolder.py 2013-09-06 10:04:44.096130439 +0200
+++ Products.LDAPUserFolder-2.26.1-py2.7.egg/Products/LDAPUserFolder/LDAPUserFolder.py 2013-09-06 10:18:16.864130359 +0200
@@ -1991,7 +1991,7 @@
         return getattr(conn, '_uri', '-- not connected --')

     security.declareProtected(manage_users, 'getEncryptedPassword')
- def getEncryptedBindPassword(self):
+ def getEncryptedPassword(self):
         """ Return a hashed bind password for safe use in forms etc.
         """
         return sha_new(self.getProperty('_bindpwd')).hexdigest()

Revision history for this message
Jens Vagelpohl (dataflake-deactivatedaccount-deactivatedaccount) wrote :

Thanks for the report.

The messages you saw were warnings, not errors, they don't affect the functionality in any way.

Your patch has a serious issue. You rename the method but you apparently never touched those places where the method is called to change the invocation.

A much simpler and less dangerous solution is to change the method name in the security declaration.

I have checked in a fix:

https://git.dataflake.org/cgit/Products.LDAPUserFolder/commit/?id=c00a65db32d318080b0e7701fa668eed48ccb05c

Changed in ldapuserfolder:
importance: Undecided → Low
assignee: nobody → Jens Vagelpohl (dataflake)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.