Update of /cvsroot/sandweb/sandweb/lib/SandWeb/Auth
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10516/SandWeb/Auth
Modified Files:
Unix.pm
Log Message:
remove hardcoded paths.
I think we should start passing around a config object, or something, instead of passing just the params that objects need.. it requires us to know way too much about the objects we're creating.
Index: Unix.pm
===================================================================
RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Auth/Unix.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -U2 -r1.1 -r1.2
--- Unix.pm 8 Jul 2003 22:07:51 -0000 1.1
+++ Unix.pm 21 Dec 2004 06:27:02 -0000 1.2
@@ -88,6 +88,12 @@
my $class = shift;
my %args = @_;
+
+ # bindir is the full path on the local box to SandWeb's scripts, like
+ # sandweb-expect and sandweb-admin
+ my $bindir = $args{'bindir'} || '';
my $self = bless {
+ 'bindir' => $bindir,
+ 'ssh_bin' => $ssh_bin,
'user_info' => {},
'_log_obj' => $args{'log_obj'},
@@ -179,4 +185,7 @@
my %args = @_;
+ my $bindir = "$self->{'bindir'}";
+ my $ssh_bin = "$self->{'ssh_bin'}";
+
my $username = $args{'username'} || '';
my $password = $args{'password'} || '';
@@ -191,5 +200,5 @@
my $shell = SandWeb::Shell->new(
'system_timeout' => "100",
- 'bindir' => "/usr/bin",
+ 'bindir' => "/usr/local/bin",
'vcs_username' => "$username",
'users_dir' => "$users_dir/$username",
@@ -199,6 +208,7 @@
);
- $log->debug('command' => "export SSH_BIN=/usr/bin/ssh && /usr/bin/sandweb-ssh $username\@localhost echo success");
- my %return = $shell->execute('command' => "export SSH_BIN=/usr/bin/ssh && /usr/bin/sandweb-ssh $username\@localhost echo success");
+ my $command = "export SSH_BIN=$ssh_bin && $bindir/sandweb-ssh $username\@localhost echo success";
+ $log->debug('command' => "$command");
+ my %return = $shell->execute('command' => "$command");
return %return;
|