Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/neutrinolabs/NeutrinoRDP.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcocoon <cocoon@life.de>2017-09-15 10:31:48 +0300
committerjsorg71 <jay.sorg@gmail.com>2017-09-17 06:32:59 +0300
commit55b684404acd72ffff74a725fd2312332f3bb63c (patch)
tree707b4a62f057d5528417fb8c2e75116e69189796
parent75102f3016cd53f08e37207403ef2d65b1b719d6 (diff)
Fix crash neutrinordp when missing HOME env
Imported from: https://github.com/FreeRDP/FreeRDP/commit/036c8ce47d4400f78c693db63852a5bc95fa2cad Originally fixed by: Pawel Jakub Dawidek
-rw-r--r--libfreerdp-utils/file.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libfreerdp-utils/file.c b/libfreerdp-utils/file.c
index 9ac0da4..2c8fb2b 100644
--- a/libfreerdp-utils/file.c
+++ b/libfreerdp-utils/file.c
@@ -83,6 +83,16 @@ char* freerdp_get_home_path(rdpSettings* settings)
if (settings->home_path == NULL)
settings->home_path = getenv(HOME_ENV_VARIABLE);
+ /* https://github.com/neutrinolabs/xrdp/issues/719 */
+ /* workaround if home_path still is null */
+ /* happens for exmaple if in /lib/systemd/system/xrdp.service the User line is missing: */
+ /* [Service] */
+ /* ... */
+ /* User=root */
+ /* Backport of fix from FreeRDP (Pawel Jakub Dawidek) */
+ if (settings->home_path == NULL)
+ settings->home_path = xstrdup("/");
+
return settings->home_path;
}