From 3acbdf064b1d10e568720149d5565b149acca78e Mon Sep 17 00:00:00 2001 From: immarvin Date: Mon, 13 Mar 2017 02:25:53 -0400 Subject: [PATCH] fix issue copycds issues when using -p path option #2630 --- xCAT-server/lib/xcat/plugins/copycds.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/xCAT-server/lib/xcat/plugins/copycds.pm b/xCAT-server/lib/xcat/plugins/copycds.pm index 0a4ff32d5..90a20c151 100644 --- a/xCAT-server/lib/xcat/plugins/copycds.pm +++ b/xCAT-server/lib/xcat/plugins/copycds.pm @@ -145,8 +145,11 @@ sub process_request { if ($path) { - $path=Cwd::realpath($path); - unless(substr($path,0,length("/install")) eq "/install"){ + + if(-e $path) { + $path=Cwd::realpath($path); + } + unless((substr($path,0,length("/install/")) eq "/install/") or ($path eq "/install")){ $callback->({ warning => "copycds: the specified path \"$path\" is not a subdirectory under /install. Make sure this path is configured for httpd/apache, otherwise, the provisioning with this iso will fail!" }); } push @{ $newreq->{arg} }, ("-p", $path);