[CalendarServer-changes] [3662] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 12 13:33:03 PST 2009


Revision: 3662
          http://trac.macosforge.org/projects/calendarserver/changeset/3662
Author:   sagen at apple.com
Date:     2009-02-12 13:33:02 -0800 (Thu, 12 Feb 2009)
Log Message:
-----------
Lookup keychain items by account, rather than label

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/config.py
    CalendarServer/trunk/twistedcaldav/util.py

Modified: CalendarServer/trunk/twistedcaldav/config.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/config.py	2009-02-12 19:28:02 UTC (rev 3661)
+++ CalendarServer/trunk/twistedcaldav/config.py	2009-02-12 21:33:02 UTC (rev 3662)
@@ -654,7 +654,7 @@
                 # Get password from keychain.  If not there, fall back to what
                 # is in the plist.
                 try:
-                    password = getPasswordFromKeychain("icalserver.xmpp")
+                    password = getPasswordFromKeychain(service["JID"])
                     service["Password"] = password
                     log.info("XMPP password successfully retreived from keychain")
                 except KeychainAccessError:

Modified: CalendarServer/trunk/twistedcaldav/util.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/util.py	2009-02-12 19:28:02 UTC (rev 3661)
+++ CalendarServer/trunk/twistedcaldav/util.py	2009-02-12 21:33:02 UTC (rev 3662)
@@ -137,12 +137,12 @@
 
 passwordRegExp = re.compile(r'password: "(.*)"')
 
-def getPasswordFromKeychain(label):
+def getPasswordFromKeychain(account):
     if os.path.isfile("/usr/bin/security"):
         child = Popen(
             args=[
                 "/usr/bin/security", "find-generic-password",
-                "-l", label, "-g",
+                "-a", account, "-g",
             ],
             stdout=PIPE, stderr=STDOUT,
         )
@@ -153,7 +153,7 @@
         else:
             match = passwordRegExp.search(output)
             if not match:
-                error = "Password for %s not found in keychain" % (label,)
+                error = "Password for %s not found in keychain" % (account,)
                 raise KeychainPasswordNotFound(error)
             else:
                 return match.group(1)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20090212/6f7b3717/attachment.html>


More information about the calendarserver-changes mailing list