[FreeNX-kNX] A minor bug in freenx login method

Dimitar Paskov pascoff at nola7.com
Thu Jan 31 11:44:41 UTC 2008


I just found a minor bug in login method in nxserver (2.1.0-71). It can 
be reproduced when login with a password that has space(es) as an ending 
or begining character(s) (" mypassword " for example). The problem is in 
bash actually and how it reads the password. You can find it in the 
Login stage -> login case:

###############
echo_x -n "NX> 102 Password: "
read -s PASS
###############

Here we have IFS=$' \t\n' so when "read" reads a password with a space 
char (or tab) at the end or at the beginning, it "thinks" it is a 
Internal Field Separator and doesn't assign it in the variable. A quick 
fix is to temporary change the IFS variable like this example:

###############
old_ifs="$IFS"
export IFS=$'\n'
read -s PASS
export IFS="$old_ifs"
###############

Thats it :) I hope it helps.

ps: if the password has spaces between other characters everything is ok



More information about the FreeNX-kNX mailing list