From e0a4ceb58b120d5f35faad077738a0dbb04552fa Mon Sep 17 00:00:00 2001 From: Joe Robinson Date: Thu, 10 Dec 2015 17:19:51 +0000 Subject: Comment out the dangerous line --- .../java/uk/co/blatech/blaears/controllers/MsgRelayController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java b/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java index 43a5439..664030f 100644 --- a/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java +++ b/src/main/java/uk/co/blatech/blaears/controllers/MsgRelayController.java @@ -7,12 +7,17 @@ import org.springframework.web.bind.annotation.RequestParam; import java.io.IOException; +/** + * Sends the input text to the msgrelay bash script + * Just for testing. Don't uncomment that runtime line in live, it's dangerous + */ @Controller public class MsgRelayController { @RequestMapping("/msgrelay") String relay(@RequestParam(value="text", required=true) String text, Model model){ try { - Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom test " + text + " | bash /home/smsd/msgrelay.bash "}); + //DANGER + //Runtime.getRuntime().exec(new String[]{"/bin/bash", "-c", "echo theblueroom " + text + " | bash /home/smsd/msgrelay.bash "}); model.addAttribute("result", "OK"); } catch (IOException e) { System.out.println("Failed to run command echo theblueroom test " + text + " | bash /home/smsd/msgrelay.bash "); -- cgit v1.2.3