jerryshao commented on code in PR #4337:
URL: https://github.com/apache/gravitino/pull/4337#discussion_r1701136488


##########
integration-test-common/src/test/java/org/apache/gravitino/integration/test/util/CommandExecutor.java:
##########
@@ -47,10 +47,9 @@ public static Object executeCommandLocalHost(
       Map<String, String> env) {
     List<String> subCommandsAsList = new ArrayList<>(Arrays.asList(command));
     String mergedCommand = StringUtils.join(subCommandsAsList, " ");
-
     LOG.info("Sending command \"{}\" to localhost", mergedCommand);
 
-    ProcessBuilder processBuilder = new ProcessBuilder(command);
+    ProcessBuilder processBuilder = new ProcessBuilder(subCommandsAsList);

Review Comment:
   > Let a example. If we the command is a string value, `ProcessBuilder` will 
take it as a whole command like `ls -al; rm -rf`, however, if we split it into 
a list, `-al;`, `rm`, `-rf` will be reviewed as the parameter of the first 
value, thus dangerous operation like `rm -rf` will not take effect.
   
   It's really hard to understand the meanings of what you say, can you please 
rephrase the words.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to