--
Felix Schwarz
Dipl.-Informatiker
Gubener Str. 38
10243 Berlin
Germany
www.schwarz.eu - software development and consulting
diff -r 70c6c8cc352b authority/checkers/checkers.py
--- a/authority/checkers/checkers.py Wed Mar 12 16:44:08 2008 +0100
+++ b/authority/checkers/checkers.py Wed Mar 12 16:45:09 2008 +0100
@@ -90,9 +90,6 @@ class HtpasswdChecker(AuthenticationChec
raise NotImplementedError
-from win32security import LogonUser
-from win32security import LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT
-from win32security import error as LogonError
class SMBChecker(AuthenticationChecker):
@@ -108,6 +105,9 @@ class SMBChecker(AuthenticationChecker):
# set default domain? config-provided or user-provided?
def check_credentials(self, cred):
+ from win32security import LogonUser
+ from win32security import LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT
+ from win32security import error as LogonError
try:
token = LogonUser(cred['user'],
cred['domain'],
If you put the imports in __init__ the symbol LogonUser (and others) are
not available in check_credentials(). The best solution (IMHO) would be to
split the current checkers module so that the Windows-specific stuff is
encapsulated in its own module so that all other tests will work on a
non-Windows OS.