From 3eb495f425969be1fc7123f4d75a05833e0e4231 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Thu, 3 Mar 2016 22:29:53 -0800 Subject: Check if rsakeys.ini exists on startup, exit if it's missing --- xrdp/xrdp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xrdp/xrdp.c') diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index f985bba3..51820688 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -299,6 +299,7 @@ xrdp_sanity_check(void) { int intval = 1; int host_be; + char key_file[256]; /* check compiled endian with actual endian */ host_be = !((int)(*(unsigned char *)(&intval))); @@ -343,6 +344,13 @@ xrdp_sanity_check(void) return 1; } + g_snprintf(key_file, 255, "%s/rsakeys.ini", XRDP_CFG_PATH); + if (!g_file_exist(key_file)) + { + g_writeln("File %s is missing, create it using xrdp-keygen", key_file); + return 1; + } + return 0; } -- cgit v1.2.1