From: Rob H. <for...@us...> - 2002-11-07 08:01:44
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv15989/lib/SandWeb Modified Files: Repository.pm Shell.pm Log Message: this checkin enables : * vcs password support for tag/branch * security problem with sandweb-expect ( password showing up in process list ) is solved Index: Repository.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Repository.pm,v retrieving revision 1.46 retrieving revision 1.47 diff -U2 -r1.46 -r1.47 --- Repository.pm 19 Jun 2002 07:19:04 -0000 1.46 +++ Repository.pm 7 Nov 2002 08:01:06 -0000 1.47 @@ -48,4 +48,8 @@ my $sandbox = $args{'sandbox'} || ''; + # $users_dir specifies user's SandWeb home directory + + my $users_dir = $args{'users_dir'} || ''; + # $server specifies the hostname of the current repo server @@ -94,4 +98,5 @@ 'root' => $root, 'sandbox' => $sandbox, + 'users_dir' => $users_dir, 'connection' => $connection, 'server' => $server, @@ -901,4 +906,5 @@ my $root = $self->get_root() || ''; my $sandbox = $self->get_sandbox() || ''; + my $users_dir = $self->get_users_dir() || ''; my $connection = $self->get_connection(); my $server = $self->get_server(); @@ -922,4 +928,5 @@ root => $root, sandbox => $sandbox, + users_dir => $users_dir, connection => $connection, server => $server, @@ -1020,4 +1027,14 @@ if ($self->{'sandbox'}) { return $self->{'sandbox'}; + } + else { + return 0; + } +} + +sub get_users_dir { + my $self = shift; + if ($self->{'users_dir'}) { + return $self->{'users_dir'}; } else { Index: Shell.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Shell.pm,v retrieving revision 1.20 retrieving revision 1.21 diff -U2 -r1.20 -r1.21 --- Shell.pm 5 Oct 2002 18:35:48 -0000 1.20 +++ Shell.pm 7 Nov 2002 08:01:07 -0000 1.21 @@ -28,4 +28,6 @@ package SandWeb::Shell; +use SandWeb::File; + sub new { my $class = shift; @@ -42,4 +44,7 @@ my $system_password = $args{'system_password'} || ''; + # users_dir is the user's SandWeb home directory ( required ) + my $users_dir = $args{'users_dir'} || ''; + # vcs_username is the user's VCS username on the local box # ( optional ) @@ -65,4 +70,5 @@ 'system_username' => "$system_username", 'system_password' => "$system_password", + 'users_dir' => "$users_dir", 'vcs_username' => "$vcs_username", 'vcs_password' => "$vcs_password", @@ -92,4 +98,5 @@ my $vcs_password = $self->{'vcs_password'}; my $system = $self->{'system'} || ''; + my $users_dir = $self->{'users_dir'} || ''; my $vcs = $self->{'vcs'} || ''; my $log = $self->{'log'} || ''; @@ -126,5 +133,17 @@ } elsif ( $vcs ) { $log->debug("Using VCS username/password"); - my $raw_output = `$sandweb_expect vcs \'$vcs_password\' "$command" 2>&1`; + my $file = SandWeb::File->new( + 'log_obj' => $log, + 'filename' => "passwd", + 'location' => "$users_dir", + ); + + $file->file_write( + contents => "$vcs_password", + ); + + my $raw_output = `$sandweb_expect vcs $users_dir/passwd "$command" 2>&1`; + $file->delete(); + $error = $?; $raw_output =~ s/^M/\n/g; |