diff --git a/sago/platform_folders.cpp b/sago/platform_folders.cpp index 321ed58..f356165 100644 --- a/sago/platform_folders.cpp +++ b/sago/platform_folders.cpp @@ -55,6 +55,15 @@ std::string getHome() { res = homeEnv; return res; } +#if defined(__EMSCRIPTEN__) + if ( homeEnv) { + //With Emscripten we always trust home. Emscripten alwasy runs as root but getpwuid will fail. + res = homeEnv; + return res; + } + res = "/home/web_user"; + return res; //Always use a fixed folder for Emscripten +#endif struct passwd* pw = nullptr; struct passwd pwd; long bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);