Commit f7231615 authored by Leigh Stoller's avatar Leigh Stoller

Fix for changes in realpath between 9.0 and 9.3.

parent 3573d782
#!/usr/bin/perl -wT
#!/usr/bin/perl -w
#
# Copyright (c) 2003-2012 University of Utah and the Flux Group.
# Copyright (c) 2003-2014 University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
......@@ -24,6 +24,7 @@
use English;
use Getopt::Std;
use BSD::Resource;
use File::Basename;
use POSIX qw(:signal_h);
use strict;
......@@ -124,17 +125,17 @@ if (!($localfile =~ /^([\w\.\_\-+\/]+)$/)) {
die("*** $0:\n".
" Illegal local filename given: $localfile\n");
} else {
$localfile = $1;
my $realpath = `$REALPATH $localfile`;
$localfile = $1;
my $dirname = dirname($localfile);
my $basename = basename($localfile);
my $realpath = `$REALPATH $dirname`;
chomp $realpath;
if (!TBValidUserDir($realpath, $ISFS)) {
die("*** $0:\n".
" Local file must be in one of " .
join(' or ', TBValidUserDirList()) . ".\n");
}
if ($realpath =~ /^([\w\.\_\-+\/]+)$/) {
$localfile = $1;
}
$localfile = "${realpath}/${basename}";
}
#
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment