From: Rob H. <for...@us...> - 2002-07-29 17:46:20
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb/File In directory usw-pr-cvs1:/tmp/cvs-serv20989/lib/SandWeb/File Modified Files: Unix.pm Log Message: all locations/filenames should be quoted before being passed to the shell so that we don't encounter problems with spaces in filenames or directories. Index: Unix.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/File/Unix.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -U2 -r1.2 -r1.3 --- Unix.pm 21 Jul 2002 19:54:33 -0000 1.2 +++ Unix.pm 29 Jul 2002 17:46:17 -0000 1.3 @@ -44,5 +44,5 @@ my $raw_file_info = _shell( method => 'execute', - command => "ls -lad $location/$filename", + command => "ls -lad \"$location/$filename\"", ); @@ -104,5 +104,5 @@ my $file_scan = _shell( method => 'execute', - command => "file $location/$filename", + command => "file \"$location/$filename\"", ); @@ -197,5 +197,5 @@ my $create_file = _shell( method => 'execute', - command => "touch $location/$filename", + command => "touch \"$location/$filename\"", ); @@ -213,5 +213,5 @@ my $create_folder = _shell( method => 'execute', - command => "mkdir $location/$filename", + command => "mkdir \"$location/$filename\"", ); @@ -230,5 +230,5 @@ my $result = _shell( method => 'execute', - command => "rm $location/$filename", + command => "rm \"$location/$filename\"", log_obj => $log, ); @@ -255,5 +255,5 @@ my $result = _shell( method => 'execute', - command => "rm -rf $location/$filename", + command => "rm -rf \"$location/$filename\"", log_obj => $log, ); @@ -302,5 +302,5 @@ my $file_scan = _shell( method => 'execute', - command => "mv $location/$filename $location/$tofile", + command => "mv \"$location/$filename\" \"$location/$tofile\"", ); @@ -358,8 +358,7 @@ my $filehandle = _shell( method => 'pipe', - command => "dd of=$location/$filename 1>/dev/null 2>/dev/null", + command => "dd of=\"$location/$filename 1>/dev/null 2>/dev/null\"", ); - #open (FILEHANDLE,"|`dd of=$location/$filename 1>/dev/null 2>/dev/null`"); print $filehandle $contents; close $filehandle; @@ -376,5 +375,5 @@ my $file_contents = _shell( method => 'execute', - command => "cat $location/$filename", + command => "cat \"$location/$filename\"", ); |