Skip to content

Commit eb611a4

Browse files
authored
xrdp: 0.9.25.1 -> 0.10.1, xorgxrdp: 0.9.20 -> 0.10.2 (#345334)
2 parents 53cc1be + 2f5a9ad commit eb611a4

File tree

2 files changed

+50
-51
lines changed

2 files changed

+50
-51
lines changed

pkgs/applications/networking/remote/xrdp/default.nix

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
, systemd
1313
, pam
1414
, fuse
15+
, libdrm
1516
, libjpeg
1617
, libopus
1718
, nasm
@@ -27,18 +28,18 @@
2728
let
2829
xorgxrdp = stdenv.mkDerivation rec {
2930
pname = "xorgxrdp";
30-
version = "0.9.20";
31+
version = "0.10.2";
3132

3233
src = fetchFromGitHub {
3334
owner = "neutrinolabs";
3435
repo = "xorgxrdp";
3536
rev = "v${version}";
36-
hash = "sha256-cAAWk/GqR5zJmh7EAzX3qJiYNl/RrDWdncdFeqsFIaU=";
37+
hash = "sha256-xwkGY9dD747kyTvoXrYAIoiFBzQe5ngskUYQhDawnbU=";
3738
};
3839

3940
nativeBuildInputs = [ pkg-config autoconf automake which libtool nasm ];
4041

41-
buildInputs = [ xorg.xorgserver ];
42+
buildInputs = [ xorg.xorgserver libdrm ];
4243

4344
postPatch = ''
4445
# patch from Debian, allows to run xrdp daemon under unprivileged user
@@ -50,9 +51,10 @@ let
5051
--replace 'sysconfdir="/etc"' "sysconfdir=$out/etc"
5152
'';
5253

53-
preConfigure = "./bootstrap";
54-
55-
configureFlags = [ "XRDP_CFLAGS=-I${xrdp.src}/common" ];
54+
preConfigure = ''
55+
./bootstrap
56+
export XRDP_CFLAGS="-I${xrdp.src}/common -I${libdrm.dev}/include -I${libdrm.dev}/include/libdrm"
57+
'';
5658

5759
enableParallelBuilding = true;
5860

@@ -61,7 +63,7 @@ let
6163

6264
xrdp = stdenv.mkDerivation rec {
6365
pname = "xrdp";
64-
version = "0.9.25.1";
66+
version = "0.10.1";
6567

6668
src = applyPatches {
6769
inherit version;
@@ -72,7 +74,7 @@ let
7274
repo = "xrdp";
7375
rev = "v${version}";
7476
fetchSubmodules = true;
75-
hash = "sha256-oAs0oWkCyj3ObdJuHLfT25ZzkTrxNAXDiFU64OOP4Ow=";
77+
hash = "sha256-lqifQJ/JX+0304arVctsEBEDFPhEPn2OWLyjAQW1who=";
7678
};
7779
};
7880

@@ -94,7 +96,7 @@ let
9496
];
9597

9698
postPatch = ''
97-
substituteInPlace sesman/xauth.c --replace "xauth -q" "${xorg.xauth}/bin/xauth -q"
99+
substituteInPlace sesman/sesexec/xauth.c --replace "xauth -q" "${xorg.xauth}/bin/xauth -q"
98100
99101
substituteInPlace configure.ac --replace /usr/include/ ""
100102
'';
@@ -128,6 +130,7 @@ let
128130
cp $src/keygen/openssl.conf $out/share/xrdp/openssl.conf
129131
130132
substituteInPlace $out/etc/xrdp/sesman.ini --replace /etc/xrdp/pulse $out/etc/xrdp/pulse
133+
substituteInPlace $out/etc/xrdp/sesman.ini --replace '#SessionSockdirGroup=root' 'SessionSockdirGroup=xrdp'
131134
132135
# remove all session types except Xorg (they are not supported by this setup)
133136
perl -i -ne 'print unless /\[(X11rdp|Xvnc|console|vnc-any|sesman-any|rdp-any|neutrinordp-any)\]/ .. /^$/' $out/etc/xrdp/xrdp.ini

pkgs/applications/networking/remote/xrdp/dynamic_config.patch

Lines changed: 38 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ index 8fa34aea..da94cf95 100644
135135
- LOG(LOG_LEVEL_DEBUG, "keyboard_cfg_file %s", keyboard_cfg_file);
136136
+ LOG(LOG_LEVEL_DEBUG, "keyboard_cfg_file %s", client_info->xrdp_keyboard_ini_file);
137137

138-
- fd = g_file_open(keyboard_cfg_file);
139-
+ fd = g_file_open(client_info->xrdp_keyboard_ini_file);
138+
- fd = g_file_open_ro(keyboard_cfg_file);
139+
+ fd = g_file_open_ro(client_info->xrdp_keyboard_ini_file);
140140

141141
if (fd >= 0)
142142
{
@@ -179,19 +179,19 @@ index 8fa34aea..da94cf95 100644
179179
list_delete(items);
180180
list_delete(values);
181181
return 1;
182-
diff --git a/sesman/config.c b/sesman/config.c
182+
diff --git a/sesman/libsesman/sesman_config.c b/sesman/libsesman/sesman_config.c
183183
index 61e9e403..0466f61a 100644
184-
--- a/sesman/config.c
185-
+++ b/sesman/config.c
186-
@@ -34,6 +34,7 @@
187-
#include "sesman.h"
184+
--- a/sesman/libsesman/sesman_config.c
185+
+++ b/sesman/libsesman/sesman_config.c
186+
@@ -37,6 +37,7 @@
188187
#include "log.h"
188+
#include "os_calls.h"
189189
#include "string_calls.h"
190190
+#include <string.h>
191-
#include "chansrv/chansrv_common.h"
192-
193-
/***************************************************************************//**
194-
@@ -47,11 +48,10 @@
191+
//#include "chansrv/chansrv_common.h"
192+
#include "scp.h"
193+
194+
@@ -171,7 +172,7 @@ config_output_policy_string(unsigned int value,
195195
*
196196
*/
197197
static int
@@ -200,61 +200,57 @@ index 61e9e403..0466f61a 100644
200200
struct list *param_v)
201201
{
202202
int i;
203-
- int length;
204-
char *buf;
205-
206-
list_clear(param_v);
207-
@@ -127,13 +127,12 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
208-
g_free(cf->default_wm);
203+
@@ -249,14 +250,12 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
209204
cf->default_wm = g_strdup("startwm.sh");
210205
}
211-
- /* if default_wm doesn't begin with '/', it's a relative path to XRDP_CFG_PATH */
212-
+ /* if default_wm doesn't begin with '/', it's a relative path to base_dir */
206+
/* if default_wm doesn't begin with '/', it's a relative path to
207+
- * XRDP_CFG_PATH */
208+
+ * base_dir */
213209
if (cf->default_wm[0] != '/')
214210
{
215211
/* sizeof operator returns string length including null terminator */
216-
- length = sizeof(XRDP_CFG_PATH) + g_strlen(cf->default_wm) + 1; /* '/' */
217-
- buf = (char *)g_malloc(length, 0);
212+
- int length = (sizeof(XRDP_CFG_PATH) +
213+
- g_strlen(cf->default_wm) + 1); /* '/' */
214+
- char *buf = (char *)g_malloc(length, 0);
218215
- g_sprintf(buf, "%s/%s", XRDP_CFG_PATH, cf->default_wm);
219-
+ buf = (char *)g_malloc(g_strlen(base_dir) + 1 + g_strlen(cf->default_wm) + 1, 0);
216+
+ char *buf = (char *)g_malloc(g_strlen(base_dir) + 1 + g_strlen(cf->default_wm) + 1, 0);
220217
+ g_sprintf(buf, "%s/%s", base_dir, cf->default_wm);
221218
g_free(cf->default_wm);
222-
cf->default_wm = g_strdup(buf);
223-
g_free(buf);
224-
@@ -151,10 +150,8 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
225-
/* if reconnect_sh doesn't begin with '/', it's a relative path to XRDP_CFG_PATH */
219+
cf->default_wm = buf;
220+
}
221+
@@ -271,10 +270,8 @@ config_read_globals(int file, struct config_sesman *cf, struct list *param_n,
226222
if (cf->reconnect_sh[0] != '/')
227223
{
228-
- /* sizeof operator returns string length including null terminator */
229-
- length = sizeof(XRDP_CFG_PATH) + g_strlen(cf->reconnect_sh) + 1; /* '/' */
230-
- buf = (char *)g_malloc(length, 0);
224+
/* sizeof operator returns string length including null terminator */
225+
- int length = (sizeof(XRDP_CFG_PATH) +
226+
- g_strlen(cf->reconnect_sh) + 1); /* '/' */
227+
- char *buf = (char *)g_malloc(length, 0);
231228
- g_sprintf(buf, "%s/%s", XRDP_CFG_PATH, cf->reconnect_sh);
232-
+ buf = (char *)g_malloc(g_strlen(base_dir) + 1 + g_strlen(cf->reconnect_sh) + 1, 0);
233-
+ g_sprintf(buf, "%s/%s", base_dir, cf->reconnect_sh);
229+
+ char *buf = (char *)g_malloc(g_strlen(base_dir) + 1 + g_strlen(cf->reconnect_sh) + 1, 0);
230+
+ g_sprintf(buf, "%s/%s", base_dir, cf->reconnect_sh);
234231
g_free(cf->reconnect_sh);
235-
cf->reconnect_sh = g_strdup(buf);
236-
g_free(buf);
237-
@@ -511,6 +508,7 @@ struct config_sesman *
232+
cf->reconnect_sh = buf;
233+
}
234+
@@ -580,6 +577,7 @@ struct config_sesman *
238235
config_read(const char *sesman_ini)
239236
{
240237
struct config_sesman *cfg;
241238
+ char cfg_dir[256];
242239
int all_ok = 0;
243-
240+
244241
if ((cfg = g_new0(struct config_sesman, 1)) != NULL)
245-
@@ -532,8 +530,10 @@ config_read(const char *sesman_ini)
246-
param_v->auto_free = 1;
247-
242+
@@ -602,7 +600,10 @@ config_read(const char *sesman_ini)
243+
all_ok = 1;
244+
248245
/* read global config */
249246
- config_read_globals(fd, cfg, param_n, param_v);
250-
-
251247
+ g_strcpy(cfg_dir, sesman_ini);
252248
+ *(strrchr(cfg_dir, '/')) = 0; // cfg_file validated to contain '/'
253-
+
249+
+
254250
+ config_read_globals(cfg_dir, fd, cfg, param_n, param_v);
255-
/* read Xvnc/X11rdp/Xorg parameter list */
251+
252+
/* read Xvnc/Xorg parameter list */
256253
config_read_vnc_params(fd, cfg, param_n, param_v);
257-
config_read_rdp_params(fd, cfg, param_n, param_v);
258254
diff --git a/xrdp/lang.c b/xrdp/lang.c
259255
index e4c18077..06f92997 100644
260256
--- a/xrdp/lang.c

0 commit comments

Comments
 (0)