[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#984782: xrdp session is not using the same PATH as a console session



Package: xrdp
Severity: normal
Tags: patch

xrdp project member here.

While working on an xrdp issue
(https://github.com/neutrinolabs/xrdp/issues/1773) we ascertained that
the PATH elements /bin and /usr/bin were swapped between a console
session and an xrdp session.

This is on a Kubuntu system.

The consequence of this was that the timeshift-gtk executable was being
found in /bin on the xrdp session. Consequently, polkit was unable to
find the correct action to apply, and the invocation failed. When run
explicitly from /usr/bin, the invocation succeeded.

Further investigation showed that on Ubuntu flavours, pan_env.so is
being used to set the PATH (and indeed the locale). Unlike the Buster
system I've got here, the PATH isn't set explicitly in /etc/profile.

For xrdp issue #1773, we resolved user's immediate problem by applying
this patch to /etc/xrdp/startwm.sh:-

--- startwm.sh.orig 2021-01-13 13:02:36.017117908 +0000
+++ startwm.sh 2021-01-12 13:50:10.396884171 +0000
@@ -2,6 +2,11 @@
 # xrdp X session start script (c) 2015, 2017 mirabilos
 # published under The MirOS Licence

+# Emulate pam_env.so
+if test -r /etc/environment; then
+ . /etc/environment
+fi
+
 if test -r /etc/profile; then
  . /etc/profile
 fi

Note that this file is an upstream file to the xrdp project.

This bug is a request to either adopt the patch above, or include
the corresponding pam_env calls in /etc/pam.d/xrdp-sesman. An
advantage of the second is that I believe you would be able to
remove the locale stuff from /etc/xrdp/startwm.sh, but I haven't
tested this.

I originally reported this fault on 2021-01-13 as
https://bugs.launchpad.net/ubuntu/+source/xrdp/+bug/1911435, but now
realise that this wasn't at all helpful.

-- System Information:
Debian Release: bullseye/sid
  APT prefers focal-updates
  APT policy: (500, 'focal-updates'), (500, 'focal-security'), (500, 'focal'), (100, 'focal-backports')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.8.0-44-generic (SMP w/2 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages xrdp depends on:
ii  adduser              3.118ubuntu2
ii  init-system-helpers  1.57
ii  libc6                2.31-0ubuntu9.2
ii  libfuse2             2.9.9-3
ii  libjpeg8             8c-2ubuntu8
ii  libopus0             1.3.1-0ubuntu1
ii  libpam0g             1.3.1-5ubuntu4.1
ii  libssl1.1            1.1.1f-1ubuntu2.2
ii  libx11-6             2:1.6.9-2ubuntu1.1
ii  libxfixes3           1:5.0.3-2
ii  libxrandr2           2:1.5.2-0ubuntu1
ii  lsb-base             11.1.0ubuntu2
ii  ssl-cert             1.0.39

Versions of packages xrdp recommends:
ii  fuse      2.9.9-3
pn  xorgxrdp  <none>

Versions of packages xrdp suggests:
pn  guacamole                  <none>
pn  xrdp-pulseaudio-installer  <none>


Reply to: