The branch, master has been updated
via 57030875e10c269c360ac2b1c1623b9f427d6714 (commit)
via 00034ba69ecca2523dc6ad1b5b16f9952508683c (commit)
via 14f559e001506c6aefb74a8c8c74470ab2dc3963 (commit)
via 3acbb6d354fe3421197a568004bb135c7b6612bf (commit)
via 241a6ba9de4baaa0fda547636ce29578c24ff5bd (commit)
from 1f3029121c54e02b5db037f448dfa79435702b6b (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 -----------------------------------------------------------------
commit 57030875e10c269c360ac2b1c1623b9f427d6714
Author: Mike Gabriel <mike.gabriel(a)das-netzwerkteam.de>
Date: Wed Nov 21 17:02:54 2012 +0100
start serious work on the zeroconf broker
commit 00034ba69ecca2523dc6ad1b5b16f9952508683c
Author: Mike Gabriel <mike.gabriel(a)das-netzwerkteam.de>
Date: Wed Nov 21 17:02:38 2012 +0100
Make sure libx2go-broker-perl of the same version gets installed with x2gobroker-common. Add dependencies: libauthen-pam-perl, libauthen-simple-pam-perl.
commit 14f559e001506c6aefb74a8c8c74470ab2dc3963
Author: Mike Gabriel <mike.gabriel(a)das-netzwerkteam.de>
Date: Tue Nov 13 19:55:22 2012 +0100
fix x2gobroker-common.install
commit 3acbb6d354fe3421197a568004bb135c7b6612bf
Author: Mike Gabriel <mike.gabriel(a)das-netzwerkteam.de>
Date: Tue Nov 13 19:53:27 2012 +0100
Using our own PAM service ,,x2gobroker''.
commit 241a6ba9de4baaa0fda547636ce29578c24ff5bd
Author: Mike Gabriel <mike.gabriel(a)das-netzwerkteam.de>
Date: Tue Nov 13 19:51:33 2012 +0100
fix project name
-----------------------------------------------------------------------
Summary of changes:
X2Go/Broker/ZeroConf.pm | 50 ++++++++++++++++++++++----------------
cgi/x2gobroker.cgi | 14 +++++------
debian/changelog | 6 ++++-
debian/control | 3 +++
debian/x2gobroker-common.install | 2 +-
debian/x2gobroker.pam | 2 ++
lib/x2gobroker-agent.pl | 6 ++---
7 files changed, 49 insertions(+), 34 deletions(-)
create mode 100644 debian/x2gobroker.pam
The diff of changes is:
diff --git a/X2Go/Broker/ZeroConf.pm b/X2Go/Broker/ZeroConf.pm
index 0655191..da4eb98 100644
--- a/X2Go/Broker/ZeroConf.pm
+++ b/X2Go/Broker/ZeroConf.pm
@@ -21,7 +21,7 @@
package X2Go::Broker::ZeroConf;
use strict;
-use Sys:Hostname;
+use Sys::Hostname;
use Authen::PAM;
use Authen::Simple::PAM;
use X2Go::Broker::Common;
@@ -38,13 +38,16 @@ my $hostname = hostname;
### public functions, available to broker cgi
###
+my $username;
+my $password;
+
### exported function ###
sub CheckAccess
{
# zeroconf broker: use PAM to perform authentication against
# the local PAM login module
- my ($user,$pass)=@_;
- my $pam = Authen::Simple::PAM->new(service => 'login');
+ ($username, $password)=@_;
+ my $pam = Authen::Simple::PAM->new(service => 'x2gobroker');
if ( $pam->authenticate( $username, $password ) ) {
# successfull authentication
return 0
@@ -63,11 +66,11 @@ sub SetPass
my ($username, $oldpassword, $newpassword)=@_;
# zeroconf broker: use PAM to initiate a local passwd change
- my $service = "passwd";
- ref($pamh = new Authen::PAM($service, $username, \&passwd_conv_func)) ||
- die "Error code $pamh during PAM init!";
- $state = 0;
- $res = $pamh->pam_chauthtok;
+ my $service = "x2gobroker";
+ my $pamh = new Authen::PAM($service, $username, \&passwd_conv_func) ||
+ die "Error code \$pamh during PAM init!";
+ my $state = 0;
+ my $res = $pamh->pam_chauthtok;
die $pamh->pam_strerror($res) unless $res == PAM_SUCCESS();
print "\n<br>CHANGING PASS OK<br>\n";
@@ -76,16 +79,16 @@ sub SetPass
### exported function ###
sub SelectSession
{
- my ($user, $sid)=@_;
- my @words=split("\@",$sid);
+ my ($user, $session_id)=@_;
+ my @words=split("\@",$session_id);
###
- ### FIXME: why the heck is the $sid format <host>@<session>,
+ ### FIXME: why the heck is the $session_id format <host>@<session>,
### <session>@<host> would make much more sense!!! (for
### the human eye...)
###
- my $sess_id=@words[1];
+ my $session_id=@words[1];
my $host=@words[0];
- check_and_start_session($user, $host, $sess_id);
+ check_and_start_session($user, $host, $session_id);
}
### exported function ###
@@ -93,15 +96,15 @@ sub ListSessions
{
# print Dumper($message->entries);
print "START_USER_SESSIONS<br>";
- my($status,$sessions)=CallBrokerAgent($hostname, $user, 'listsessions');
+ my($status,$sessions)=CallBrokerAgent($hostname, $username, 'listsessions');
if ( $status )
{
if($sessions)
{
my @sinfo = split("\\|",$sessions);
my $session_status = @sinfo[4];
- my $sid = @sinfo[1];
- print "<br>[$hostname\@$sid]<br>";
+ my $session_id = @sinfo[1];
+ print "<br>[$hostname\@$session_id]<br>";
print "status=$session_status<br>";
} else {
print "<br>[$hostname]<br>";
@@ -121,6 +124,10 @@ sub passwd_conv_func {
my $code = shift;
my $msg = shift;
my $ans = "";
+ my $state;
+
+ my $oldpassword;
+ my $newpassword;
$ans = $username if ( $code == PAM_PROMPT_ECHO_ON() );
if ( $code == PAM_PROMPT_ECHO_OFF() ) {
@@ -137,8 +144,9 @@ sub passwd_conv_func {
sub check_and_start_session
{
- my ($uid, $host, $sid) = @_;
- my ($status, $sessions)=ExecRemoteBroker($user, $hostname, 'listsessions');
+ my ($username, $hostname, $session_id) = @_;
+ my $running;
+ my ($status, $sessions)=ExecRemoteBroker($username, $hostname, 'listsessions');
if ( ! $status )
{
print "ERROR: X2Go server not available\n";
@@ -151,12 +159,12 @@ sub check_and_start_session
my @sinfo = split("\\|",$sessions);
my $session_status = @sinfo[4];
my $session_server = @sinfo[3];
- $sid=@sinfo[1];
+ $session_id=@sinfo[1];
if( $session_status eq 'R' )
{
$running = 1;
my $str;
- ($status, $str) = ExecRemoteBroker($uid, $hostname, "suspend $sid");
+ ($status, $str) = ExecRemoteBroker($username, $hostname, "suspend $session_id");
$sessions =~ s/\|R\|/\|S\|/;
}
if( $session_status eq 'S' )
@@ -165,7 +173,7 @@ sub check_and_start_session
}
}
- print "SERVER:$hostname:$port\n";
+ print "SERVER:$hostname\n";
if($running)
{
# use first session in session list...
diff --git a/cgi/x2gobroker.cgi b/cgi/x2gobroker.cgi
index 06ed66b..3d44d52 100755
--- a/cgi/x2gobroker.cgi
+++ b/cgi/x2gobroker.cgi
@@ -24,15 +24,13 @@ use strict;
use File::Basename qw(basename);
my $cgi_name = basename($0);
-my $broker_backend ~= s/x2gobroker-(.*)\.cgi/\1/
+my $broker_backend = $cgi_name;
+$broker_backend =~ s/x2gobroker-(.*)\.cgi/\1/;
-use lib "/usr/lib/x2go/";
-use lib "/usr/lib/x2go/broker/";
-
-switch ( $broker_backend ) {
- case 'zeroconf' { use X2Go::Broker::ZeroConf qw(CheckAccess SetPass SelectSession ListSessions) }
- case 'simple' { use X2Go::Broker::Simple qw(CheckAccess SetPass SelectSession ListSessions) }
- case 'ldap' { use X2Go::Broker::LDAP qw(CheckAccess SetPass SelectSession ListSessions) }
+SWITCH: {
+ $broker_backend == "zeroconf" && do { use X2Go::Broker::ZeroConf qw(CheckAccess SetPass SelectSession ListSessions); last SWITCH; };
+# $broker_backend == "simple" && do { use X2Go::Broker::Simple qw(CheckAccess SetPass SelectSession ListSessions); last SWITCH; };
+# $broker_backend == "ldap" && do { use X2Go::Broker::LDAP qw(CheckAccess SetPass SelectSession ListSessions); last SWITCH; };
}
use CGI;
diff --git a/debian/changelog b/debian/changelog
index ce356c8..42e3641 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,9 +1,13 @@
x2gobroker (0.0.0.1-0~x2go1) UNRELEASED; urgency=low
[ Mike Gabriel ]
- * Setting up new public X2Go project: x2gohttpbroker.
+ * Setting up new public X2Go project: x2gobroker.
+ - Using our own PAM service ,,x2gobroker''.
* /debian/control:
+ Add an initial dependency selection to the various Depends fields.
+ + Make sure libx2go-broker-perl of the same version gets installed
+ with x2gobroker-common.
+ + Add dependencies: libauthen-pam-perl, libauthen-simple-pam-perl.
* Fix code indentations (spaces replaced by tabs, use proper indentation
levels).
diff --git a/debian/control b/debian/control
index c58792f..3381442 100644
--- a/debian/control
+++ b/debian/control
@@ -43,6 +43,7 @@ Package: x2gobroker-common
Architecture: all
Depends:
${misc:Depends},
+ libx2go-broker-perl (>= ${source:Version}), libx2go-broker-perl (<< ${source:Version}.1~),
Description: X2Go http(s) based session broker (common files)
X2Go is a serverbased computing environment with
- session resuming
@@ -133,6 +134,8 @@ Depends:
apache2 | httpd,
perl,
x2gobroker-common (>= ${source:Version}), x2gobroker-common (<< ${source:Version}.1~),
+ libauthen-pam-perl,
+ libauthen-simple-pam-perl,
Description: X2Go http(s) session broker (for demo purposes only)
X2Go is a serverbased computing environment with
- session resuming
diff --git a/debian/x2gobroker-common.install b/debian/x2gobroker-common.install
index 59f3588..e9793a9 100644
--- a/debian/x2gobroker-common.install
+++ b/debian/x2gobroker-common.install
@@ -1 +1 @@
-cgi/x2gobroker.cgi usr/lib/cgi-bin/
\ No newline at end of file
+cgi/x2gobroker.cgi usr/lib/cgi-bin/
diff --git a/debian/x2gobroker.pam b/debian/x2gobroker.pam
new file mode 100644
index 0000000..1eaad76
--- /dev/null
+++ b/debian/x2gobroker.pam
@@ -0,0 +1,2 @@
+@include common-auth
+@include common-passwd
diff --git a/lib/x2gobroker-agent.pl b/lib/x2gobroker-agent.pl
index 02b6b04..0d5b559 100755
--- a/lib/x2gobroker-agent.pl
+++ b/lib/x2gobroker-agent.pl
@@ -95,7 +95,7 @@ if($mode eq 'listsessions')
{
InitX2GoUser($name, $uid, $gid, $home);
print "OK\n";
- system "/bin/su", $name, "-c", "x2golistsessions --all-servers";
+ system "/bin/su - ", $name, "-c", "x2golistsessions --all-servers";
}
@@ -103,7 +103,7 @@ if($mode eq 'getservers')
{
InitX2GoUser($name, $uid, $gid, $home);
print "OK\n";
- system "/bin/su", $name, "-c", "x2gogetservers";
+ system "/bin/su - ", $name, "-c", "x2gogetservers";
}
if($mode eq 'key')
@@ -118,7 +118,7 @@ if($mode eq 'suspend')
InitX2GoUser($name, $uid, $gid, $home);
print "OK\n";
my $sid=shift;
- system "/bin/su", $name, "-c", "x2gosuspend-session $sid";
+ system "/bin/su - ", $name, "-c", "x2gosuspend-session $sid";
}
if($mode eq 'ping')
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).