Ticket #3871: fix

File fix, 1.5 KB (added by exarkun, 5 years ago)
Line 
1Index: twisted/conch/tap.py
2===================================================================
3--- twisted/conch/tap.py        (revision 26975)
4+++ twisted/conch/tap.py        (working copy)
5@@ -16,8 +16,13 @@
6 from twisted.cred import portal
7 from twisted.python import usage
8 from twisted.application import strports
9+try:
10+    from twisted.cred import pamauth
11+except ImportError:
12+    pamauth = None
13+else:
14+    from twisted.cred.checkers import PluggableAuthenticationModulesChecker
15 
16-
17 class Options(usage.Options):
18     synopsis = "[-i <interface>] [-p <port>] [-d <dir>] "
19     longdesc = "Makes a Conch SSH server."
20@@ -36,8 +41,8 @@
21     t.portal = portal.Portal(unix.UnixSSHRealm())
22     t.portal.registerChecker(checkers.UNIXPasswordDatabase())
23     t.portal.registerChecker(checkers.SSHPublicKeyDatabase())
24-    if checkers.pamauth:
25-        t.portal.registerChecker(checkers.PluggableAuthenticationModulesChecker())
26+    if pamauth is not None:
27+        t.portal.registerChecker(PluggableAuthenticationModulesChecker())
28     t.dataRoot = config['data']
29     t.moduliRoot = config['moduli'] or config['data']
30     port = config['port']
31Index: twisted/conch/checkers.py
32===================================================================
33--- twisted/conch/checkers.py   (revision 26975)
34+++ twisted/conch/checkers.py   (working copy)
35@@ -20,11 +20,6 @@
36 except:
37     shadow = None
38 
39-try:
40-    from twisted.cred import pamauth
41-except ImportError:
42-    pamauth = None
43-
44 from zope.interface import implements, providedBy
45 
46 from twisted.conch import error