[FreeNX-kNX] fix required for usermode to function properly

Fabian Franz FabianFranz at gmx.de
Fri Apr 27 18:53:12 UTC 2007


> I just wanted to confirm that, for me, the fix to nxnode mentioned by
> Brian Ferris in his email (thanks Brian ;-) :
> 
>  http://mail.kde.org/pipermail/freenx-knx/2006-December/004385.html
> 
> is required to get it to work for me.  In other words, the nxnode needs
> to use 127.0.0.1 as 'userip', not the actual remote IP of the client. 

Okay, he this is really cool that there are actually people out there using the Usermode.

> I'm primarily sending this in the hopes that someone will know what the
> 'correct' fix is and get it applied upstream, and also for users
> 'googling'.  The important error message is in the session log:

>If we go back and look at the source for nxnode, we find:

>    if [ "$ssl_tunnel" = "1" ]
>    then
>            # we need to use the IP of the "calling" server now
>            userip=$(echo $SSH_CLIENT $SSH2_CLIENT | cut -d" " -f1 | sed
>'s/::ffff://g')
>
>            # TODO: This logic is broken ... ;-)
>            [ -z "$userip" ] && userip="127.0.0.1"
>            [ -z "$userip" -a "$host" != "127.0.0.1" ] && userip="*"
>    fi

This code was changed to support load balancing, but as you can clearly see from the comment. The logic is "a bit" broken.

And I think I got a fix. Please try:

             userip=$(echo $SSH_CLIENT $SSH2_CLIENT | cut -d" " -f1 | sed
's/::ffff://g')

-            # TODO: This logic is broken ... ;-)
-            [ -z "$userip" ] && userip="127.0.0.1"
-            [ -z "$userip" -a "$host" != "127.0.0.1" ] && userip="*"
+            [ "$host" = "127.0.0.1" ] && userip="127.0.0.1"
+            [ -z "$userip" ] && userip="*"

cu

Fabian



More information about the FreeNX-kNX mailing list