Skip to content

Commit

Permalink
fix issue modifies the permissions of source bin file #6049 (#6053)
Browse files Browse the repository at this point in the history
grant the sounce bin file correct permissions
  • Loading branch information
immarvin authored and robin2008 committed Mar 6, 2019
1 parent 04e52b3 commit d8f796f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xCAT-server/lib/xcat/plugins/onie.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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" });
}

Expand Down

0 comments on commit d8f796f

Please sign in to comment.