Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 18th October 2010, 02:27 PM
seikai Offline
Registered User
 
Join Date: Oct 2010
Posts: 1
windows_vistachrome
nxserver creates new session every time when the username has the format <domain>+<u

Hi.

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 '+'.*

line 307 and 394*
if egrep -q "^userName=$1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i
then
CMDLINE=$(session_get_cmdline $i)

I include this patch that I put under the nxserver as temporary fixed, I also file up bug id under berliso.de
http://developer.berlios.de/bugs/?fu...&group_id=2978

I am using this version of freenx-server
Name : freenx-server Relocations: (not relocatable)
Version : 0.7.3 Vendor: Fedora Project
Release : 18.fc12 Build Date: Sun 14 Feb 2010 11:26:51 AM EST
Install Date: Sat 10 Apr 2010 10:22:54 AM EDT Build Host: x86-07.phx2.fedoraproject.org
Group : Applications/Internet Source RPM: freenx-server-0.7.3-18.fc12.src.rpm
Size : 346434 License: GPLv2
Signature : RSA/8, Sun 14 Feb 2010 06:56:02 PM EST, Key ID 9d1cc34857bbccba
Packager : Fedora Project
URL : http://freenx.berlios.de/
Summary : Free Software (GPL) Implementation of the NX Server
Description :
NX is an exciting new technology for remote display. It provides near
local speed application responsiveness over high latency, low
bandwidth links. The core libraries for NX are provided by NoMachine
under the GPL. FreeNX-server is a GPL implementation of the NX Server.

*
--8<----------cut-here------->8------------
--- nxserver.orig 2010-02-14 11:26:50.000000000 -0500
+++ nxserver 2010-10-17 22:34:24.371612856 -0400
@@ -47,6 +47,12 @@
return 0
}

+# Convert escape character '+' in the DOMAIN+user format when using Winbind/SAMBA ADS authentication
+convertUser(){
+ USERESC=$(echo $1 | sed s@+@\\\\+@)
+ echo $USERESC*
+}
+
############### PACKAGE log.bm #######################
#
# Library of log functions (outsource)
@@ -301,7 +307,13 @@
do
[ -f $i ] || break
let SESSION_COUNT=$SESSION_COUNT+1
- if egrep -q "^userName=$1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i
+
+# ADD by lmchtng - 2010-08-31 : add escape character to the '+' when username has the form of DOMAIN+username
+ arg1="$(convertUser $1)"
+ if egrep -q "^userName=$arg1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i
+# END ADD
+# ORIGINAL CODE
+# if egrep -q "^userName=$1$" $i && egrep -q "^status=$2$" $i #&& grep -q "screeninfo=$3" $i
then
CMDLINE=$(session_get_cmdline $i)

@@ -357,6 +369,9 @@
printf "%-7s %-16s %32s %8s %5s %-14s %-11s %s\n" "$(getparam display)" "$(getparam type)" "$(getparam sessionId)" "$optio
ns" "$depth" "$geom" "$available" "$(getparam sessionName)" >> $TMPFILE
fi
fi
+# ADD by hien.the.nguy@gmail.com - 2010-08-31*
+# egrep -q "^userName=$arg1$" $i && let SESSION_COUNT_USER=$SESSION_COUNT_USER+1
+# ORIGINAL CODE
egrep -q "^userName=$1$" $i && let SESSION_COUNT_USER=$SESSION_COUNT_USER+1
done

@@ -394,7 +409,10 @@
for i in $NX_SESS_DIR/running/*
do
[ -f $i ] || break
- if egrep -q "^userName=$1$" $i
+# arg1=$(echo $1 | sed s@+@\\\\+@)
+ arg1="$(convertUser $1)"
+ if egrep -q "^userName=$arg1$" $i
+# if egrep -q "^userName=$1$" $i
then
CMDLINE=$(session_get_cmdline $i)
echo -e "$(getparam host)\t$(getparam display)\t$(getparam userName)\t$(getparam foreignAddress)\t$(getparam sessionId)"
@@ -905,7 +923,11 @@

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

+# ADD by lmchtng - 2010-08-31 : add escape character to the '+' when username has the form of DOMAIN+username
+#arg1=$(echo $USER | sed s@+@\\\\+@)
+#USER="$arg1"
# Add the slave mode shutdown trap (just in case)
+
[ -n "$NXNODE_LOGIN_SLAVE" ] && trap nxnode_login_stop_slave EXIT

# remove old session infos from history
@@ -996,8 +1018,8 @@
server_nxnode_echo()
{
log 6 "server_nxnode_echo: $@"
- [ "$SERVER_CHANNEL" = "1" ] && echo "$@"
- [ "$SERVER_CHANNEL" = "2" ] && echo "$@" >&2
+ [ "$SERVER_CHANNEL" = "1" ] && /bin/echo "$@"
+ [ "$SERVER_CHANNEL" = "2" ] && /bin/echo "$@" >&2
}

server_nxnode_exit_func()

--8<----------cut-here------->8------------
Reply With Quote
Reply

Tags
<domain>, <u, creates, format, nxserver, session, time, username

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Time display format Seedrick Using Fedora 5 23rd May 2010 02:09 PM
how do I get time in unixtime format? gold Using Fedora 3 6th March 2008 04:15 PM
What does session opened for user USERNAME by (uid=0) mean? mysteron Using Fedora 2 1st October 2007 11:31 AM
setup sub domain in Linux fedora core 3 (using KDE session) kakarock Guides & Solutions (No Questions) 0 19th May 2006 05:32 AM
Change username through remote ssh session mick-porter Using Fedora 1 19th February 2006 07:05 AM


Current GMT-time: 14:26 (Thursday, 24-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat