diff options
author | jsorg71 <jay.sorg@gmail.com> | 2016-08-05 14:44:34 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-05 14:44:34 -0700 |
commit | 97cd690f841e4fc2cf0e24e849c266729d5593d5 (patch) | |
tree | 592dc5bebc193246f048ee1efd7eab80b3b75715 /libxrdp | |
parent | 8353baab3d361bcdebb32f1677dd066e0b255dc9 (diff) | |
parent | 7f0d059d84178cbe6c0b70f013ada8e8b6e3c6dd (diff) | |
download | xrdp-proprietary-97cd690f841e4fc2cf0e24e849c266729d5593d5.tar.gz xrdp-proprietary-97cd690f841e4fc2cf0e24e849c266729d5593d5.zip |
Merge pull request #384 from CarstenGrohmann/improve_cert_log_messages
Improve certificate log messages
Diffstat (limited to 'libxrdp')
-rw-r--r-- | libxrdp/xrdp_rdp.c | 31 |
1 files changed, 25 insertions, 6 deletions
diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index fb3b4b51..852a50bf 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -184,12 +184,22 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info) else if (g_strcasecmp(item, "certificate") == 0) { g_memset(client_info->certificate, 0, sizeof(char) * 1024); - if (value[0] != '/') + if (g_strlen(value) == 0) { /* default certificate path */ g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH); - log_message(LOG_LEVEL_ALWAYS,"WARNING: Invalid x.509 certificate path defined, " - "default path will be used: %s", client_info->certificate); + log_message(LOG_LEVEL_INFO, + "Missing definition of X.509 certificate, use " + "default instead: %s", client_info->certificate); + + } + else if (value[0] != '/') + { + /* default certificate path */ + g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_PATH); + log_message(LOG_LEVEL_WARNING, + "No absolute path to X.509 certificate, use " + "default instead: %s", client_info->certificate); } else { @@ -200,12 +210,21 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info) else if (g_strcasecmp(item, "key_file") == 0) { g_memset(client_info->key_file, 0, sizeof(char) * 1024); - if (value[0] != '/') + if (g_strlen(value) == 0) + { + /* default key_file path */ + g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH); + log_message(LOG_LEVEL_INFO, + "Missing definition of X.509 key file, use " + "default instead: %s", client_info->key_file); + } + else if (value[0] != '/') { /* default key_file path */ g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_PATH); - log_message(LOG_LEVEL_WARNING,"Invalid X.509 certificate path defined, " - "default path will be used: %s", client_info->key_file); + log_message(LOG_LEVEL_WARNING, + "No absolute path to X.509 key file, use" + "default instead: %s", client_info->key_file); } else { |