[X2Go-Commits] [x2gobroker] 01/01: Regression fix for d68ec35. Use hasattr() to properly test structure of pam module (required for ABI/API changes upstream).

git-admin at x2go.org git-admin at x2go.org
Mon Feb 13 13:43:38 CET 2017


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository x2gobroker.

commit 60db077d1a216c529807c41648b882791da0fc69
Author: Mike Gabriel <mike.gabriel at das-netzwerkteam.de>
Date:   Mon Feb 13 13:43:26 2017 +0100

    Regression fix for d68ec35. Use hasattr() to properly test structure of pam module (required for ABI/API changes upstream).
---
 debian/changelog                     |    3 +++
 sbin/x2gobroker-authservice          |    2 +-
 x2gobroker/authmechs/pam_authmech.py |    2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 97f905a..be96b10 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,12 @@
 x2gobroker (0.0.3.2-0x2go1) UNRELEASED; urgency=medium
 
+  [ Mike Gabriel ]
   * debian/x2gobroker-loadchecker.service:
     + Fix flawed symlink actually still pointing to the authservice's
       service file. Thanks to Niels Rogalla for spotting this.
       (Fixes: #1141).
+  * Regression fix for d68ec35. Use hasattr() to properly test structure
+    of pam module (required for ABI/API changes upstream).
 
  -- X2Go Release Manager <git-admin at x2go.org>  Thu, 01 Dec 2016 23:07:26 +0100
 
diff --git a/sbin/x2gobroker-authservice b/sbin/x2gobroker-authservice
index 00decb1..5d56f14 100755
--- a/sbin/x2gobroker-authservice
+++ b/sbin/x2gobroker-authservice
@@ -79,7 +79,7 @@ class AuthClient(asyncore.dispatcher_with_send):
                 self.logger.warning('bad authentication data received')
             else:
                 opam = pam
-                if pam.pam:
+                if hasattr(pam, "pam"):
                     opam = pam.pam()
                 if opam.authenticate(user, passwd, service):
                     self.send('ok\n')
diff --git a/x2gobroker/authmechs/pam_authmech.py b/x2gobroker/authmechs/pam_authmech.py
index 038be70..b6ff7db 100644
--- a/x2gobroker/authmechs/pam_authmech.py
+++ b/x2gobroker/authmechs/pam_authmech.py
@@ -41,7 +41,7 @@ class X2GoBrokerAuthMech(object):
                 logger_error.error('Make sure the current user ({user}) is allowed to use the PAM authentication mechanism.'.format(user=getpass.getuser()))
                 # fallback to direct PAM authentication against the PAM service ,,x2gobroker''
                 opam = pam
-                if pam.pam:
+                if hasattr(pam, pam):
                     opam = pam.pam()
                 if opam.authenticate(username, password, service="x2gobroker"):
                     return True

--
Alioth's /srv/git/code.x2go.org/x2gobroker.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2gobroker.git


More information about the x2go-commits mailing list