Xrdp: Drive redirection location

Created on 28 Feb 2018  Â·  34Comments  Â·  Source: neutrinolabs/xrdp

We use a kerberized NFS to mount home directory. As such when a user's home directory is protected with 700, root user can not read/write/exec anything in users home directory. This causes issue with fuse as it can't access anything inside the user home directory because it runs as root.

This would not have been an issue if I can just point to variable "FuseMountName" in /etc/xrdp/sesman.ini to "/tmp/.xrdp/$user_mountpoint". It currently always default to ~/mountpoint.

Could this be set a little bit more flexible to allow "/tmp/.xrdp/$uid_mountpoint" and not assume that the mount point to always be in user's homedirectory?

thanks
hanz

drive redirection

Most helpful comment

I suggest to also remove colon character from the drive names on mount. I have an issue with docker on hyper-v Ubuntu VMs, because docker can't use volumes with special characters in their names.
Now the C drive is shared on _/home/myuser/shared-drives/C\:_ path, but I need something like
_/media/C_DRIVE_ .

All 34 comments

I suggest to also remove colon character from the drive names on mount. I have an issue with docker on hyper-v Ubuntu VMs, because docker can't use volumes with special characters in their names.
Now the C drive is shared on _/home/myuser/shared-drives/C\:_ path, but I need something like
_/media/C_DRIVE_ .

up :)
We are experiencing same issues.
Best solution, as we can't fusermount -u neither umount on our nfs shares, would be to put rdp exchange folder in
/tmp/xrdp/$UID

Are you building from source, @lchanouha ?

Would you be happy to test a patch for this?

currently i'm not, but i can !

Just an update, as I'm aware I haven't posted in this thread for a while.

I've got a branch issue1048 in my xrdp git repository. It lets you specify a path in sesman.ini for FuseMountName. You can add sequences %u and %U which are replaced with the username or UID.

It will let you mount the drives under (for example) /run/user/<uid>/thinclient_drives. The drives work perfectly well, but at the moment they're not visible in some file managers. I'm still looking into this. However, this code might be useful to you at this stage.

I think I'm there.

If you want to try this out:-

  • Checkout branch issue1048 from my xrdp git repository and build it.
  • In /etc/xrdp/sesman.ini, set FuseMountName=/media/thinclient_drives/%U/thinclient_drives in the [Chansrv] section.
  • Create the directory /media/thinclient_drives owned by root with:-
    sudo install -dm 1777 /media/thinclient_drives/
    The permissions are important - you need the sticky-bit set.

That should do it.

If you don't put the mountpoint under /media, the drives won't appear in some desktop file managers (e.g. GNOME).

Obviously if you're not bothered about the mountpoint appearing in the file manager you can put the mountpoints where you like.

I'd appreciate some feedback on this, and I'm happy to help anyone try it out. If I don't hear anything I'll raise a PR in a couple of weeks.

I have problems when building debian package with new upstream, so i can't really test in real conditions :/
Sorry i can test.
I will try again in few days.

Thanks for trying!
If you're having compilation issues, you might find pull request #1659 useful too.
Hope this helps.

I also have issue compiling on Ubuntu 18.04
-hanz

Making all in librfxcodec
make[2]: Entering directory '/ilab/users/makmur/xrdp/librfxcodec'
make[2]: * No rule to make target 'all'. Stop.
make[2]: Leaving directory '/ilab/users/makmur/xrdp/librfxcodec'
Makefile:482: recipe for target 'all-recursive' failed
make[1]:
[all-recursive] Error 1
make[1]: Leaving directory '/ilab/users/makmur/xrdp'
Makefile:414: recipe for target 'all' failed
make: *
* [all] Error 2

On Aug 28, 2020, at 10:15 AM, matt335672 notifications@github.com wrote:

Thanks for trying!
If you're having compilation issues, you might find pull request #1659 https://github.com/neutrinolabs/xrdp/pull/1659 useful too.
Hope this helps.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-682599976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIU7ZNBE7P4MVGZFFWLSC63ZLANCNFSM4ES5PL4Q.

Hi Hanz,

Have you run ./bootstrap ?

Also, see https://github.com/neutrinolabs/xrdp/wiki/Building-on-Debian-8 which is vaguely useful.

HTH

Sorry. Just notified my configure has issue with missing nasm and now it seems to compile.

Hanz

On Aug 29, 2020, at 10:19, matt335672 notifications@github.com wrote:

Hi Hanz,

Have you run ./bootstrap ?

Also, see https://github.com/neutrinolabs/xrdp/wiki/Building-on-Debian-8 which is vaguely useful.

HTH

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Matt,
I got it compiled and set it as instructed but I am not seeing any drive created in /media/thinclients_drives for user username. I don’t see any debug log on it. Can you add debug code?
Not sure I am using the right code since last code change was 2 months ago on GitHub.

Hanz

On Aug 29, 2020, at 10:19, matt335672 notifications@github.com wrote:

Hi Hanz,

Have you run ./bootstrap ?

Also, see https://github.com/neutrinolabs/xrdp/wiki/Building-on-Debian-8 which is vaguely useful.

HTH

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Hi Hanz,

I've added the files common/string_calls.c and common/string_calls.h to the codebase for this change, so if you can see that you're using the right code.

If you can't see that you might have my devel branch checked out which isn't updated a lot. If that's the case, try git checkout issue1048 and see if that gets you the files. Then rebuild.

The debug code for chansrv is a bit of a mess at the moment, but it's being worked on. chansrv inherits its stdout and stderr from xrdp-sesman, and I think the debug you need goes there.

One way to see the debug is to run both xrdp and xrdp-sesman using the -n option to prevent them forking. In other words:-

  • Stop xrdp and xrdp-seman if they're running
  • Log in two terminal sessions from another machine
  • In one termnial run sudo xrdp -n
  • In the other terminal run sudo xrdp-sesman -n

You should then get the output from sesman and chansrv in the second window.

Let me know how it goes, and thanks again.

Matt, I got the right code now with the  common/string_calls.c and common/string_calls.h.

I compile, set /etc/xrdp/sessman.ini with proper path and run the code with -n. 
However, I have no luck and now have a new issue I dont see with previous code.

When I connect, my remote desktop is now blank. I can't do anything except disconnect. No windows manager, just blank screen.When I look in /media/thinkclient_drive, I see nothing created there. The debug code shows nothing about the thindrive_client.except: in xrdp-sesman.log I see weird entry: [20200831-14:07:00] [CORE ] error starting chansrv - user hmakmur - pid 18013

When I go back to current release, xrdp works fine.
Going back to new code I compile, same result, blank screen.

Did I miss something?
see attached logs for rdp and sesman.

-hanz
xrdp.txt
sesman.txt

I suspect what is happening is that you've got a new and old installation on the same machine, and that different bits of it are falling over each other. Is that possible?

If so I apologise - should have spotted that one sooner.

If you can put the new build on a clean VM or similar it should look a lot better.

Matt
I actually apt removed old xrdp before testing. Make install github version, rebooted and test.
I tried in many combinations and suspected what you are suggesting.

Xrdp from apt install works in every combinations but not the one I compiled.

I was really puzzled as previous GitHub code I tested was working just missing your changes .

Hanz

On Sep 1, 2020, at 06:12, matt335672 notifications@github.com wrote:

I suspect what is happening is that you've got a new and old installation on the same machine, and that different bits of it are falling over each other. Is that possible?

If so I apologise - should have spotted that one sooner.

If you can put the new build on a clean VM or similar it should look a lot better.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

In that case I don't understand what you're seeing at all.

Can you build a working XRDP from a released version and get it working?

I'll then give you the code as a patch you can just apply straight over the working version. That might be simpler.

Thanks

Having read through some more emails this morning it seems that the problems you're seeing could be caused by some commits subsequent to v0.9.13.1 which need an update to xorgxrdp too.

To keep it simple, I've just rebased my branch issue1048 onto v0.9.13.1 and force-pushed it.

So you should have more luck if you recreate your copy of my repository and check out branch issue1048 again. That should hopefully do it.

Matt,
Thanks for the update.

To make sure I did the right thing.
Here is what I did. I am not sure if I get the right git repo or branch you want me to use. if not, please correct me where I did wrong.

  1. /bin/rm -rf xrdp
  2. git clone -b issue1048 --single-branch https://github.com/matt335672/xrdp.git https://github.com/matt335672/xrdp.git
  3. git status
    On branch issue1048
    Your branch is up to date with 'origin/issue1048'.

  4. cd xrdp

  5. ./bootstrap
  6. ./configure
  7. make
  8. make install
  9. add FuseMountName=/media/thinclient_drives/%U/thinclient_drives to /etc/xrdp/sesman.ini

I run it in non daemon mode. 2 xterminals.
xTerm1: xrdp/xrdp -n
xTerm 2: sessman/xrdp-sesman -n

And it works better. I get the whole xrdp client working. Got windows as it should.

However, when I clicked thinclient_drive icon, it still points to the old path in home directory as if it did not care about FuseMountName.

Can you add in sesman debug under logging configuration to show that xrdp-sesman actually reads the info about FuseMountName?

logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
....add-FuseMountName here...

Thanks again for working on this.

hanz

On Aug 26, 2020, at 6:47 AM, matt335672 notifications@github.com wrote:

Just an update, as I'm aware I haven;t posted in this thread for a while.

I've got a branch issue1048 in my xrdp git repository https://github.com/matt335672/xrdp. It lets you specify a path in sesman.ini for FuseMountName. You can add sequences %u and %U which are replaced with the username or UID.

It will let you mount the drives under (for example) /run/user//thinclient_drives. The drives work perfectly well, but at the moment they're not visible in some file managers. I'm still looking into this. However, this code might be useful to you at this stage.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-680805020, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVISHASL7QGP6HW2SFCTSCTR5HANCNFSM4ES5PL4Q.

I might have found this. I'd left out a call to create the whole directory path.

In any case I've added debugging code to this bit of chansrv. It will come out in the sesman window. I get this:-

[1424185753]: FUSE       load_fuse_config: 423 : Scanning [Chansrv] in /etc/xrdp/sesman.ini
[1424185753]: FUSE       load_fuse_config: 428 :     FuseMountName = /media/thinclient_drives/%U/thinclient_drives
[1424185753]: FUSE       load_fuse_config: 432 :     *** FuseMountName set to /media/thinclient_drives/%U/thinclient_drives
[1424185753]: FUSE       load_fuse_config: 428 :     FileUmask = 077
[1424185753]: FUSE       load_fuse_config: 437 : g_umask set to 077

I seem to be blundering through this a little. Thanks for bearing with me.

Just do a git pull and rebuild and we should get further.

Matt,
Did you pushed your changes to the repo?
I pulled a new code, I am not seeing as you described and obviously the fusemount still goes to default homedir to to /media/..

I dont see this log on my version on branch "issue1048". Am I supposed to be using different one?

hanz

On Sep 3, 2020, at 12:57 PM, matt335672 notifications@github.com wrote:

I might have found this. I'd left out a call to create the whole directory path.

In any case I've added debugging code to this bit of chansrv. It will come out in the sesman window. I get this:-

[1424185753]: FUSE load_fuse_config: 423 : Scanning [Chansrv] in /etc/xrdp/sesman.ini
[1424185753]: FUSE load_fuse_config: 428 : FuseMountName = /media/thinclient_drives/%U/thinclient_drives
[1424185753]: FUSE load_fuse_config: 432 : * FuseMountName set to /media/thinclient_drives/%U/thinclient_drives
[1424185753]: FUSE load_fuse_config: 428 : FileUmask = 077
[1424185753]: FUSE load_fuse_config: 437 : g_umask set to 077
I seem to be blundering through this a little. Thanks for bearing with me.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-686623839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIRIGJBOQP72RSGRJXDSD7DF7ANCNFSM4ES5PL4Q.

Matt,
I think I am not getting the changes you made. I think I need this change.
https://github.com/neutrinolabs/xrdp/commit/5f5591b18bbe10a5904804e7315be3d4ae6dccd4 https://github.com/neutrinolabs/xrdp/commit/5f5591b18bbe10a5904804e7315be3d4ae6dccd4

Allow FuseMountName for chansrv to be absolute path
This commit does not belong to any branch on this repository.

Every time I clone it, via git clone --branch issue1048 https://github.com/matt335672/xrdp.git
I dont see this changes.

Did I not get the right stuff? I am not good with git. I may be getting wrong code.

hanz

On Sep 4, 2020, at 5:12 PM, Hanz Makmur hmakmur@gmail.com wrote:

Matt,
Did you pushed your changes to the repo?
I pulled a new code, I am not seeing as you described and obviously the fusemount still goes to default homedir to to /media/..

I dont see this log on my version on branch "issue1048". Am I supposed to be using different one?

hanz

On Sep 3, 2020, at 12:57 PM, matt335672 <[email protected] notifications@github.com> wrote:

I might have found this. I'd left out a call to create the whole directory path.

In any case I've added debugging code to this bit of chansrv. It will come out in the sesman window. I get this:-

[1424185753]: FUSE load_fuse_config: 423 : Scanning [Chansrv] in /etc/xrdp/sesman.ini
[1424185753]: FUSE load_fuse_config: 428 : FuseMountName = /media/thinclient_drives/%U/thinclient_drives
[1424185753]: FUSE load_fuse_config: 432 : * FuseMountName set to /media/thinclient_drives/%U/thinclient_drives
[1424185753]: FUSE load_fuse_config: 428 : FileUmask = 077
[1424185753]: FUSE load_fuse_config: 437 : g_umask set to 077
I seem to be blundering through this a little. Thanks for bearing with me.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-686623839, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIRIGJBOQP72RSGRJXDSD7DF7ANCNFSM4ES5PL4Q.

Hi Hanz,

I'm sure we can't be far off solving this. You seem to be using git OK enough to me

I've just used these (your) commands in a fresh directory:-

git clone --branch issue1048 https://github.com/matt335672/xrdp.git
cd xrdp
git log -n5

And I get the following, which shows commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4:-

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date:   Thu Sep 3 17:54:49 2020 +0100

    Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date:   Fri Aug 28 09:15:57 2020 +0100

    Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date:   Thu Aug 27 12:23:42 2020 +0100

    Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date:   Thu Aug 27 12:10:18 2020 +0100

    Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected]>
Date:   Sat Aug 22 18:05:24 2020 +0100

    Allow FuseMountName for chansrv to be absolute path

Is that what you're seeing?

As a further check, you can use this command to print lines 477-505 of sesman/chansrv/chansrv_fuse.c out:-

sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c

It should look like this:-

    /* define FUSE mount point */
    if (g_fuse_mount_name[0] == '/')
    {
        /* String is an absolute path to the mount point containing
         * %u or %U characters */
        format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                         g_fuse_mount_name);
    }
    else
    {
        /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
         * or ~/thinclient_drives */
        g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
                   g_getenv("HOME"), g_fuse_mount_name);
    }
    g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                      "first unmount it", g_fuse_root_path, g_fuse_root_path);
            return -1;
        }
    }

If that's OK then what you're doing above to make and install it should be fine.

The extra logging comes in the terminal window that you're running xrdp-sesman in. There's a lot of text in here when you log in, but it also contains the mountpoint debug info.

My /etc/xrdp/sesman.ini contains the following section towards the end:-

[Chansrv]
; drive redirection, defaults to xrdp_client if not set
#FuseMountName=thinclient_drives
FuseMountName=/media/thinclient_drives/%U/thinclient_drives
; Set this to 077 for enhanced security when mapping a remote drive
FileUmask=077

Can you post your /etc/xrdp/sesman.ini? I can run through it here on Monday.

I am experiencing similar issues because my home folders are also in a NFS share with root squash enabled

I applied a workaround that @derekschrock suggested in the gitter chat by adding mount_max = 0 to /etc/fuse.conf in the server running xrdp. This way the fuse mount point is not created and my users still can copy&paste text. This seem to work ok for me as temporary workaround.

Thanks @pescobar

I've added a (hopefully working) link to your post to the gitter chat.

I think adding another parameter to [Chansrv] called EnableFuseMount which defaults to true is the best thing to do here. I'll have a look at how easy it will be to add it to this change too.

@hmakmur - please let me know if there's anything else I can do to help you try this out at the moment.

Matt,
Sorry for late reply. I was sick for a few days and we also have a long Labor day weekend here.

I see all you changes as described in git log -n5 and my sessman.ini is exactly are you wrote however debugging of xrdp-sessman -n does not show any of the log I am supposed to see.
it appears to be as if all changes you did has no effect. I am not sure what to say except that I am also confused.

I just redid now after looking at the git log -n5 which I appear to have all changes you added and
./bootstrap
./configure
make
make install

and I still see the same result as I did last week.
To address @pescobar https://github.com/pescobar issues, there is really no need to add EnableFuseMount, if your changes works, the fusemountname should be set to default to below.
FuseMountName=/media/thinclient_drives/%U/thinclient_drives

-hanz

[Chansrv]
; drive redirection
; See sesman.ini(5) for the format of this parameter

FuseMountName=/run/user/%u/thinclient_drives

FuseMountName=thinclient_drives

FuseMountName=/media/thinclient_drives/%U/thinclient_drives
; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

On Sep 5, 2020, at 12:00 PM, matt335672 notifications@github.com wrote:

Hi Hanz,

I'm sure we can't be far off solving this. You seem to be using git OK enough to me

I've just used these (your) commands in a fresh directory:-

git clone --branch issue1048 https://github.com/matt335672/xrdp.git
cd xrdp
git log -n5
And I get the following, which shows commit 5f5591b https://github.com/neutrinolabs/xrdp/commit/5f5591b18bbe10a5904804e7315be3d4ae6dccd4:-

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected]>
Date: Sat Aug 22 18:05:24 2020 +0100

Allow FuseMountName for chansrv to be absolute path

Is that what you're seeing?

YES, I see the same

As a further check, you can use this command to print lines 477-505 of sesman/chansrv/chansrv_fuse.c out:-

sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c
It should look like this:-

YES. I see the same

/* define FUSE mount point */
if (g_fuse_mount_name[0] == '/')
{
    /* String is an absolute path to the mount point containing
     * %u or %U characters */
    format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                     g_fuse_mount_name);
}
else
{
    /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
     * or ~/thinclient_drives */
    g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
               g_getenv("HOME"), g_fuse_mount_name);
}
g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                  "first unmount it", g_fuse_root_path, g_fuse_root_path);
        return -1;
    }
}

If that's OK then what you're doing above to make and install it should be fine.

The extra logging comes in the terminal windows that you're running xrdp-sesman in.

My /etc/xrdp/sesman.ini contains the following section towards the end:-

[Chansrv]
; drive redirection, defaults to xrdp_client if not set

FuseMountName=thinclient_drives

FuseMountName=/media/thinclient_drives/%U/thinclient_drives
; Set this to 077 for enhanced security when mapping a remote drive
FileUmask=077
Can you post your /etc/xrdp/sesman.ini? I can run through it here on Monday.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-687629257, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIRX3G2ATA6FL5M4UPLSEJOALANCNFSM4ES5PL4Q.

Well, if you're confused that makes two of us!

We can check the dates on all the files. After you've done a clean build and install, the following command should show a very recent time on xrdp-sesman:-

ls -l `which xrdp-sesman`

Also, what do you get from this one, assuming you're installing somewhere in /usr:-

find /usr -xdev \( -name xrdp-sesman -o -name libcommon.so.0.0.0 \) -ls

Just a small observation - you've got a make install in your command above. You are running that with sudo aren't you?

As I said before, I think we're very close and I appreciate you sticking with this.

Matt,
Yes, all done with root. I installed but run it manually with -n switch so I can look at the debug.
I know we are very close but I dont know where the problem is. I just redid and get the same result.

I looks like I may be missing something obvious but I am not sure what that is.

The obvious one is commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265 is being skipped which could be the cause of the problem.

--hanz

# lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

pwd

/freespace/local/makmur/xrdp

git log -n5

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:10:18 2020 +0100

:...skipping...

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

:...skipping...
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

:...skipping...
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected]>
Date: Sat Aug 22 18:05:24 2020 +0100

Allow FuseMountName for chansrv to be absolute path

~

pwd

/freespace/local/makmur/xrdp

sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c

/* define FUSE mount point */
if (g_fuse_mount_name[0] == '/')
{
    /* String is an absolute path to the mount point containing
     * %u or %U characters */
    format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                     g_fuse_mount_name);
}
else
{
    /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
     * or ~/thinclient_drives */
    g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
               g_getenv("HOME"), g_fuse_mount_name);
}
g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                  "first unmount it", g_fuse_root_path, g_fuse_root_path);
        return -1;
    }
}

more /etc/xrdp/sesman.ini
;; See man 5 sesman.ini for details
...
[Chansrv]
; drive redirection
; See sesman.ini(5) for the format of this parameter
FuseMountName=/run/user/%U/thinclient_drives

FuseMountName=thinclient_drives

; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

ls -l which xrdp-sesman

-rwxr-xr-x 1 root root 160520 Sep 9 13:14 /usr/local/sbin//xrdp-sesman*

find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls

2773107 344 -rwxr-xr-x 1 root root 349664 Sep 9 13:14 /usr/local/lib/xrdp/libcommon.so.0.0.0
2254228 160 -rwxr-xr-x 1 root root 160520 Sep 9 13:14 /usr/local/sbin/xrdp-sesman

pwd

/freespace/local/makmur/xrdp/sesman

c211-1.cs-2+# xrdp-sesman -n
starting sesman in foreground...
Global configuration:
ListenAddress: 127.0.0.1
ListenPort: 3350
EnableUserWindowManager: 1
UserWindowManager: startwm.sh
DefaultWindowManager: /etc/xrdp/startwm.sh
ReconnectScript: /etc/xrdp/reconnectwm.sh
AuthFilePath: disabled
Session configuration:
MaxSessions: 50
X11DisplayOffset: 10
KillDisconnected: 0
IdleTimeLimit: 0
DisconnectedTimeLimit: 0
Policy: 0
Security configuration:
AllowRootLogin: 1
MaxLoginRetry: 4
AlwaysGroupCheck: 0
RestrictOutboundClipboard: 0
TSUsersGroup: (not defined)
TSAdminsGroup: (not defined)
Xorg parameters:
Parameter 00 Xorg
Parameter 01 -config
Parameter 02 xrdp/xorg.conf
Parameter 03 -noreset
Parameter 04 -nolisten
Parameter 05 tcp
Parameter 06 -logfile
Parameter 07 .xorgxrdp.%s.log
Xvnc parameters:
Parameter 00 Xvnc
Parameter 01 -bs
Parameter 02 -nolisten
Parameter 03 tcp
Parameter 04 -localhost
Parameter 05 -dpi
Parameter 06 96
SessionVariables parameters:
Parameter 00 PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
[20200909-14:26:24] [DEBUG] libscp initialized
[20200909-14:26:24] [INFO ] starting xrdp-sesman with pid 8060
[20200909-14:26:24] [INFO ] listening to port 3350 on 127.0.0.1

hanz

On Sep 9, 2020, at 5:31 AM, matt335672 notifications@github.com wrote:

Well, if you're confused that makes two of us!

We can check the dates on all the files. After you've done a clean build and install, the following command should show a very recent time on xrdp-sesman:-

ls -l which xrdp-sesman
Also, what do you get from this one, assuming you're installing somewhere in /usr:-

find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls
Just a small observation - you've got a make install in your command above. You are running that with sudo aren't you?

As I said before, I think we're very close and I appreciate you sticking with this.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-689446581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIVJOPRSCFXQCZFBSWTSE5DQ7ANCNFSM4ES5PL4Q.

Matt,
I had wipe xrdp and wipe .git file. Start as if it is a new computer. Result is still the same.

git clone --branch issue1048 https://github.com/matt335672/xrdp.git
cd xrdp
git log -n5
This time, git log -n5 give the same result as yours. It appears my git was is in funny state.

c211-1.cs-2+# git log -n5
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected]>
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected]>
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected]>
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected]>
Date: Sat Aug 22 18:05:24 2020 +0100

Allow FuseMountName for chansrv to be absolute path

c211-1.cs-2+# sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c

/* define FUSE mount point */
if (g_fuse_mount_name[0] == '/')
{
    /* String is an absolute path to the mount point containing
     * %u or %U characters */
    format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                     g_fuse_mount_name);
}
else
{
    /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
     * or ~/thinclient_drives */
    g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
               g_getenv("HOME"), g_fuse_mount_name);
}
g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                  "first unmount it", g_fuse_root_path, g_fuse_root_path);
        return -1;
    }
}

c211-1.cs-2+# tail -12 /etc/xrdp/sesman.ini
[Chansrv]
; drive redirection
; See sesman.ini(5) for the format of this parameter

FuseMountName=/run/user/%u/thinclient_drives

FuseMountName=thinclient_drives

FuseMountName=/media/thinclient_drives/%U/thinclient_drives
; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

[SessionVariables]
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa

After bootstraping, configuring and making, i ran it locally.

c211-1.cs-2+# ls -l which xrdp-sesman
-rwxr-xr-x 1 root root 160520 Sep 9 16:18 /usr/local/sbin//xrdp-sesman*

c211-1.cs-2+# find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls
2773107 344 -rwxr-xr-x 1 root root 349664 Sep 9 16:18 /usr/local/lib/xrdp/libcommon.so.0.0.0
2254226 160 -rwxr-xr-x 1 root root 160520 Sep 9 16:18 /usr/local/sbin/xrdp-sesman

This time running sesman still gives the same log. I thought you added extra log there showing the fusemountname.
Nothing shows your newly added debugging code that shows fusemount name was being read.
This resulted in the same thing as if none of your changes were implemented.

--hanz

c211-1.cs-2+# sesman/xrdp-sesman -n
starting sesman in foreground...
Global configuration:
ListenAddress: 127.0.0.1
ListenPort: 3350
EnableUserWindowManager: 1
UserWindowManager: startwm.sh
DefaultWindowManager: /etc/xrdp/startwm.sh
ReconnectScript: /etc/xrdp/reconnectwm.sh
AuthFilePath: disabled
Session configuration:
MaxSessions: 50
X11DisplayOffset: 10
KillDisconnected: 0
IdleTimeLimit: 0
DisconnectedTimeLimit: 0
Policy: 0
Security configuration:
AllowRootLogin: 1
MaxLoginRetry: 4
AlwaysGroupCheck: 0
RestrictOutboundClipboard: 0
TSUsersGroup: (not defined)
TSAdminsGroup: (not defined)
Xorg parameters:
Parameter 00 Xorg
Parameter 01 -config
Parameter 02 xrdp/xorg.conf
Parameter 03 -noreset
Parameter 04 -nolisten
Parameter 05 tcp
Parameter 06 -logfile
Parameter 07 .xorgxrdp.%s.log
Xvnc parameters:
Parameter 00 Xvnc
Parameter 01 -bs
Parameter 02 -nolisten
Parameter 03 tcp
Parameter 04 -localhost
Parameter 05 -dpi
Parameter 06 96
SessionVariables parameters:
Parameter 00 PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
[20200909-16:40:08] [DEBUG] libscp initialized
[20200909-16:40:08] [INFO ] starting xrdp-sesman with pid 7185
[20200909-16:40:08] [INFO ] listening to port 3350 on 127.0.0.1

On Sep 9, 2020, at 2:40 PM, Hanz Makmur hmakmur@gmail.com wrote:

Matt,
Yes, all done with root. I installed but run it manually with -n switch so I can look at the debug.
I know we are very close but I dont know where the problem is. I just redid and get the same result.

I looks like I may be missing something obvious but I am not sure what that is.

The obvious one is commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265 is being skipped which could be the cause of the problem.

--hanz

# lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

pwd

/freespace/local/makmur/xrdp

git log -n5

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

:...skipping...

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

:...skipping...
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

:...skipping...
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected] >
Date: Sat Aug 22 18:05:24 2020 +0100

Allow FuseMountName for chansrv to be absolute path

~

pwd

/freespace/local/makmur/xrdp

sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c

/* define FUSE mount point */
if (g_fuse_mount_name[0] == '/')
{
    /* String is an absolute path to the mount point containing
     * %u or %U characters */
    format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                     g_fuse_mount_name);
}
else
{
    /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
     * or ~/thinclient_drives */
    g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
               g_getenv("HOME"), g_fuse_mount_name);
}
g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                  "first unmount it", g_fuse_root_path, g_fuse_root_path);
        return -1;
    }
}

more /etc/xrdp/sesman.ini
;; See man 5 sesman.ini for details
...
[Chansrv]
; drive redirection
; See sesman.ini(5) for the format of this parameter
FuseMountName=/run/user/%U/thinclient_drives

FuseMountName=thinclient_drives

; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

ls -l which xrdp-sesman

-rwxr-xr-x 1 root root 160520 Sep 9 13:14 /usr/local/sbin//xrdp-sesman*

find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls

2773107 344 -rwxr-xr-x 1 root root 349664 Sep 9 13:14 /usr/local/lib/xrdp/libcommon.so.0.0.0
2254228 160 -rwxr-xr-x 1 root root 160520 Sep 9 13:14 /usr/local/sbin/xrdp-sesman

pwd

/freespace/local/makmur/xrdp/sesman

c211-1.cs-2+# xrdp-sesman -n
starting sesman in foreground...
Global configuration:
ListenAddress: 127.0.0.1
ListenPort: 3350
EnableUserWindowManager: 1
UserWindowManager: startwm.sh
DefaultWindowManager: /etc/xrdp/startwm.sh
ReconnectScript: /etc/xrdp/reconnectwm.sh
AuthFilePath: disabled
Session configuration:
MaxSessions: 50
X11DisplayOffset: 10
KillDisconnected: 0
IdleTimeLimit: 0
DisconnectedTimeLimit: 0
Policy: 0
Security configuration:
AllowRootLogin: 1
MaxLoginRetry: 4
AlwaysGroupCheck: 0
RestrictOutboundClipboard: 0
TSUsersGroup: (not defined)
TSAdminsGroup: (not defined)
Xorg parameters:
Parameter 00 Xorg
Parameter 01 -config
Parameter 02 xrdp/xorg.conf
Parameter 03 -noreset
Parameter 04 -nolisten
Parameter 05 tcp
Parameter 06 -logfile
Parameter 07 .xorgxrdp.%s.log
Xvnc parameters:
Parameter 00 Xvnc
Parameter 01 -bs
Parameter 02 -nolisten
Parameter 03 tcp
Parameter 04 -localhost
Parameter 05 -dpi
Parameter 06 96
SessionVariables parameters:
Parameter 00 PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
[20200909-14:26:24] [DEBUG] libscp initialized
[20200909-14:26:24] [INFO ] starting xrdp-sesman with pid 8060
[20200909-14:26:24] [INFO ] listening to port 3350 on 127.0.0.1

hanz

On Sep 9, 2020, at 5:31 AM, matt335672 <[email protected] notifications@github.com> wrote:

Well, if you're confused that makes two of us!

We can check the dates on all the files. After you've done a clean build and install, the following command should show a very recent time on xrdp-sesman:-

ls -l which xrdp-sesman
Also, what do you get from this one, assuming you're installing somewhere in /usr:-

find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls
Just a small observation - you've got a make install in your command above. You are running that with sudo aren't you?

As I said before, I think we're very close and I appreciate you sticking with this.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-689446581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIVJOPRSCFXQCZFBSWTSE5DQ7ANCNFSM4ES5PL4Q.

Matt,

Here is a log if xrdp-sesman -n if you want to see.

I dont see the drive redirection code got called anywhere.
I have set drive mappign on both mac and windows Remote Desktop Client.
None of them produce any logging that it was called at all.

hanz

c211-1.cs-2+# ./xrdp-sesman -n
starting sesman in foreground...
Global configuration:
ListenAddress: 127.0.0.1
ListenPort: 3350
EnableUserWindowManager: 1
UserWindowManager: startwm.sh
DefaultWindowManager: /etc/xrdp/startwm.sh
ReconnectScript: /etc/xrdp/reconnectwm.sh
AuthFilePath: disabled
Session configuration:
MaxSessions: 50
X11DisplayOffset: 10
KillDisconnected: 0
IdleTimeLimit: 0
DisconnectedTimeLimit: 0
Policy: 0
Security configuration:
AllowRootLogin: 1
MaxLoginRetry: 4
AlwaysGroupCheck: 0
RestrictOutboundClipboard: 0
TSUsersGroup: (not defined)
TSAdminsGroup: (not defined)
Xorg parameters:
Parameter 00 Xorg
Parameter 01 -config
Parameter 02 xrdp/xorg.conf
Parameter 03 -noreset
Parameter 04 -nolisten
Parameter 05 tcp
Parameter 06 -logfile
Parameter 07 .xorgxrdp.%s.log
Xvnc parameters:
Parameter 00 Xvnc
Parameter 01 -bs
Parameter 02 -nolisten
Parameter 03 tcp
Parameter 04 -localhost
Parameter 05 -dpi
Parameter 06 96
SessionVariables parameters:
Parameter 00 PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
[20200909-17:45:27] [DEBUG] libscp initialized
[20200909-17:45:27] [INFO ] starting xrdp-sesman with pid 26457
[20200909-17:45:27] [INFO ] listening to port 3350 on 127.0.0.1

....here is the start of a session ....

[20200909-17:57:24] [INFO ] A connection received from 127.0.0.1 port 40338
[20200909-17:57:24] [INFO ] ++ created session (access granted): username hmakmur, ip 172.17.141.139:54977 - socket: 12
[20200909-17:57:24] [INFO ] starting Xorg session...
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:5910)
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:0)
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:5911)
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:0)
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:5912)
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:6012)
[20200909-17:57:24] [DEBUG] Closed socket 13 (AF_INET 0.0.0.0:6212)
[20200909-17:57:24] [DEBUG] Closed socket 10 (AF_INET 127.0.0.1:3350)
[20200909-17:57:24] [INFO ] calling auth_start_session from pid 542
[20200909-17:57:25] [DEBUG] Closed socket 9 (AF_INET 127.0.0.1:3350)
[20200909-17:57:25] [DEBUG] Closed socket 10 (AF_INET 127.0.0.1:3350)
[20200909-17:57:25] [INFO ] Xorg :12 -auth .Xauthority -config xrdp/xorg.conf -noreset -nolisten tcp -logfile .xorgxrdp.%s.log

X.Org X Server 1.19.6
Release Date: 2017-12-20
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.15.0-115-generic x86_64 Ubuntu
Current Operating System: Linux c211-1.cs.rutgers.edu 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.15.0-112-generic root=UUID=88828cb5-c60a-4267-a6b1-7f5d7c348868 ro quiet splash swapaccount=1 swapaccount=1 vt.handoff=1
Build Date: 04 September 2020 03:34:39PM
xorg-server 2:1.19.6-1ubuntu4.6 (For technical support please see http://www.ubuntu.com/support)
Current version of pixman: 0.34.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(++) Log file: ".xorgxrdp.12.log", Time: Wed Sep 9 17:57:25 2020
(++) Using config file: "/etc/X11/xrdp/xorg.conf"
(==) Using system config directory "/usr/share/X11/xorg.conf.d"
xorgxrdpSetup:
xrdpdevSetup:
rdpmousePlug:
rdpkeybPlug:
rdpIdentify:
rdpDriverFunc: op 10
rdpProbe:
rdpPreInit:
rdpScreenInit: virtualX 800 virtualY 600 rgbBits 8 depth 24
rdpScreenInit: pfbMemory bytes 1920000
rdpScreenInit: pfbMemory 0x7fa09db2e010
rdpSimdInit: assigning yuv functions
rdpSimdInit: cpuid ax 1 cx 0 return ax 0x000906ea bx 0x07100800 cx 0x7ffafbff dx 0xbfebfbff
rdpSimdInit: sse2 amd64 yuv functions assigned
rdpXvInit: depth 24
rdpClientConInit: kill disconnected [0] timeout [0] sec

rdpScreenInit: out
rdpmousePreInit: drv 0x556fd2b29e30 info 0x556fd2eb3a70, flags 0x0
rdpmouseControl: what 0
rdpmouseDeviceInit:
rdpmouseCtrl:
rdpRegisterInputCallback: type 1 proc 0x7fa09df07c60
rdpmouseControl: what 1
rdpmouseDeviceOn:
rdpkeybPreInit: drv 0x556fd2b27e50 info 0x556fd2eb6610, flags 0x0
rdpkeybControl: what 0
rdpkeybDeviceInit:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpRegisterInputCallback: type 0 proc 0x7fa09dd04530
rdpkeybControl: what 1
rdpkeybDeviceOn:
rdpSaveScreen:
rdpDeferredRandR:
rdpResizeSession: width 1024 height 768
calling RRScreenSizeSet
rdpRRScreenSetSize: width 1024 height 768 mmWidth 271 mmHeight 203
rdpRRGetInfo:
screen resized to 1024x768
RRScreenSizeSet ok 1
rdpResizeSession: width 1024 height 768
rdpClientConGotConnection:
rdpClientConGotConnection: g_sck_accept ok new_sck 7
rdpClientConGotConnection: adding only clientCon
rdpClientConProcessMsgVersion: version 0 0 0 1
rdpClientConProcessScreenSizeMsg: set width 1024 height 768 bpp 32
rdpClientConProcessScreenSizeMsg: shmemid 15335424 shmemptr 0x7fa0841f8000
rdpClientConProcessMsgClientInput: invalidate x 0 y 0 cx 1024 cy 768
KbdSync: toggling num lock
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpInDeferredUpdateCallback:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
[20200909-17:57:25] [CORE ] waiting for window manager (pid 562) to exit
chansrv::main: using log file [/ilab/users/hmakmur/.local/share/xrdp/xrdp-chansrv.12.log]
mesg: cannot open /dev/pts/1: Permission denied
[20200909-17:57:25] [CORE ] main: app started pid 599(0x00000257)
[20200909-17:57:25] [INFO ] main: DISPLAY env var set to :12.0
[20200909-17:57:25] [INFO ] main: using DISPLAY 12
[20200909-17:57:25] [INFO ] channel_thread_loop: thread start
[20200909-17:57:25] [INFO ] Socket 12: AF_UNIX connection received
process_message_channel_setup: chan name 'rdpdr' id 0 flags 00000000
process_message_channel_setup: chan name 'rdpsnd' id 1 flags 00000000
process_message_channel_setup: chan name 'cliprdr' id 2 flags 00000000
process_message_channel_setup: chan name 'drdynvc' id 3 flags 00000000
rdpClientConProcessMsgClientInfo:
got client info bytes 5744
jpeg support 0
offscreen support 1
offscreen size 10485760
offscreen entries 100
client can not do offscreen to offscreen blits
client can do new(color) cursor
client can not do multimon
rdpRRSetRdpOutputs: numCrtcs 0 monitorCount 0
rdpRRSetRdpOutputs: add output 0 left 0 top 0 width 1024 height 768
rdpLoadLayout: keylayout 0x00000409 variant display 12
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
xrdp-chansrv [1960811802]: xcommon_init: connected to display ok
xrdp-chansrv [1960811802]: sound_init:
xrdp-chansrv [1960811802]: audin_init:

Ubuntu 18.04.4 LTS4.15.0-112-generic

Machine Name: c211-1.cs IP No: 128.6.5.60

Wed Sep 9 17:57:25 EDT 2020 Uptime: 8 days 05:54

Processes: 335 Local/SSH/X2Go/Xrdp: 0/3/0/1 (4)
Connections: 10 System Load: 0

Free Memory: 22G of 31G Free Swap: 30G of 30G

CPU Info: Intel(R) Core(TM) i7-8700 CPU @ 3.20GHz - 12 cores
System CPU: 0.14% User CPU: 0.44%

CPU Idle: 99.40% IO Wait: 0.02%

Login as: hmakmur No. of Sessions: 2
Avail.UserDisk: Avail.Freespace: 117.50 GB
rdpInDeferredUpdateCallback:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off

CUDA Driver: 11.0 CUDA Cores: 1152

xrdp-chansrv [1960811906]: scard_init:
chansrv:smartcard_pcsc [1960811906]: scard_pcsc_init:
chansrv:smartcard_pcsc [1960811907]: scard_pcsc_init: g_remove_dir failed

rdpRRGetInfo:
rdpRRScreenSetSize: width 1024 height 768 mmWidth 271 mmHeight 203
rdpRRGetInfo:
screen resized to 1024x768
rdpRROutputSetProperty:
rdpRROutputGetProperty:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat on
rdpInDeferredUpdateCallback:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpRROutputGetProperty:
rdpRRGetInfo:
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off
rdpkeybChangeKeyboardControl:
rdpkeybChangeKeyboardControl: autoRepeat off

At this point when click on the thinclient_drive on gnome, I see the following logs and dialog box pop up showing it is still pointing at old path under home directory.

[20200909-18:08:15] [ERROR] X error BadWindow (invalid Window parameter) opcodes 18/0 resource 0x2e003d3
[20200909-18:08:15] [ERROR] X error BadWindow (invalid Window parameter) opcodes 25/0 resource 0x2e003d3
[20200909-18:08:15] [ERROR] X error BadWindow (invalid Window parameter) opcodes 18/0 resource 0x2e003d3
[20200909-18:08:15] [ERROR] X error BadWindow (invalid Window parameter) opcodes 25/0 resource 0x2e003d3
On Logout, the following logs is out:

[20200909-18:11:03] [ERROR] X error BadWindow (invalid Window parameter) opcodes 18/0 resource 0x2e02c29
[20200909-18:11:03] [ERROR] X error BadWindow (invalid Window parameter) opcodes 25/0 resource 0x2e02c29
[20200909-18:11:03] [CORE ] window manager (pid 562) did exit, cleaning up session
[20200909-18:11:03] [INFO ] calling auth_stop_session and auth_end from pid 542
[20200909-18:11:04] [DEBUG] cleanup_sockets:
[20200909-18:11:04] [INFO ] term_signal_handler: got signal 15
[20200909-18:11:04] [INFO ] xserver_fatal_handler: entered.......
rdpmouseControl: what 2
rdpmouseDeviceOff:
rdpkeybControl: what 2
rdpkeybDeviceOff:
rdpkeybControl: what 3
rdpkeybUnInit: drv 0x556fd2b27e50 info 0x556fd2eb6610, flags 0x0
rdpUnregisterInputCallback: proc 0x7fa09dd04530
rdpmouseControl: what 3
rdpmouseUnInit: drv 0x556fd2b29e30 info 0x556fd2eb3a70, flags 0x0
rdpUnregisterInputCallback: proc 0x7fa09df07c60
[20200909-18:11:04] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_audio_out_socket_12
rdpCloseScreen:
xorgxrdpDownDown:
xorgxrdpDownDown: 1
rdpClientConDeinit:
rdpClientConDeinit: disconnecting only clientCon
rdpClientConDisconnect:
rdpClientConDisconnect: clientCon removed from dev list
rdpClientConDeinit: deleting file /tmp/.xrdp/xrdp_display_12
rdpClientConDeinit: deleting file /tmp/.xrdp/xrdp_disconnect_display_12
(II) Server terminated successfully (0). Closing log file.
[20200909-18:11:04] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdp_chansrv_audio_in_socket_12
[20200909-18:11:04] [DEBUG] cleanup_sockets: deleting /tmp/.xrdp/xrdpapi_12
[20200909-18:11:04] [INFO ] ++ terminated session: username hmakmur, display :12.0, session_pid 542, ip 172.17.141.139:54977 - socket: 12

On Sep 9, 2020, at 4:55 PM, Hanz Makmur hmakmur@gmail.com wrote:

Matt,
I had wipe xrdp and wipe .git file. Start as if it is a new computer. Result is still the same.

git clone --branch issue1048 https://github.com/matt335672/xrdp.git https://github.com/matt335672/xrdp.git
cd xrdp
git log -n5
This time, git log -n5 give the same result as yours. It appears my git was is in funny state.

c211-1.cs-2+# git log -n5
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected] >
Date: Sat Aug 22 18:05:24 2020 +0100

Allow FuseMountName for chansrv to be absolute path

c211-1.cs-2+# sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c

/* define FUSE mount point */
if (g_fuse_mount_name[0] == '/')
{
    /* String is an absolute path to the mount point containing
     * %u or %U characters */
    format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                     g_fuse_mount_name);
}
else
{
    /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
     * or ~/thinclient_drives */
    g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
               g_getenv("HOME"), g_fuse_mount_name);
}
g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                  "first unmount it", g_fuse_root_path, g_fuse_root_path);
        return -1;
    }
}

c211-1.cs-2+# tail -12 /etc/xrdp/sesman.ini
[Chansrv]
; drive redirection
; See sesman.ini(5) for the format of this parameter

FuseMountName=/run/user/%u/thinclient_drives

FuseMountName=thinclient_drives

FuseMountName=/media/thinclient_drives/%U/thinclient_drives
; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

[SessionVariables]
PULSE_SCRIPT=/etc/xrdp/pulse/default.pa

After bootstraping, configuring and making, i ran it locally.

c211-1.cs-2+# ls -l which xrdp-sesman
-rwxr-xr-x 1 root root 160520 Sep 9 16:18 /usr/local/sbin//xrdp-sesman*

c211-1.cs-2+# find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls
2773107 344 -rwxr-xr-x 1 root root 349664 Sep 9 16:18 /usr/local/lib/xrdp/libcommon.so.0.0.0
2254226 160 -rwxr-xr-x 1 root root 160520 Sep 9 16:18 /usr/local/sbin/xrdp-sesman

This time running sesman still gives the same log. I thought you added extra log there showing the fusemountname.
Nothing shows your newly added debugging code that shows fusemount name was being read.
This resulted in the same thing as if none of your changes were implemented.

--hanz

c211-1.cs-2+# sesman/xrdp-sesman -n
starting sesman in foreground...
Global configuration:
ListenAddress: 127.0.0.1
ListenPort: 3350
EnableUserWindowManager: 1
UserWindowManager: startwm.sh
DefaultWindowManager: /etc/xrdp/startwm.sh
ReconnectScript: /etc/xrdp/reconnectwm.sh
AuthFilePath: disabled
Session configuration:
MaxSessions: 50
X11DisplayOffset: 10
KillDisconnected: 0
IdleTimeLimit: 0
DisconnectedTimeLimit: 0
Policy: 0
Security configuration:
AllowRootLogin: 1
MaxLoginRetry: 4
AlwaysGroupCheck: 0
RestrictOutboundClipboard: 0
TSUsersGroup: (not defined)
TSAdminsGroup: (not defined)
Xorg parameters:
Parameter 00 Xorg
Parameter 01 -config
Parameter 02 xrdp/xorg.conf
Parameter 03 -noreset
Parameter 04 -nolisten
Parameter 05 tcp
Parameter 06 -logfile
Parameter 07 .xorgxrdp.%s.log
Xvnc parameters:
Parameter 00 Xvnc
Parameter 01 -bs
Parameter 02 -nolisten
Parameter 03 tcp
Parameter 04 -localhost
Parameter 05 -dpi
Parameter 06 96
SessionVariables parameters:
Parameter 00 PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
[20200909-16:40:08] [DEBUG] libscp initialized
[20200909-16:40:08] [INFO ] starting xrdp-sesman with pid 7185
[20200909-16:40:08] [INFO ] listening to port 3350 on 127.0.0.1

On Sep 9, 2020, at 2:40 PM, Hanz Makmur <[email protected] hmakmur@gmail.com> wrote:

Matt,
Yes, all done with root. I installed but run it manually with -n switch so I can look at the debug.
I know we are very close but I dont know where the problem is. I just redid and get the same result.

I looks like I may be missing something obvious but I am not sure what that is.

The obvious one is commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265 is being skipped which could be the cause of the problem.

--hanz

# lsb_release -a
LSB Version: core-9.20170808ubuntu1-noarch:printing-9.20170808ubuntu1-noarch:security-9.20170808ubuntu1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

pwd

/freespace/local/makmur/xrdp

git log -n5

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

:...skipping...

commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

:...skipping...
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

:...skipping...
commit ea9f4e0ddb712ade5570df7ae5c35a8e1e73eb6b (HEAD -> issue1048, origin/issue1048)
Author: matt335672 <[email protected] >
Date: Thu Sep 3 17:54:49 2020 +0100

Debug logging added. g_create_path() call added

commit 18201592c2c0cf8bb24d016d93fb6e122b711a21
Author: matt335672 <[email protected] >
Date: Fri Aug 28 09:15:57 2020 +0100

Removed debugging code

commit bf54553b80c25c47e8401cbfcea68374a20a3b5b
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:23:42 2020 +0100

Typo in ini file

commit ab14a6f5f9e67b2b43bf2f20c79154f5d26d0265
Author: matt335672 <[email protected] >
Date: Thu Aug 27 12:10:18 2020 +0100

Restructured code to make more generic

commit 5f5591b18bbe10a5904804e7315be3d4ae6dccd4
Author: matt335672 <[email protected] >
Date: Sat Aug 22 18:05:24 2020 +0100

Allow FuseMountName for chansrv to be absolute path

~

pwd

/freespace/local/makmur/xrdp

sed -ne '477,505p' sesman/chansrv/chansrv_fuse.c

/* define FUSE mount point */
if (g_fuse_mount_name[0] == '/')
{
    /* String is an absolute path to the mount point containing
     * %u or %U characters */
    format_user_info(g_fuse_root_path, sizeof(g_fuse_root_path),
                     g_fuse_mount_name);
}
else
{
    /* mount_name is relative to $HOME, e.g. ~/xrdp_client,
     * or ~/thinclient_drives */
    g_snprintf(g_fuse_root_path, sizeof(g_fuse_root_path), "%s/%s",
               g_getenv("HOME"), g_fuse_mount_name);
}
g_snprintf(g_fuse_clipboard_path, 255, "%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_error("mkdir %s failed. If %s is already mounted, you must "
                  "first unmount it", g_fuse_root_path, g_fuse_root_path);
        return -1;
    }
}

more /etc/xrdp/sesman.ini
;; See man 5 sesman.ini for details
...
[Chansrv]
; drive redirection
; See sesman.ini(5) for the format of this parameter
FuseMountName=/run/user/%U/thinclient_drives

FuseMountName=thinclient_drives

; this value allows only the user to acess their own mapped drives.
; Make this more permissive (e.g. 022) if required.
FileUmask=077

ls -l which xrdp-sesman

-rwxr-xr-x 1 root root 160520 Sep 9 13:14 /usr/local/sbin//xrdp-sesman*

find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls

2773107 344 -rwxr-xr-x 1 root root 349664 Sep 9 13:14 /usr/local/lib/xrdp/libcommon.so.0.0.0
2254228 160 -rwxr-xr-x 1 root root 160520 Sep 9 13:14 /usr/local/sbin/xrdp-sesman

pwd

/freespace/local/makmur/xrdp/sesman

c211-1.cs-2+# xrdp-sesman -n
starting sesman in foreground...
Global configuration:
ListenAddress: 127.0.0.1
ListenPort: 3350
EnableUserWindowManager: 1
UserWindowManager: startwm.sh
DefaultWindowManager: /etc/xrdp/startwm.sh
ReconnectScript: /etc/xrdp/reconnectwm.sh
AuthFilePath: disabled
Session configuration:
MaxSessions: 50
X11DisplayOffset: 10
KillDisconnected: 0
IdleTimeLimit: 0
DisconnectedTimeLimit: 0
Policy: 0
Security configuration:
AllowRootLogin: 1
MaxLoginRetry: 4
AlwaysGroupCheck: 0
RestrictOutboundClipboard: 0
TSUsersGroup: (not defined)
TSAdminsGroup: (not defined)
Xorg parameters:
Parameter 00 Xorg
Parameter 01 -config
Parameter 02 xrdp/xorg.conf
Parameter 03 -noreset
Parameter 04 -nolisten
Parameter 05 tcp
Parameter 06 -logfile
Parameter 07 .xorgxrdp.%s.log
Xvnc parameters:
Parameter 00 Xvnc
Parameter 01 -bs
Parameter 02 -nolisten
Parameter 03 tcp
Parameter 04 -localhost
Parameter 05 -dpi
Parameter 06 96
SessionVariables parameters:
Parameter 00 PULSE_SCRIPT=/etc/xrdp/pulse/default.pa
logging configuration:
LogFile: /var/log/xrdp-sesman.log
LogLevel: 4
EnableSyslog: 1
SyslogLevel: 4
[20200909-14:26:24] [DEBUG] libscp initialized
[20200909-14:26:24] [INFO ] starting xrdp-sesman with pid 8060
[20200909-14:26:24] [INFO ] listening to port 3350 on 127.0.0.1

hanz

On Sep 9, 2020, at 5:31 AM, matt335672 <[email protected] notifications@github.com> wrote:

Well, if you're confused that makes two of us!

We can check the dates on all the files. After you've done a clean build and install, the following command should show a very recent time on xrdp-sesman:-

ls -l which xrdp-sesman
Also, what do you get from this one, assuming you're installing somewhere in /usr:-

find /usr -xdev ( -name xrdp-sesman -o -name libcommon.so.0.0.0 ) -ls
Just a small observation - you've got a make install in your command above. You are running that with sudo aren't you?

As I said before, I think we're very close and I appreciate you sticking with this.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-689446581, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIVJOPRSCFXQCZFBSWTSE5DQ7ANCNFSM4ES5PL4Q.

Hi Hanz,

Your logs are consistent with FUSE not working at all.

Can you re-run your configure as:-

./configure --enable-fuse --enable-pixman

That will make sure FUSE gets called if it can be.

Sorry for wasting your time - I should have spotted that earlier. The problem is ./configure is clever enough to default to its previous settings normally so when you rebuild something you don't need to be explicit.

Matt, it works!!

You do need to tell it to configure with --enable-fuse --enable-pixman because these 2 options are not enabled by default.
I missed that as well. I should have checked and save some times.

With setting set on /media, as below:
FuseMountName=/media/thinclient_drives/%u/thinclient_drives

There should not be issues with mount point sitting in location where root has no write access anymore.
I hope this fixed gets released soon.

hanz

On Sep 10, 2020, at 11:31 AM, matt335672 notifications@github.com wrote:

Hi Hanz,

Your logs are consistent with FUSE not working at all.

Can you re-run your configure as:-

./configure --enable-fuse --enable-pixman
That will make sure FUSE gets called if it can be.

Sorry for wasting your time - I should have spotted that earlier. The problem is ./configure is clever enough to default to its previous settings normally so when you rebuild something you don't need to be explicit.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub https://github.com/neutrinolabs/xrdp/issues/1048#issuecomment-690368306, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHYTVIUHQKHVTLCVLUEG3N3SFDWL3ANCNFSM4ES5PL4Q.

Sorry again Hanz - I'm pleased you've got it working though.

I'm going to leave my issue1048 branch alone for now and start another branch (based on devel) in my repo so we can try to get the additional functionality mentioned in my post above working.

If you discover any other problems over the next few days, please come back to me and we can get them addressed. You're also welcome to try the new branch, but because it's based on the latest wavefront it will need to be used with the latest xorgxrdp.

For info, I've just created a branch issue1048-2 in my git repo which contains the above functionality and also:-

  1. adds a variable EnableFuseMount to sesman.ini.
  2. Contains a fix for #1658 which fixes a possible chansrv coredump when FUSE is disabled.

I've got a bit more testing to do before I submit a PR for review.

If you're interested in playing with it, you'll need to upgrade to xorgxrdp 0.2.14 if you're using the Xorg backend.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Kaydub00 picture Kaydub00  Â·  8Comments

AlexNikolaenko picture AlexNikolaenko  Â·  3Comments

Zer0CoolX picture Zer0CoolX  Â·  3Comments

Vraiment picture Vraiment  Â·  6Comments

metalefty picture metalefty  Â·  8Comments