From: Igor Kotrasinski Date: Thu, 21 Jun 2018 09:21:03 +0000 (+0200) Subject: Add shell env var to gdbserver invocation X-Git-Tag: submit/tizen/20180828.110226~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f333e200ddb48fd13abba9d2a94f6032c44f0659;p=platform%2Fcore%2Fsecurity%2Ftef-simulator.git Add shell env var to gdbserver invocation Change-Id: I5506244a2c3e77561fa5a26d3c92d79d75191ee1 Signed-off-by: Igor Kotrasinski --- diff --git a/simulatordaemon/src/TAFactory.cpp b/simulatordaemon/src/TAFactory.cpp index 8111728..6101e36 100644 --- a/simulatordaemon/src/TAFactory.cpp +++ b/simulatordaemon/src/TAFactory.cpp @@ -447,8 +447,10 @@ bool TAFactory::launchTAInDebugMode(uint32_t port, string image_path, string argument, pthread_mutex_t &lock, pid_t &pid) { char *argv[5]; + char *env[2]; string gdbserver = "/usr/bin/gdbserver"; string io_str = "-"; + string shell = "SHELL=/bin/sh"; argv[0] = &gdbserver[0]; argv[1] = &io_str[0]; @@ -456,6 +458,9 @@ bool TAFactory::launchTAInDebugMode(uint32_t port, string image_path, argv[3] = &argument[0]; argv[4] = NULL; + env[0] = &shell[0]; + env[1] = NULL; + // fork TA with GDB pid = fork(); if (0 == pid) { @@ -480,7 +485,7 @@ bool TAFactory::launchTAInDebugMode(uint32_t port, string image_path, if (dup2(sock, 0) == -1 || dup2(sock, 1) == -1) goto clean_socket; - execv(argv[0], argv); + execve(argv[0], argv, env); clean_socket: err = errno; close(sock);