diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2019-08-12 17:09:18 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2019-08-12 21:34:38 +0200 |
commit | 7a7b6bc25c36569397affc3034ceef75b75da127 (patch) | |
tree | dbbe9c08bf3e3163b8443e33ce6f0eed8ad01fe9 /sal | |
parent | b0bcd587fba71c34adb85dc5d1b2417104f02748 (diff) |
Avoid non-async-signal-safe functionality between fork and exec
This is a partial revert of 17642437fe0d68cf868ab430f04b4fdc12f1767f "reduce
ifdef forest". The original code used unsetenv only for certain platforms, and
putenv for others, but code a few lines further down uses unsetenv
unconditionally, so assume that it is safe to use on all relevant platforms
these days.
unsetenv isn't listed as async-signal-safe at <http://pubs.opengroup.org/
onlinepubs/9699919799/functions/V2_chap02.html#tag_15_04_03> "Signal Actions"
(but is already used a few lines further down, also between fork and exec), but
at least we get rid of the memory management involved in the OUString instance.
Change-Id: Iac993db8819d40a0841c455ed04ff9ca2ee2e4eb
Reviewed-on: https://gerrit.libreoffice.org/77368
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sal')
-rw-r--r-- | sal/osl/unx/process.cxx | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sal/osl/unx/process.cxx b/sal/osl/unx/process.cxx index c1556c9f0ede..1e3c7d372d69 100644 --- a/sal/osl/unx/process.cxx +++ b/sal/osl/unx/process.cxx @@ -177,8 +177,7 @@ static void ChildStatusProc(void *pData) if (! INIT_GROUPS(data.m_name, data.m_gid) || (setuid(data.m_uid) != 0)) SAL_WARN("sal.osl", "Failed to change uid and guid: " << UnixErrnoString(errno)); - const OUString envVar("HOME"); - osl_clearEnvironment(envVar.pData); + unsetenv("HOME"); } if (data.m_pszDir) |