From 1e62c7f2ece3b2434809d04c919ef2a059ac7a1a Mon Sep 17 00:00:00 2001 From: cxhong Date: Wed, 22 Jul 2020 18:15:10 -0400 Subject: [PATCH] Use xcat runcmd instead of system() call for mksquash command --- xCAT-server/lib/xcat/plugins/packimage.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/xCAT-server/lib/xcat/plugins/packimage.pm b/xCAT-server/lib/xcat/plugins/packimage.pm index aa783fd86..fa2980e61 100755 --- a/xCAT-server/lib/xcat/plugins/packimage.pm +++ b/xCAT-server/lib/xcat/plugins/packimage.pm @@ -591,7 +591,8 @@ sub process_request { return 1; } my $mksquashfs_command = "mksquashfs $temppath ../rootimg.sfs $flags"; - my $rc = system("$mksquashfs_command"); + xCAT::Utils->runcmd($mksquashfs_command, 0, 1); + my $rc = $::RUNCMD_RC; if ($rc) { $callback->({ error => ["Command \"$mksquashfs_command\" failed"], errorcode => [1] }); return 1;