From ff65cdbbd6ea4ce34c1381ea3c6d5da88db8ac35 Mon Sep 17 00:00:00 2001 From: Marcin Krol Date: Wed, 26 Nov 2014 19:38:18 +0000 Subject: [PATCH] - patches from debian --- default_keymap.patch | 20 +++++++ format-security.patch | 17 +++++- pidfile_early.patch | 39 ++++++++++++ quiet_start.patch | 136 ++++++++++++++++++++++++++++++++++++++++++ xrdp.spec | 6 ++ 5 files changed, 215 insertions(+), 3 deletions(-) create mode 100644 default_keymap.patch create mode 100644 pidfile_early.patch create mode 100644 quiet_start.patch diff --git a/default_keymap.patch b/default_keymap.patch new file mode 100644 index 0000000..76e26a1 --- /dev/null +++ b/default_keymap.patch @@ -0,0 +1,20 @@ +Ensure that the default keymap is US english if there is a problem locating one. + +Index: xrdp/xrdp/lang.c +=================================================================== +--- xrdp.orig/xrdp/lang.c 2012-09-29 13:01:00.267338590 +0200 ++++ xrdp/xrdp/lang.c 2012-09-29 13:03:28.446647925 +0200 +@@ -239,6 +239,13 @@ + g_file_close(fd); + } + } ++ else if (keylayout != 0x409) ++ { ++ g_free(filename); ++ g_writeln("keymap for 0x%4.4x was not found. Falling back to 0x0409 instead", ++ keylayout); ++ return get_keymaps(0x409, keymap); ++ } + g_free(filename); + return 0; + } diff --git a/format-security.patch b/format-security.patch index f8a1d66..5dea147 100644 --- a/format-security.patch +++ b/format-security.patch @@ -1,6 +1,10 @@ ---- xrdp-v0.6.1/common/log.c~ 2013-11-09 21:11:15.000000000 +0100 -+++ xrdp-v0.6.1/common/log.c 2013-12-07 18:38:21.836315352 +0100 -@@ -160,7 +160,7 @@ +Fix a potential security problem if the message log contained "%". + +diff --git a/common/log.c b/common/log.c +index 7bbdfc0..4ed2adf 100644 +--- a/common/log.c ++++ b/common/log.c +@@ -160,13 +160,13 @@ log_message(struct log_config* l_cfg, const unsigned int lvl, const char* msg, . if (l_cfg->enable_syslog && (lvl <= l_cfg->log_level)) { /* log to syslog */ @@ -9,3 +13,10 @@ } if (lvl <= l_cfg->log_level) + { + /* log to console */ +- g_printf((char*)buff); ++ g_printf("%s", (char*)buff); + + /* log to application logfile */ + #ifdef LOG_ENABLE_THREAD diff --git a/pidfile_early.patch b/pidfile_early.patch new file mode 100644 index 0000000..080be50 --- /dev/null +++ b/pidfile_early.patch @@ -0,0 +1,39 @@ +Ensure that the PID file is written before sleeping. + +Index: xrdp/xrdp/xrdp.c +=================================================================== +--- xrdp.orig/xrdp/xrdp.c 2012-09-29 13:03:27.666630538 +0200 ++++ xrdp/xrdp/xrdp.c 2012-09-29 13:03:32.874746622 +0200 +@@ -388,17 +388,6 @@ + g_deinit(); + g_exit(0); + } +- g_sleep(1000); +- g_file_close(0); +- g_file_close(1); +- g_file_close(2); +- g_file_open("/dev/null"); +- g_file_open("/dev/null"); +- g_file_open("/dev/null"); +- /* end of daemonizing code */ +- } +- if (!no_daemon) +- { + /* write the pid to file */ + pid = g_getpid(); + fd = g_file_open(pid_file); /* xrdp.pid */ +@@ -414,6 +403,14 @@ + g_file_write(fd, text, g_strlen(text)); + g_file_close(fd); + } ++ g_sleep(1000); ++ g_file_close(0); ++ g_file_close(1); ++ g_file_close(2); ++ g_file_open("/dev/null"); ++ g_file_open("/dev/null"); ++ g_file_open("/dev/null"); ++ /* end of daemonizing code */ + } + g_threadid = tc_get_threadid(); + g_listen = xrdp_listen_create(); diff --git a/quiet_start.patch b/quiet_start.patch new file mode 100644 index 0000000..109cb3c --- /dev/null +++ b/quiet_start.patch @@ -0,0 +1,136 @@ +Avoid displaying a lot of information when starting xrdp and sesman + +Index: xrdp/sesman/config.c +=================================================================== +--- xrdp.orig/sesman/config.c 2012-09-29 12:51:50.000000000 +0200 ++++ xrdp/sesman/config.c 2012-09-29 12:55:57.560560996 +0200 +@@ -179,13 +179,13 @@ + } + + /* showing read config */ +- g_printf("sesman config:\r\n"); ++ /* g_printf("sesman config:\r\n"); + g_printf("\tListenAddress: %s\r\n", cf->listen_address); + g_printf("\tListenPort: %s\r\n", cf->listen_port); + g_printf("\tEnableUserWindowManager: %i\r\n", cf->enable_user_wm); + g_printf("\tUserWindowManager: %s\r\n", cf->user_wm); + g_printf("\tDefaultWindowManager: %s\r\n", cf->default_wm); +- g_printf("\tAuthFilePath: %s\r\n", ((cf->auth_file_path) ? (cf->auth_file_path) : ("disabled"))); ++ g_printf("\tAuthFilePath: %s\r\n", ((cf->auth_file_path) ? (cf->auth_file_path) : ("disabled"))); */ + + return 0; + } +@@ -236,11 +236,11 @@ + lc->log_file=g_strdup("./sesman.log"); + } + +- g_printf("logging configuration:\r\n"); ++ /* g_printf("logging configuration:\r\n"); + g_printf("\tLogFile: %s\r\n",lc->log_file); + g_printf("\tLogLevel: %i\r\n", lc->log_level); + g_printf("\tEnableSyslog: %i\r\n", lc->enable_syslog); +- g_printf("\tSyslogLevel: %i\r\n", lc->syslog_level); ++ g_printf("\tSyslogLevel: %i\r\n", lc->syslog_level); */ + + return 0; + } +@@ -295,7 +295,7 @@ + } + + /* printing security config */ +- g_printf("security configuration:\r\n"); ++ /* g_printf("security configuration:\r\n"); + g_printf("\tAllowRootLogin: %i\r\n",sc->allow_root); + g_printf("\tMaxLoginRetry: %i\r\n",sc->login_retry); + if (sc->ts_users_enable) +@@ -313,7 +313,7 @@ + else + { + g_printf("\tNo TSAdminsGroup defined\r\n"); +- } ++ } */ + + return 0; + } +@@ -363,12 +363,12 @@ + } + + /* printing security config */ +- g_printf("session configuration:\r\n"); ++ /* g_printf("session configuration:\r\n"); + g_printf("\tMaxSessions: %i\r\n", se->max_sessions); + g_printf("\tX11DisplayOffset: %i\r\n", se->x11_display_offset); + g_printf("\tKillDisconnected: %i\r\n", se->kill_disconnected); + g_printf("\tIdleTimeLimit: %i\r\n", se->max_idle_time); +- g_printf("\tDisconnectedTimeLimit: %i\r\n", se->max_idle_time); ++ g_printf("\tDisconnectedTimeLimit: %i\r\n", se->max_idle_time); */ + + return 0; + } +@@ -392,11 +392,11 @@ + } + + /* printing security config */ +- g_printf("X11rdp parameters:\r\n"); ++ /* g_printf("X11rdp parameters:\r\n"); + for (i = 0; i < cs->rdp_params->count; i++) + { + g_printf("\tParameter %02d %s\r\n", i, (char*)list_get_item(cs->rdp_params, i)); +- } ++ } */ + + return 0; + } +@@ -420,11 +420,11 @@ + } + + /* printing security config */ +- g_printf("Xvnc parameters:\r\n"); ++ /* g_printf("Xvnc parameters:\r\n"); + for (i = 0; i < cs->vnc_params->count; i++) + { + g_printf("\tParameter %02d %s\r\n", i, (char*)list_get_item(cs->vnc_params, i)); +- } ++ } */ + + return 0; + } +Index: xrdp/sesman/sesman.c +=================================================================== +--- xrdp.orig/sesman/sesman.c 2012-09-29 12:51:50.000000000 +0200 ++++ xrdp/sesman/sesman.c 2012-09-29 12:55:11.103556585 +0200 +@@ -143,7 +143,7 @@ + if (1 == argc) + { + /* no options on command line. normal startup */ +- g_printf("starting sesman...\n"); ++ /* g_printf("starting sesman...\n"); */ + daemon = 1; + } + else if ((2 == argc) && ((0 == g_strcasecmp(argv[1], "--nodaemon")) || +Index: xrdp/xrdp/xrdp.c +=================================================================== +--- xrdp.orig/xrdp/xrdp.c 2012-09-29 12:51:50.000000000 +0200 ++++ xrdp/xrdp/xrdp.c 2012-09-29 12:55:11.103556585 +0200 +@@ -383,7 +383,7 @@ + } + if (0 != pid) + { +- g_writeln("process %d started ok", pid); ++ /* g_writeln("process %d started ok", pid); */ + /* exit, this is the main process */ + g_deinit(); + g_exit(0); +Index: xrdp/sesman/libscp/libscp_init.c +=================================================================== +--- xrdp.orig/sesman/libscp/libscp_init.c 2012-09-29 12:51:50.111200358 +0200 ++++ xrdp/sesman/libscp/libscp_init.c 2012-09-29 12:55:11.103556585 +0200 +@@ -42,8 +42,6 @@ + + scp_lock_init(); + +- log_message(s_log, LOG_LEVEL_WARNING, "[init:%d] libscp initialized", __LINE__); +- + return 0; + } + diff --git a/xrdp.spec b/xrdp.spec index d17eb4c..f665ad2 100644 --- a/xrdp.spec +++ b/xrdp.spec @@ -16,6 +16,9 @@ Source6: %{name}.README.TLD.pl Patch0: format-security.patch Patch1: build.patch Patch2: link.patch +Patch3: quiet_start.patch +Patch4: default_keymap.patch +Patch5: pidfile_early.patch URL: http://xrdp.sourceforge.net/ BuildRequires: autoconf BuildRequires: automake @@ -52,6 +55,9 @@ xrdp używa jako backendu Xvnc lub X11rdp. %patch0 -p1 %patch1 -p1 %patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 install %{SOURCE5} README.TLD install %{SOURCE6} README.TLD.pl -- 2.46.0