[FreeNX-kNX] windows/osx shares fail to mount

Johannes Scholz lgdlubyou at googlemail.com
Mon Jul 26 17:22:50 UTC 2010


After some debugging I found two issues.
Issue number seems to be a bash related error. 

Minimal example:

# OSX

kebab:~ me$ bash --version
GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)
Copyright (C) 2007 Free Software Foundation, Inc.

kebab:~ me$ test_cmd="ENVVAR=\"foo\" ls"

kebab:~ me$ $test_cmd 
-bash: ENVVAR="foo": command not found

kebab:~ me$ $($test_cmd)
-bash: ENVVAR="foo": command not found

# LINUX, Ubuntu 10.04

apollo:~$ bash --version
GNU bash, version 4.1.5(1)-release (i486-pc-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

apollo:~$ test_cmd="ENVVAR=\"foo\" ls"

apollo:~$ $test_cmd 
ENVVAR="foo": command not found

apollo:~$ $($test_cmd)
ENVVAR="foo": command not found

I do not know whether this is a bug in bash or expected behaviour.
I mention the examples here because a code pattern like that is used 
in nxnode. I managed to fix it by changing it to the following:


--- nxnode.orig 2010-07-26 18:56:00.000000000 +0200
+++ nxnode      2010-07-26 19:05:10.000000000 +0200
@@ -1921,9 +1921,9 @@
        # dimbor: add russian, save cmdstr and kill dialogs
        if [ -n "$SMB_MOUNT_OPTIONS" ]
        then
-           MNTSTR="PASSWD=\"$password\" $COMMAND_SMBMOUNT //$computername/$share $dir -o username=$username,ip=127.0.0.1,port=$port,$SMB_MOUNT_OPTIONS 2>&1"
+           MNTSTR="$COMMAND_SMBMOUNT //$computername/$share $dir -o username=$username%$password,ip=127.0.0.1,port=$port,$SMB_MOUNT_OPTIONS 2>&1"
        else
-           MNTSTR="PASSWD=\"$password\" $COMMAND_SMBMOUNT //$computername/$share $dir -o username=$username,ip=127.0.0.1,port=$port 2>&1"
+           MNTSTR="$COMMAND_SMBMOUNT //$computername/$share $dir -o username%$password=$username,ip=127.0.0.1,port=$port 2>&1"
        fi
        echo "$DELIM 701 Attempt to start $MNTSTR"
        error=$($MNTSTR)

This seems to work when manually trying on the command line.

The other issue i am having is that nxnode seems to be called with 
normal user uid instead of uid 0, thus mount fails. 

I guess it would be nice if Marcelo Boveto Shima could say something about t
his, because it seems that he is the one who packaged freenx for the freenx stable ppa.

I could of course set the sticky bit on mount.cifs/mount.smbfs, but i do not think
that that is the right approach. 

Regards,

Johannes Scholz

Am 26.07.2010 um 16:33 schrieb chris at ccburton.com:

> 
> Johannes Scholz <lgdlubyou at googlemail.com> wrote on 26/07/2010 14:41:27:
> 
> > Hi Chris 
> 
> Hi 
> 
> > 
> > Am 26.07.2010 um 15:23 schrieb chris at ccburton.com: 
> > 
> > Do you mean you can mount the workstation's shares on the NX server 
> > from within the NX session, over the ssh tunnel ??? 
> > 
> > This is exactly what i can do, ie 
> > i can connect to the freenx server using nx client and then do something like 
> > 
> > mount -t smbfs //mycomputer.local/my_share /mnt -o 
> > username=myusername,ip=127.0.0.1,port=5000 
> > 
> > on the console (which seems to be what the node bash script does). 
> > 
> > As far as timeouts go - maybe, but its a big maybe since i do not 
> > seem to have issues with latency, bandwidth etc. 
> 
> It's mainly to do with the length of time it takes to set up the tunnel, 
> but you also get issues of you are mounting several shares. 
> 
> As a diagnostic/bodge try adding a 
> 
>                 sleep 10 
> 
> at about line 1400 in nxnode, after 
> 
>         # sometimes the samba port we get from nxserver is not the right one, so let's get it from nxagent 
> 
> and see if that gets it going. 
> 
> 
> A better fix of course, is to put 
> 
>         error=$(PASSWD="$password" $COMMAND_SMBMOUNT "//$computername/$share" "$HOME/$dir" -o username="$username",ip=127.0.0.1,port=$port 2>&1) 
> 
> in a loop, testing the return code, for a couple of attempts with a sleep 1 
> in it for when it fails. 
> 
> Note, most people don't seem to use this, or the printing, hence the lack 
> of interest . . . 
> 
> Let us know how you get on . . . . 
> 
> > 
> > Regards, 
> > 
> > Johannes Scholz________________________________________________________________
>     Were you helped on this list with your FreeNX problem?
>    Then please write up the solution in the FreeNX Wiki/FAQ:
> 
> http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
> 
>         Don't forget to check the NX Knowledge Base:
>                 http://www.nomachine.com/kb/ 
> 
> ________________________________________________________________
>       FreeNX-kNX mailing list --- FreeNX-kNX at kde.org
>      https://mail.kde.org/mailman/listinfo/freenx-knx
> ________________________________________________________________

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20100726/914149ca/attachment.html>


More information about the FreeNX-kNX mailing list