From a1e7f7882557d0bb02db4271f02f0c4be121105c Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Tue, 21 May 2024 12:33:17 +0100 Subject: [PATCH 1/4] chansrv FUSE fixes 1) [Regression] If the specified mountpoint is not immediately below an existing directory, the directory is not created. 2) The message to ask the user to unmount an existing mounted directory has been moved to the right place. (cherry picked from commit e0a1339b34b0d235e93efaf2c512c7284548d20b) --- sesman/chansrv/chansrv_fuse.c | 42 +++++++++++++++++------------------ 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sesman/chansrv/chansrv_fuse.c b/sesman/chansrv/chansrv_fuse.c index a2ea8d237b..be7e203af1 100644 --- a/sesman/chansrv/chansrv_fuse.c +++ b/sesman/chansrv/chansrv_fuse.c @@ -536,10 +536,25 @@ xfuse_init(void) return -1; } - g_snprintf(g_fuse_clipboard_path, 255, "%s/.clipboard", g_fuse_root_path); + g_snprintf(g_fuse_clipboard_path, sizeof(g_fuse_clipboard_path), + "%s/.clipboard", g_fuse_root_path); + + /* if FUSE mount point does not exist, create it */ + if (!g_directory_exist(g_fuse_root_path)) + { + (void)g_create_path(g_fuse_root_path); + if (!g_create_dir(g_fuse_root_path)) + { + LOG(LOG_LEVEL_ERROR, "mkdir %s failed (%s)", + g_fuse_root_path, g_get_strerror()); + return -1; + } + } /* Get the characteristics of the parent directory of the FUSE mount * point. Used by xfuse_path_in_xfuse_fs() */ + g_fuse_root_parent_dev = -1; + g_fuse_root_parent_ino = -1; p = (char *)g_strrchr(g_fuse_root_path, '/'); if (p != NULL) { @@ -550,11 +565,6 @@ xfuse_init(void) g_fuse_root_parent_ino = g_file_get_inode_num(g_fuse_root_path); *p = '/'; } - else - { - g_fuse_root_parent_dev = -1; - g_fuse_root_parent_ino = -1; - } if (g_fuse_root_parent_dev == -1 || g_fuse_root_parent_ino == -1) { @@ -564,18 +574,6 @@ xfuse_init(void) return -1; } - /* if FUSE mount point does not exist, create it */ - if (!g_directory_exist(g_fuse_root_path)) - { - (void)g_create_path(g_fuse_root_path); - if (!g_create_dir(g_fuse_root_path)) - { - LOG(LOG_LEVEL_ERROR, "mkdir %s failed. If %s is already mounted, you must " - "first unmount it", g_fuse_root_path, g_fuse_root_path); - return -1; - } - } - /* setup xrdp file system */ if (xfuse_init_xrdp_fs()) { @@ -902,14 +900,16 @@ static int xfuse_init_lib(struct fuse_args *args) { if (fuse_parse_cmdline(args, &g_mount_point, 0, 0) < 0) { - LOG_DEVEL(LOG_LEVEL_ERROR, "fuse_parse_cmdline() failed"); + LOG(LOG_LEVEL_ERROR, "fuse_parse_cmdline() failed"); fuse_opt_free_args(args); return -1; } if ((g_ch = fuse_mount(g_mount_point, args)) == 0) { - LOG_DEVEL(LOG_LEVEL_ERROR, "fuse_mount() failed"); + LOG(LOG_LEVEL_ERROR, "FUSE mount on %s failed." + " If %s is already mounted, you must first unmount it", + g_mount_point, g_mount_point); fuse_opt_free_args(args); return -1; } @@ -917,7 +917,7 @@ static int xfuse_init_lib(struct fuse_args *args) g_se = fuse_lowlevel_new(args, &g_xfuse_ops, sizeof(g_xfuse_ops), 0); if (g_se == 0) { - LOG_DEVEL(LOG_LEVEL_ERROR, "fuse_lowlevel_new() failed"); + LOG(LOG_LEVEL_ERROR, "fuse_lowlevel_new() failed"); fuse_unmount(g_mount_point, g_ch); g_ch = 0; fuse_opt_free_args(args); From 5f99bce601912879e6507d77498bb37af2fe1d32 Mon Sep 17 00:00:00 2001 From: Schen Date: Wed, 22 May 2024 19:02:14 +0900 Subject: [PATCH 2/4] Fix a systemd dependency ("network-online.target") - Fix a problem that the xrdp.service fail to auto-start when instructed to listen on a specific interface - By changing the "network.target" systemd dependency to "network-online.target" - The "network-online.target", in short, means at least one network interface has finished IP level setup. - The previously used "network.target" is vague and does not provide such guarantee (ref: man systemd.special(7)). - Which often cause "xrdp.service" fail to auto-start when the service is configured to listen on a specific interface (e.g. in xrdp.ini, "port=tcp://192.168.0.1:3389"). Because the interface may have not finish setting up its IP, when "xrdp.service" starts. (cherry picked from commit 21e11de15762a7cfb65083c2b9a19a197587dae8) --- instfiles/xrdp.service.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/instfiles/xrdp.service.in b/instfiles/xrdp.service.in index 576c1c253f..d30e7cedc1 100644 --- a/instfiles/xrdp.service.in +++ b/instfiles/xrdp.service.in @@ -2,7 +2,7 @@ Description=xrdp daemon Documentation=man:xrdp(8) man:xrdp.ini(5) Requires=xrdp-sesman.service -After=network.target xrdp-sesman.service +After=network-online.target xrdp-sesman.service [Service] Type=forking From f9e38e8a551196362e633b40065e7eeeb652c8b7 Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Sat, 1 Jun 2024 10:20:03 +0100 Subject: [PATCH 3/4] Bump FreeBSD CI version to 13.3 (cherry picked from commit cbaaf221cde9945a79de36b09e2e9bb70a847131) --- .cirrus.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.cirrus.yml b/.cirrus.yml index 9073a1fc44..43d013f4b8 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -4,7 +4,7 @@ FreeBSD_task: SSL: libressl matrix: freebsd_instance: - image_family: freebsd-13-2 + image_family: freebsd-13-3 prepare_script: - pkg install -y $SSL git autoconf automake libtool pkgconf opus jpeg-turbo fdk-aac pixman libX11 libXfixes libXrandr nasm fusefs-libs check imlib2 - git submodule update --init --recursive From 5d4cd9f555588374d00e98e366f689fc54b557cd Mon Sep 17 00:00:00 2001 From: matt335672 <30179339+matt335672@users.noreply.github.com> Date: Wed, 12 Jun 2024 10:46:32 +0100 Subject: [PATCH 4/4] Replace 'dvorak' keyboard description with 'us(dvorak)' In the words of @iskunk It is no longer possible to refer to the Dvorak layout as just "dvorak" (as when one would run "setxkbmap dvorak"); one must now use either "us dvorak" or "us(dvorak)" See https://bugs.debian.org/1063725 (cherry picked from commit a1b7c1790651dc3fef5ac43657620a670e2e68af) --- xrdp/xrdp_keyboard.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xrdp/xrdp_keyboard.ini b/xrdp/xrdp_keyboard.ini index c3093770ed..b7aa34969d 100644 --- a/xrdp/xrdp_keyboard.ini +++ b/xrdp/xrdp_keyboard.ini @@ -86,7 +86,7 @@ rdp_layout_pt=0x00000816 ; = [default_layouts_map] rdp_layout_us=us -rdp_layout_us_dvorak=dvorak +rdp_layout_us_dvorak=us(dvorak) rdp_layout_us_dvp=us(dvp) rdp_layout_dk=dk rdp_layout_de=de @@ -125,7 +125,7 @@ layouts_map=default_layouts_map [rdp_layouts_map_mac] rdp_layout_us=us -rdp_layout_us_dvorak=dvorak +rdp_layout_us_dvorak=us(dvorak) rdp_layout_us_dvp=us(dvp) rdp_layout_dk=dk rdp_layout_de=de