From 23ffdb0c5fe0315d9d237f168e7d72abe0ba422c Mon Sep 17 00:00:00 2001 From: jsorg71 Date: Tue, 19 May 2009 04:23:49 +0000 Subject: [PATCH] autotools fix and file_loc.h simplified --- common/Makefile.am | 7 +++++++ common/file_loc.h | 24 ++---------------------- configure.ac | 13 ++----------- keygen/Makefile.am | 7 +++++++ libxrdp/Makefile.am | 7 +++++++ libxrdp/xrdp_rdp.c | 4 +++- libxrdp/xrdp_sec.c | 6 ++++-- mc/Makefile.am | 7 +++++++ rdp/Makefile.am | 7 +++++++ sesman/Makefile.am | 7 +++++++ sesman/chansrv/Makefile.am | 7 +++++++ sesman/config.c | 8 +++++--- sesman/config.h | 10 ---------- sesman/libscp/Makefile.am | 7 +++++++ sesman/sesman.c | 23 ++++++++++++----------- sesman/sesman.h | 4 ---- sesman/sessvc/Makefile.am | 7 +++++++ sesman/sig.c | 5 ++++- sesman/tools/Makefile.am | 7 +++++++ vnc/Makefile.am | 7 +++++++ xrdp/Makefile.am | 7 +++++++ xrdp/lang.c | 2 +- xrdp/xrdp.c | 18 ++++++++++-------- xrdp/xrdp_listen.c | 4 +++- xrdp/xrdp_login_wnd.c | 4 +++- xrdp/xrdp_wm.c | 4 +++- xup/Makefile.am | 7 +++++++ 27 files changed, 143 insertions(+), 77 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index 8107e97b..c7d4590f 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + lib_LTLIBRARIES = \ libcommon.la diff --git a/common/file_loc.h b/common/file_loc.h index d1295aa7..11aeb722 100644 --- a/common/file_loc.h +++ b/common/file_loc.h @@ -27,20 +27,8 @@ #define XRDP_CFG_PATH "/etc/xrdp" #endif -#if !defined(XRDP_CFG_FILE) -#define XRDP_CFG_FILE "/etc/xrdp/xrdp.ini" -#endif - -#if !defined(XRDP_KEY_FILE) -#define XRDP_KEY_FILE "/etc/xrdp/rsakeys.ini" -#endif - -#if !defined(XRDP_KEYMAP_FILE) -#define XRDP_KEYMAP_FILE "/etc/xrdp/km-%4.4x.ini" -#endif - -#if !defined(XRDP_PID_FILE) -#define XRDP_PID_FILE "/var/run/xrdp.pid" +#if !defined(XRDP_PID_PATH) +#define XRDP_PID_PATH "/var/run" #endif #if !defined(XRDP_SBIN_PATH) @@ -51,12 +39,4 @@ #define XRDP_SHARE_PATH "/usr/local/share/xrdp" #endif -#if !defined(SESMAN_PID_FILE) -#define SESMAN_PID_FILE "/var/run/sesman.pid" -#endif - -#if !defined(SESMAN_CFG_FILE) -#define SESMAN_CFG_FILE "/etc/xrdp/sesman.ini" -#endif - #endif diff --git a/configure.ac b/configure.ac index ea2a849b..68ff69d9 100644 --- a/configure.ac +++ b/configure.ac @@ -21,17 +21,8 @@ AC_ARG_ENABLE(pamuserpass, AS_HELP_STRING([--enable-pamuserpass], AM_CONDITIONAL(SESMAN_PAMUSERPASS, [test x$pamuserpass = xtrue]) libdir="${libdir}/xrdp/"; if test "x${prefix}" = "xNONE" ; then -sysconfdir="/etc/"; -else -AC_DEFINE_UNQUOTED([XRDP_CFG_PATH], ["${prefix}/etc/xrdp"], [xrdp config dir]) -AC_DEFINE_UNQUOTED([XRDP_CFG_FILE], ["${prefix}/etc/xrdp/xrdp.ini"], [xrdp config file]) -AC_DEFINE_UNQUOTED([XRDP_KEY_FILE], ["${prefix}/etc/xrdp/rsakeys.ini"], [xrdp key file]) -AC_DEFINE_UNQUOTED([XRDP_KEYMAP_FILE], ["${prefix}/etc/xrdp/km-%4.4x.ini"], [xrdp keymap file]) -AC_DEFINE_UNQUOTED([XRDP_PID_FILE], ["${prefix}/var/run/xrdp.pid"], [xrdp pid file]) -AC_DEFINE_UNQUOTED([XRDP_SBIN_PATH], ["${prefix}/sbin"], [xrdp sbin dir]) -AC_DEFINE_UNQUOTED([XRDP_SHARE_PATH], ["${prefix}/share/xrdp"], [xrdp share dir]) -AC_DEFINE_UNQUOTED([SESMAN_PID_FILE], ["${prefix}/var/run/sesman.pid"], [sesman pid file]) -AC_DEFINE_UNQUOTED([SESMAN_CFG_FILE], ["${prefix}/etc/xrdp/sesman.ini"], [sesman config file]) +sysconfdir="/etc"; +localstatedir="/var"; fi AC_CONFIG_FILES([Makefile common/Makefile diff --git a/keygen/Makefile.am b/keygen/Makefile.am index 8a65a0b0..53147317 100644 --- a/keygen/Makefile.am +++ b/keygen/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/libxrdp/Makefile.am b/libxrdp/Makefile.am index 9d140d83..5e545e57 100644 --- a/libxrdp/Makefile.am +++ b/libxrdp/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/libxrdp/xrdp_rdp.c b/libxrdp/xrdp_rdp.c index a217791b..c8e9698b 100644 --- a/libxrdp/xrdp_rdp.c +++ b/libxrdp/xrdp_rdp.c @@ -62,12 +62,14 @@ xrdp_rdp_read_config(struct xrdp_client_info* client_info) struct list* values; char* item; char* value; + char cfg_file[256]; items = list_create(); items->auto_free = 1; values = list_create(); values->auto_free = 1; - file_by_name_read_section(XRDP_CFG_FILE, "globals", items, values); + g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); + file_by_name_read_section(cfg_file, "globals", items, values); for (index = 0; index < items->count; index++) { item = (char*)list_get_item(items, index); diff --git a/libxrdp/xrdp_sec.c b/libxrdp/xrdp_sec.c index 139b1ca1..758283ad 100644 --- a/libxrdp/xrdp_sec.c +++ b/libxrdp/xrdp_sec.c @@ -901,6 +901,7 @@ xrdp_sec_incoming(struct xrdp_sec* self) int index; char* item; char* value; + char key_file[256]; DEBUG((" in xrdp_sec_incoming")); g_random(self->server_random, 32); @@ -908,10 +909,11 @@ xrdp_sec_incoming(struct xrdp_sec* self) items->auto_free = 1; values = list_create(); values->auto_free = 1; - if (file_by_name_read_section(XRDP_KEY_FILE, "keys", items, values) != 0) + g_snprintf(key_file, 255, "%s/rsakeys.ini", XRDP_CFG_PATH); + if (file_by_name_read_section(key_file, "keys", items, values) != 0) { /* this is a show stopper */ - g_writeln("xrdp_sec_incoming: error reading %s file", XRDP_KEY_FILE); + g_writeln("xrdp_sec_incoming: error reading %s file", key_file); list_delete(items); list_delete(values); return 1; diff --git a/mc/Makefile.am b/mc/Makefile.am index 6160518e..c2cf54f3 100644 --- a/mc/Makefile.am +++ b/mc/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/rdp/Makefile.am b/rdp/Makefile.am index 0ec73576..5a55d565 100644 --- a/rdp/Makefile.am +++ b/rdp/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/sesman/Makefile.am b/sesman/Makefile.am index c5f4643a..95149427 100644 --- a/sesman/Makefile.am +++ b/sesman/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp diff --git a/sesman/chansrv/Makefile.am b/sesman/chansrv/Makefile.am index 8752e737..fb4e8984 100644 --- a/sesman/chansrv/Makefile.am +++ b/sesman/chansrv/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/sesman/config.c b/sesman/config.c index 4af7b696..d24661e3 100644 --- a/sesman/config.c +++ b/sesman/config.c @@ -60,19 +60,21 @@ config_read(struct config_sesman* cfg) struct list* sec; struct list* param_n; struct list* param_v; + char cfg_file[256]; - fd = g_file_open(SESMAN_CFG_FILE); + g_snprintf(cfg_file, 255, "%s/sesman.ini", XRDP_CFG_PATH); + fd = g_file_open(cfg_file); if (-1 == fd) { if (g_cfg->log.fd >= 0) { /* logging is already active */ log_message(&(g_cfg->log), LOG_LEVEL_ALWAYS, "error opening %s in \ - config_read", SESMAN_CFG_FILE); + config_read", cfg_file); } else { - g_printf("error opening %s in config_read", SESMAN_CFG_FILE); + g_printf("error opening %s in config_read", cfg_file); } return 1; } diff --git a/sesman/config.h b/sesman/config.h index 11b3e586..cfe7c65e 100644 --- a/sesman/config.h +++ b/sesman/config.h @@ -32,16 +32,6 @@ #include "list.h" #include "log.h" -/** - * - * @def SESMAN_CFG_FILE - * @brief Configuration file path - * - */ -#ifndef SESMAN_CFG_FILE -#define SESMAN_CFG_FILE "./sesman.ini" -#endif - #define SESMAN_CFG_GLOBALS "Globals" #define SESMAN_CFG_DEFWM "DefaultWindowManager" #define SESMAN_CFG_ADDRESS "ListenAddress" diff --git a/sesman/libscp/Makefile.am b/sesman/libscp/Makefile.am index f0b87a7b..e1784f82 100644 --- a/sesman/libscp/Makefile.am +++ b/sesman/libscp/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/sesman/sesman.c b/sesman/sesman.c index 4ce3cdfd..4fc038de 100644 --- a/sesman/sesman.c +++ b/sesman/sesman.c @@ -134,7 +134,9 @@ main(int argc, char** argv) int pid; char pid_s[8]; char text[256]; + char pid_file[256]; + g_snprintf(pid_file, 255, "%s/xrdp-sesman.pid", XRDP_PID_PATH); if (1 == argc) { /* no options on command line. normal startup */ @@ -167,18 +169,17 @@ main(int argc, char** argv) { /* killing running sesman */ /* check if sesman is running */ - if (!g_file_exist(SESMAN_PID_FILE)) + if (!g_file_exist(pid_file)) { - g_printf("sesman is not running (pid file not found - %s)\n", - SESMAN_PID_FILE); + g_printf("sesman is not running (pid file not found - %s)\n", pid_file); g_exit(1); } - fd = g_file_open(SESMAN_PID_FILE); + fd = g_file_open(pid_file); if (-1 == fd) { - g_printf("error opening pid file[%s]: %s\n", SESMAN_PID_FILE, g_get_strerror()); + g_printf("error opening pid file[%s]: %s\n", pid_file, g_get_strerror()); return 1; } @@ -199,7 +200,7 @@ main(int argc, char** argv) } else { - g_file_delete(SESMAN_PID_FILE); + g_file_delete(pid_file); } g_exit(error); @@ -213,11 +214,11 @@ main(int argc, char** argv) g_exit(1); } - if (g_file_exist(SESMAN_PID_FILE)) + if (g_file_exist(pid_file)) { g_printf("sesman is already running.\n"); g_printf("if it's not running, try removing "); - g_printf(SESMAN_PID_FILE); + g_printf(pid_file); g_printf("\n"); g_exit(1); } @@ -298,17 +299,17 @@ main(int argc, char** argv) if (daemon) { /* writing pid file */ - fd = g_file_open(SESMAN_PID_FILE); + fd = g_file_open(pid_file); if (-1 == fd) { log_message(&(g_cfg->log), LOG_LEVEL_ERROR, "error opening pid file[%s]: %s", - SESMAN_PID_FILE, g_get_strerror()); + pid_file, g_get_strerror()); log_end(&(g_cfg->log)); g_exit(1); } g_sprintf(pid_s, "%d", g_pid); - g_file_write(fd, pid_s, g_strlen(pid_s) + 1); + g_file_write(fd, pid_s, g_strlen(pid_s)); g_file_close(fd); } diff --git a/sesman/sesman.h b/sesman/sesman.h index c62a2bbe..0344ccd5 100644 --- a/sesman/sesman.h +++ b/sesman/sesman.h @@ -51,8 +51,4 @@ #include "libscp.h" -#ifndef SESMAN_PID_FILE - #define SESMAN_PID_FILE "./sesman.pid" -#endif - #endif diff --git a/sesman/sessvc/Makefile.am b/sesman/sessvc/Makefile.am index d8897d2c..67740781 100644 --- a/sesman/sessvc/Makefile.am +++ b/sesman/sessvc/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/sesman/sig.c b/sesman/sig.c index 7405b024..6df57cc1 100644 --- a/sesman/sig.c +++ b/sesman/sig.c @@ -38,6 +38,8 @@ extern tbus g_term_event; void DEFAULT_CC sig_sesman_shutdown(int sig) { + char pid_file[256]; + log_message(&(g_cfg->log), LOG_LEVEL_INFO, "shutting down sesman %d", 1); if (g_getpid() != g_pid) @@ -54,7 +56,8 @@ sig_sesman_shutdown(int sig) session_sigkill_all(); - g_file_delete(SESMAN_PID_FILE); + g_snprintf(pid_file, 255, "%s/xrdp-sesman.pid", XRDP_PID_PATH); + g_file_delete(pid_file); } /******************************************************************************/ diff --git a/sesman/tools/Makefile.am b/sesman/tools/Makefile.am index 81af1554..8282e237 100644 --- a/sesman/tools/Makefile.am +++ b/sesman/tools/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common \ -I$(top_srcdir)/sesman/libscp \ diff --git a/vnc/Makefile.am b/vnc/Makefile.am index 6f6bc9d1..fe227ffa 100644 --- a/vnc/Makefile.am +++ b/vnc/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common diff --git a/xrdp/Makefile.am b/xrdp/Makefile.am index 2e6462b2..26eff4a1 100644 --- a/xrdp/Makefile.am +++ b/xrdp/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common \ -I$(top_srcdir)/libxrdp diff --git a/xrdp/lang.c b/xrdp/lang.c index fcc69332..c0c51311 100644 --- a/xrdp/lang.c +++ b/xrdp/lang.c @@ -1178,7 +1178,7 @@ get_keymaps(int keylayout, struct xrdp_keymap* keymap) break; } /* check if there is a keymap file */ - g_snprintf(filename, 255, XRDP_KEYMAP_FILE, keylayout); + g_snprintf(filename, 255, "%s/km-%4.4x.ini", XRDP_CFG_PATH, keylayout); if (g_file_exist(filename)) { fd = g_file_open(filename); diff --git a/xrdp/xrdp.c b/xrdp/xrdp.c index bf930220..cb43321d 100644 --- a/xrdp/xrdp.c +++ b/xrdp/xrdp.c @@ -281,6 +281,7 @@ main(int argc, char** argv) int fd; int no_daemon; char text[256]; + char pid_file[256]; #endif g_init(); @@ -413,6 +414,7 @@ main(int argc, char** argv) } WSAStartup(2, &w); #else /* _WIN32 */ + g_snprintf(pid_file, 255, "%s/xrdp.pid", XRDP_PID_PATH); no_daemon = 0; if (argc == 2) { @@ -423,9 +425,9 @@ main(int argc, char** argv) g_writeln("stopping xrdp"); /* read the xrdp.pid file */ fd = -1; - if (g_file_exist(XRDP_PID_FILE)) /* xrdp.pid */ + if (g_file_exist(pid_file)) /* xrdp.pid */ { - fd = g_file_open(XRDP_PID_FILE); /* xrdp.pid */ + fd = g_file_open(pid_file); /* xrdp.pid */ } if (fd == -1) { @@ -497,7 +499,7 @@ main(int argc, char** argv) g_writeln(""); g_exit(0); } - if (g_file_exist(XRDP_PID_FILE)) /* xrdp.pid */ + if (g_file_exist(pid_file)) /* xrdp.pid */ { g_writeln("It looks like xrdp is allready running,"); g_writeln("if not delete the xrdp.pid file and try again"); @@ -506,7 +508,7 @@ main(int argc, char** argv) if (!no_daemon) { /* make sure we can write to pid file */ - fd = g_file_open(XRDP_PID_FILE); /* xrdp.pid */ + fd = g_file_open(pid_file); /* xrdp.pid */ if (fd == -1) { g_writeln("running in daemon mode with no access to pid files, quitting"); @@ -518,7 +520,7 @@ main(int argc, char** argv) g_exit(0); } g_file_close(fd); - g_file_delete(XRDP_PID_FILE); + g_file_delete(pid_file); } if (!no_daemon) { @@ -548,7 +550,7 @@ main(int argc, char** argv) { /* write the pid to file */ pid = g_getpid(); - fd = g_file_open(XRDP_PID_FILE); /* xrdp.pid */ + fd = g_file_open(pid_file); /* xrdp.pid */ if (fd == -1) { g_writeln("trying to write process id to xrdp.pid"); @@ -557,7 +559,7 @@ main(int argc, char** argv) } else { - g_set_file_rights(XRDP_PID_FILE, 1, 1); /* xrdp.pid */ + g_set_file_rights(pid_file, 1, 1); /* xrdp.pid */ g_sprintf(text, "%d", pid); g_file_write(fd, text, g_strlen(text)); g_file_close(fd); @@ -593,7 +595,7 @@ main(int argc, char** argv) WSACleanup(); #else /* delete the xrdp.pid file */ - g_file_delete(XRDP_PID_FILE); + g_file_delete(pid_file); #endif return 0; } diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c index 3bf0d6ec..a596eba0 100644 --- a/xrdp/xrdp_listen.c +++ b/xrdp/xrdp_listen.c @@ -118,11 +118,13 @@ xrdp_listen_get_port(char* port, int port_bytes) char* val; struct list* names; struct list* values; + char cfg_file[256]; /* default to port 3389 */ g_strncpy(port, "3389", port_bytes - 1); /* see if port is in xrdp.ini file */ - fd = g_file_open(XRDP_CFG_FILE); + g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); + fd = g_file_open(cfg_file); if (fd > 0) { names = list_create(); diff --git a/xrdp/xrdp_login_wnd.c b/xrdp/xrdp_login_wnd.c index 65b89749..6ac8e11d 100644 --- a/xrdp/xrdp_login_wnd.c +++ b/xrdp/xrdp_login_wnd.c @@ -390,6 +390,7 @@ xrdp_wm_login_fill_in_combo(struct xrdp_wm* self, struct xrdp_bitmap* b) char* q; char* r; char name[256]; + char cfg_file[256]; struct xrdp_mod_data* mod_data; sections = list_create(); @@ -398,7 +399,8 @@ xrdp_wm_login_fill_in_combo(struct xrdp_wm* self, struct xrdp_bitmap* b) section_names->auto_free = 1; section_values = list_create(); section_values->auto_free = 1; - fd = g_file_open(XRDP_CFG_FILE); /* xrdp.ini */ + g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); + fd = g_file_open(cfg_file); /* xrdp.ini */ file_read_sections(fd, sections); for (i = 0; i < sections->count; i++) { diff --git a/xrdp/xrdp_wm.c b/xrdp/xrdp_wm.c index 42504d36..b42a48dc 100644 --- a/xrdp/xrdp_wm.c +++ b/xrdp/xrdp_wm.c @@ -371,13 +371,15 @@ xrdp_wm_init(struct xrdp_wm* self) char* q; char* r; char section_name[256]; + char cfg_file[256]; xrdp_wm_load_static_colors(self); xrdp_wm_load_static_pointers(self); self->screen->bg_color = self->black; if (self->session->client_info->rdp_autologin) { - fd = g_file_open(XRDP_CFG_FILE); /* xrdp.ini */ + g_snprintf(cfg_file, 255, "%s/xrdp.ini", XRDP_CFG_PATH); + fd = g_file_open(cfg_file); /* xrdp.ini */ if (fd > 0) { names = list_create(); diff --git a/xup/Makefile.am b/xup/Makefile.am index 2552b7df..2689a2c1 100644 --- a/xup/Makefile.am +++ b/xup/Makefile.am @@ -1,3 +1,10 @@ + +AM_CFLAGS = \ + -DXRDP_CFG_PATH=\"${sysconfdir}/xrdp\" \ + -DXRDP_SBIN_PATH=\"${sbindir}\" \ + -DXRDP_SHARE_PATH=\"${datadir}/xrdp\" \ + -DXRDP_PID_PATH=\"${localstatedir}/run\" + INCLUDES = \ -I$(top_srcdir)/common