[X2Go-Commits] x2gobroker.git - build-main (branch) updated: 0.0.0.5-49-g9fcd218
X2Go dev team
git-admin at x2go.org
Sun May 19 13:03:23 CEST 2013
The branch, build-main has been updated
via 9fcd2186c96f07d41302fae68112e9b3dd7fb66e (commit)
from 838bdf9fccfd43bae4b23ccc141d75fccaeaa7de (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
-----------------------------------------------------------------------
Summary of changes:
debian/changelog | 3 +++
x2gobroker/authmechs/pam_authmech.py | 17 ++++++++++++++---
2 files changed, 17 insertions(+), 3 deletions(-)
The diff of changes is:
diff --git a/debian/changelog b/debian/changelog
index 57c160d..0bc27b3 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,9 @@ x2gobroker (0.0.0.6-0~x2go1) UNRELEASED; urgency=low
- Rewrite empty user parameter in session profile. Fill in
the UID that has been used for broker authentication.
- Implement session autologin feature.
+ - If X2Go Session Broker's PAM Auth Service is not available, try to
+ fallback to direct PAM authentication (only works if x2gobroker
+ runs as super-user root).
* /debian/*.default:
- Be more explanatory about the X2GOBROKER_DEBUG option and allow
to enable debug mode for the different services independently.
diff --git a/x2gobroker/authmechs/pam_authmech.py b/x2gobroker/authmechs/pam_authmech.py
index b46d1a2..7ea2023 100644
--- a/x2gobroker/authmechs/pam_authmech.py
+++ b/x2gobroker/authmechs/pam_authmech.py
@@ -18,15 +18,26 @@
# Free Software Foundation, Inc.,
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+# modules
+from socket import error
+import pam
+
+# X2Go Session Broker modules
import x2gobroker.authservice
class X2GoBrokerAuthMech(object):
def authenticate(self, username, password):
- # do a simple PAM authentication against the PAM service ,,x2gobroker''
if username and password:
- if x2gobroker.authservice.authenticate(username, password, service="x2gobroker"):
- return True
+ try:
+ # query the X2Go Session Broker's PAM Auth Service
+ if x2gobroker.authservice.authenticate(username, password, service="x2gobroker"):
+ return True
+
+ except error:
+ # fallback to direct PAM authentication against the PAM service ,,x2gobroker''
+ if pam.authenticate(username, password, service="x2gobroker"):
+ return True
return False
hooks/post-receive
--
x2gobroker.git (HTTP(S) Session broker for X2Go)
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "x2gobroker.git" (HTTP(S) Session broker for X2Go).
More information about the x2go-commits
mailing list