summaryrefslogtreecommitdiffstats
path: root/lib/xdsserver
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2018-10-17 15:32:16 +0200
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>2018-10-18 08:26:19 +0000
commit6748a2637bffb56213a2a6981df96a070fb96467 (patch)
treed13f8021325b33bbf93accf6ea24ac6a4b97fe3a /lib/xdsserver
parent79333f3eca65f37542e217f37e305ea81f6e42a4 (diff)
Unset LD_LIBRARY_PATH before executing commands (exec api)
New environment-setup-*-agl-linux file, used to set environment variables to use an SDK, now checks if LD_LIBRARY_PATH is set or not. And not empty LD_LIBRARY_PATH is considered as misconfigured and prevent to use SDK. So unset by default LD_LIBRARY_PATH env variable and allow to disable this unset by setting ldLibPathNoReset field of ExecArgs command. For info, reported error message when call environement-setup-* script: Your environment is misconfigured, you probably need to 'unset LD_LIBRARY_PATH' but please check why this was set in the first place and that it's safe to unset. The SDK will not operate correctly in most cases when LD_LIBRARY_PATH is set. For more references see: http://tldp.org/HOWTO/Program-Library-HOWTO/shared-libraries.html#AEN80 http://xahlee.info/UnixResource_dir/_/ldpath.html Change-Id: I386b92b04ebd33db39ac617acffa4e15b21213ad Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
Diffstat (limited to 'lib/xdsserver')
-rw-r--r--lib/xdsserver/apiv1-exec.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/xdsserver/apiv1-exec.go b/lib/xdsserver/apiv1-exec.go
index aea34e4..46c8148 100644
--- a/lib/xdsserver/apiv1-exec.go
+++ b/lib/xdsserver/apiv1-exec.go
@@ -83,6 +83,15 @@ func (s *APIService) execCmd(c *gin.Context) {
// Build command line
cmd := []string{}
+
+ // Reset by default LD_LIBRARY_PATH
+ // With new AGL SDK, New environment-setup-*-agl-linux file checks if
+ // LD_LIBRARY_PATH is set or not and not empty LD_LIBRARY_PATH is considered
+ // as misconfigured and prevent to use SDK
+ if !args.LdLibPathNoReset {
+ cmd = append(cmd, "unset LD_LIBRARY_PATH; ")
+ }
+
// Setup env var regarding Sdk ID (used for example to setup cross toolchain)
if envCmd := s.sdks.GetEnvCmd(args.SdkID, prj.DefaultSdk); len(envCmd) > 0 {
cmd = append(cmd, envCmd...)