Merge pull request #384 from CarstenGrohmann/improve_cert_log_messages
Improve certificate log messages
This commit is contained in:
commit
97cd690f84
@ -184,12 +184,22 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
|
|||||||
else if (g_strcasecmp(item, "certificate") == 0)
|
else if (g_strcasecmp(item, "certificate") == 0)
|
||||||
{
|
{
|
||||||
g_memset(client_info->certificate, 0, sizeof(char) * 1024);
|
g_memset(client_info->certificate, 0, sizeof(char) * 1024);
|
||||||
if (value[0] != '/')
|
if (g_strlen(value) == 0)
|
||||||
{
|
{
|
||||||
/* default certificate path */
|
/* default certificate path */
|
||||||
g_snprintf(client_info->certificate, 1023, "%s/cert.pem", XRDP_CFG_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, "
|
log_message(LOG_LEVEL_INFO,
|
||||||
"default path will be used: %s", client_info->certificate);
|
"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
|
else
|
||||||
{
|
{
|
||||||
@ -200,12 +210,21 @@ xrdp_rdp_read_config(struct xrdp_client_info *client_info)
|
|||||||
else if (g_strcasecmp(item, "key_file") == 0)
|
else if (g_strcasecmp(item, "key_file") == 0)
|
||||||
{
|
{
|
||||||
g_memset(client_info->key_file, 0, sizeof(char) * 1024);
|
g_memset(client_info->key_file, 0, sizeof(char) * 1024);
|
||||||
if (value[0] != '/')
|
if (g_strlen(value) == 0)
|
||||||
{
|
{
|
||||||
/* default key_file path */
|
/* default key_file path */
|
||||||
g_snprintf(client_info->key_file, 1023, "%s/key.pem", XRDP_CFG_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, "
|
log_message(LOG_LEVEL_INFO,
|
||||||
"default path will be used: %s", client_info->key_file);
|
"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,
|
||||||
|
"No absolute path to X.509 key file, use"
|
||||||
|
"default instead: %s", client_info->key_file);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user