<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>Hi. </div>
<div> </div>
<div>I use samba + winbind to authentication against Active Directory. I set the windbind separator '+' in smb.conf so the user use this username format to login <domain>+<username>. The current code validation of the username under nxserver don't treat the
'+' as character so each a user login the nxserver try to resume the session with that username but could not find the existing session and the result of that nxserver create new session. The nxserver at line 301 use egrep to find the user but the egrep require
to an escape character to in order to try that charactor as a '+'. <br>

<br>

line 307 and 394 <br>

if egrep -q "^userName=$1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i<br>

then<br>

CMDLINE=$(session_get_cmdline $i)<br>

<br>

I include this patch that I put under the nxserver as temporary fixed, I also file up bug id under berliso.de </div>
<div><font face="Arial, sans-serif" size="3"><a href="http://developer.berlios.de/bugs/?func=detailbug&bug_id=17636&group_id=2978"><font color="#0000FF"><u>http://developer.berlios.de/bugs/?func=detailbug&bug_id=17636&group_id=2978</u></font></a> </font></div>
<div><font face="Arial, sans-serif" size="3"> </font></div>
<div><font face="Arial, sans-serif">I am using this version of freenx-server</font></div>
<div><font face="Courier New, monospace">Name        : freenx-server                Relocations: (not relocatable)</font></div>
<div><font face="Courier New, monospace">Version     : 0.7.3                             Vendor: Fedora Project</font></div>
<div><font face="Courier New, monospace">Release     : 18.fc12                       Build Date: Sun 14 Feb 2010 11:26:51 AM EST</font></div>
<div><font face="Courier New, monospace">Install Date: Sat 10 Apr 2010 10:22:54 AM EDT      Build Host: x86-07.phx2.fedoraproject.org</font></div>
<div><font face="Courier New, monospace">Group       : Applications/Internet         Source RPM: freenx-server-0.7.3-18.fc12.src.rpm</font></div>
<div><font face="Courier New, monospace">Size        : 346434                           License: GPLv2</font></div>
<div><font face="Courier New, monospace">Signature   : RSA/8, Sun 14 Feb 2010 06:56:02 PM EST, Key ID 9d1cc34857bbccba</font></div>
<div><font face="Courier New, monospace">Packager    : Fedora Project</font></div>
<div><font face="Courier New, monospace">URL         : <a href="http://freenx.berlios.de/"><font color="#0000FF"><u>http://freenx.berlios.de/</u></font></a></font></div>
<div><font face="Courier New, monospace">Summary     : Free Software (GPL) Implementation of the NX Server</font></div>
<div><font face="Courier New, monospace">Description :</font></div>
<div><font face="Courier New, monospace">NX is an exciting new technology for remote display. It provides near</font></div>
<div><font face="Courier New, monospace">local speed application responsiveness over high latency, low</font></div>
<div><font face="Courier New, monospace">bandwidth links. The core libraries for NX are provided by NoMachine</font></div>
<div><font face="Courier New, monospace">under the GPL. FreeNX-server is a GPL implementation of the NX Server.</font></div>
<div><font face="Courier New, monospace"><font face="Arial, sans-serif" size="3"> </font></font></div>
<div> <br>

<font face="Courier New, monospace">--8<----------cut-here------->8------------ <br>

--- nxserver.orig 2010-02-14 11:26:50.000000000 -0500<br>

+++ nxserver 2010-10-17 22:34:24.371612856 -0400<br>

@@ -47,6 +47,12 @@<br>

return 0<br>

}<br>

<br>

+# Convert escape character '+' in the DOMAIN+user format when using Winbind/SAMBA ADS authentication<br>

+convertUser(){<br>

+ USERESC=$(echo $1 | sed s@+@\\\\+@)<br>

+ echo $USERESC <br>

+}<br>

+<br>

############### PACKAGE log.bm #######################<br>

#<br>

# Library of log functions (outsource)<br>

@@ -301,7 +307,13 @@<br>

do<br>

[ -f $i ] || break<br>

let SESSION_COUNT=$SESSION_COUNT+1<br>

- if egrep -q "^userName=$1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i<br>

+<br>

+# ADD by lmchtng - 2010-08-31 : add escape character to the '+' when username has the form of DOMAIN+username<br>

+ arg1="$(convertUser $1)"<br>

+ if egrep -q "^userName=$arg1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i<br>

+# END ADD<br>

+# ORIGINAL CODE<br>

+# if egrep -q "^userName=$1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i<br>

then<br>

CMDLINE=$(session_get_cmdline $i)<br>

<br>

@@ -357,6 +369,9 @@<br>

printf "%-7s %-16s %32s %8s %5s %-14s %-11s %s\n" "$(getparam display)" "$(getparam type)" "$(getparam sessionId)" "$optio<br>

ns" "$depth" "$geom" "$available" "$(getparam sessionName)" >> $TMPFILE<br>

fi<br>

fi<br>

+# ADD by hien.the.nguy@gmail.com - 2010-08-31 <br>

+# egrep -q "^userName=$arg1$" $i && let SESSION_COUNT_USER=$SESSION_COUNT_USER+1<br>

+# ORIGINAL CODE<br>

egrep -q "^userName=$1$" $i && let SESSION_COUNT_USER=$SESSION_COUNT_USER+1<br>

done<br>

<br>

@@ -394,7 +409,10 @@<br>

for i in $NX_SESS_DIR/running/*<br>

do<br>

[ -f $i ] || break<br>

- if egrep -q "^userName=$1$" $i<br>

+# arg1=$(echo $1 | sed s@+@\\\\+@)<br>

+ arg1="$(convertUser $1)"<br>

+ if egrep -q "^userName=$arg1$" $i<br>

+# if egrep -q "^userName=$1$" $i<br>

then<br>

CMDLINE=$(session_get_cmdline $i)<br>

echo -e "$(getparam host)\t$(getparam display)\t$(getparam userName)\t$(getparam foreignAddress)\t$(getparam sessionId)"<br>

@@ -905,7 +923,11 @@<br>

<br>

echo_x "NX> 103 Welcome to: $SERVER_NAME user: $USER"<br>

<br>

+# ADD by lmchtng - 2010-08-31 : add escape character to the '+' when username has the form of DOMAIN+username<br>

+#arg1=$(echo $USER | sed s@+@\\\\+@)<br>

+#USER="$arg1"<br>

# Add the slave mode shutdown trap (just in case)<br>

+<br>

[ -n "$NXNODE_LOGIN_SLAVE" ] && trap nxnode_login_stop_slave EXIT<br>

<br>

# remove old session infos from history<br>

@@ -996,8 +1018,8 @@<br>

server_nxnode_echo()<br>

{<br>

log 6 "server_nxnode_echo: $@"<br>

- [ "$SERVER_CHANNEL" = "1" ] && echo "$@"<br>

- [ "$SERVER_CHANNEL" = "2" ] && echo "$@" >&2<br>

+ [ "$SERVER_CHANNEL" = "1" ] && /bin/echo "$@"<br>

+ [ "$SERVER_CHANNEL" = "2" ] && /bin/echo "$@" >&2<br>

}<br>

<br>

server_nxnode_exit_func()<br>

<br>

--8<----------cut-here------->8------------ </font></div>
<div><font face="Courier New, monospace"> </font></div>
<div><font face="Courier New, monospace"> </font></div>
<div><font face="Helvetica, sans-serif" size="3" color="#003366"><b>Hien The Nguy</b></font></div>
<div><font face="Helvetica, sans-serif" color="#003366">Ericsson Canada - EMC</font></div>
<div><font face="Helvetica, sans-serif" color="#003366">8400 Decarie</font></div>
<div><font face="Helvetica, sans-serif" color="#003366">H4P 2N2, Montreal, Canada</font></div>
<div><font face="Helvetica, sans-serif" color="#003366">Office: + 1 514 345 7900 ext. 42564</font></div>
<div><font face="Helvetica, sans-serif" color="#003366">ECN:  81042564</font></div>
<div><font face="Helvetica, sans-serif" color="#003366">Mobile: +1 514 290 9755 </font></div>
<div><font face="Helvetica, sans-serif" color="#003366">Email: Hien.The.Nguy@ericsson.com       </font></div>
<div><font face="Helvetica, sans-serif"> </font></div>
<div><font face="Arial, sans-serif"> </font></div>
</font>
</body>
</html>