diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index 1002d1770..28ed13458 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -493,40 +493,46 @@ rdpSettings* freerdp_settings_new(DWORD flags) if(!settings->DynamicChannelArray) goto out_fail; - settings->HomePath = GetKnownPath(KNOWN_PATH_HOME); - if (!settings->HomePath) - goto out_fail; - /* For default FreeRDP continue using same config directory - * as in old releases. - * Custom builds use / as config folder. */ - if (_stricmp(FREERDP_VENDOR_STRING, FREERDP_PRODUCT_STRING)) + if (!settings->ServerMode) { - base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, - FREERDP_VENDOR_STRING); - if (base) + /* these values are used only by the client part */ + + settings->HomePath = GetKnownPath(KNOWN_PATH_HOME); + if (!settings->HomePath) + goto out_fail; + + /* For default FreeRDP continue using same config directory + * as in old releases. + * Custom builds use / as config folder. */ + if (_stricmp(FREERDP_VENDOR_STRING, FREERDP_PRODUCT_STRING)) { - settings->ConfigPath = GetCombinedPath( - base, - FREERDP_PRODUCT_STRING); + base = GetKnownSubPath(KNOWN_PATH_XDG_CONFIG_HOME, + FREERDP_VENDOR_STRING); + if (base) + { + settings->ConfigPath = GetCombinedPath( + base, + FREERDP_PRODUCT_STRING); + } + free (base); + } else { + int i; + char product[sizeof(FREERDP_PRODUCT_STRING)]; + + memset(product, 0, sizeof(product)); + for (i=0; iConfigPath = GetKnownSubPath( + KNOWN_PATH_XDG_CONFIG_HOME, + product); } - free (base); - } else { - int i; - char product[sizeof(FREERDP_PRODUCT_STRING)]; - memset(product, 0, sizeof(product)); - for (i=0; iConfigPath = GetKnownSubPath( - KNOWN_PATH_XDG_CONFIG_HOME, - product); + if (!settings->ConfigPath) + goto out_fail; } - if (!settings->ConfigPath) - goto out_fail; - settings_load_hkey_local_machine(settings); settings->SettingsModified = (BYTE*) calloc(1, sizeof(rdpSettings) / 8 );