diff options
author | Jake Petroules <jake.petroules@petroules.com> | 2015-04-03 21:42:10 -0700 |
---|---|---|
committer | Jake Petroules <jake.petroules@petroules.com> | 2015-04-08 15:13:27 +0000 |
commit | 00540a8345c35703aeaab072fd9e4727c9b61d5a (patch) | |
tree | d25be162bcb3b2afe00062725b4420e6920008be /src/corelib/io | |
parent | a21a24ee485a2dc368d5e837cfc8aeb5c74717a1 (diff) |
Remove special handling for (DY)LD_LIBRARY_PATH in QProcess.
This provides the ability to pass a *real* clear environment to a
QProcess, rather than (DY)LD_LIBRARY_PATH always being copied over
from the current environment behind-the-scenes. This is important
to users because passing a truly clear environment is now possible.
[ChangeLog][Important Behavior Changes] (DY)LD_LIBRARY_PATH will
no longer "stick" in the process environment when starting a
QProcess. This means that if a QProcess is started with a clear
environment, it will not specially inherit (DY)LD_LIBRARY_PATH
from the parent process. This should not affect most applications,
but if the old behavior is desired, one can simply pass a clear
QProcessEnvironment with the (DY)LD_LIBRARY_PATH values added, to
the QProcess.
Change-Id: I51d1bc14905c5cc126fb02d91dddc2faade41a3c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index ffdf6f9e2e..46b557d6e0 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -299,18 +299,6 @@ static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Hash &environm if (environment.isEmpty()) return 0; - // if LD_LIBRARY_PATH exists in the current environment, but - // not in the environment list passed by the programmer, then - // copy it over. -#if defined(Q_OS_MAC) - static const char libraryPath[] = "DYLD_LIBRARY_PATH"; -#else - static const char libraryPath[] = "LD_LIBRARY_PATH"; -#endif - const QByteArray envLibraryPath = qgetenv(libraryPath); - bool needToAddLibraryPath = !envLibraryPath.isEmpty() && - !environment.contains(QProcessEnvironmentPrivate::Key(QByteArray(libraryPath))); - char **envp = new char *[environment.count() + 2]; envp[environment.count()] = 0; envp[environment.count() + 1] = 0; @@ -327,9 +315,6 @@ static char **_q_dupEnvironment(const QProcessEnvironmentPrivate::Hash &environm envp[(*envc)++] = ::strdup(key.constData()); } - if (needToAddLibraryPath) - envp[(*envc)++] = ::strdup(QByteArray(QByteArray(libraryPath) + '=' + - envLibraryPath).constData()); return envp; } |