2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-05-29 09:13:08 +00:00

fix issue modifies the permissions of source bin file #6049 (#6053)

grant the sounce bin file correct permissions
This commit is contained in:
yangsong 2019-03-06 14:56:29 +08:00 committed by Bin Xu
parent 04e52b3d2a
commit d8f796ffca

View File

@ -18,6 +18,7 @@ use Getopt::Long;
use Expect;
use File::Path;
use File::Basename;
use File::Copy "cp";
use xCAT::Utils;
use xCAT::MsgUtils;
@ -183,11 +184,13 @@ sub copydata {
#check if file exists
if ( (-e "$defaultpath/$filename") && ($nooverwrite)){
chmod 0755, "$defaultpath/$filename";
$callback->({ data => "$defaultpath/$filename is already exists, will not overwrite" });
} else {
$callback->({ data => "Copying media to $defaultpath" });
mkpath ("$defaultpath");
system("cp $file $defaultpath");
cp "$file", "$defaultpath";
chmod 0755, "$defaultpath/$filename";
$callback->({ data => "Media copy operation successful" });
}