<br><font size=2 face="sans-serif">Here's a patch to nxnode which adds
code to support xdmcp. As you can see there isn't much to it !!</font>
<br>
<br><font size=2 face="sans-serif">It adds code so it shouldn't affect
anything else, but as ever, make a backup and test it "out of hours"</font>
<br><font size=2 face="sans-serif">in case I messed up copying it into
the email for example.</font>
<br>
<br><font size=2 face="sans-serif">Notes</font>
<br><font size=2 face="sans-serif">As a good common basis I've added it
to the original 2008 version of nxnode</font>
<br><font size=2 face="sans-serif">then run "diff" </font>
<br><font size=2 face="sans-serif">but</font>
<br><font size=2 face="sans-serif">the nxnode from your distro will probably
be different as various patches have been added.</font>
<br>
<br><font size=2 face="sans-serif">You can add manually if "patch"
doesnt work.</font>
<br>
<br>
<br><font size=2 face="sans-serif">The "port" directive is ignored
by my nxagent, but I added it anyway in case that changes.</font>
<br><font size=2 face="sans-serif">"Broadcast" doesn't produce
any broadcasts from my nxagent (it does from my ordinary Xorg).</font>
<br>
<br><font size=2 face="sans-serif">If anyone finds port and broadcast working
I'd be interested to know which version of NX you use.</font>
<br>
<br>
<br><font size=2 face="sans-serif">You can add the following to /etc/nxserver/node.conf
:-</font>
<br>
<br><font size=2 face="sans-serif">XDM_PORT=177</font>
<br><font size=2 face="sans-serif">XDM_TYPE=query</font>
<br><font size=2 face="sans-serif">XDM_HOST=myhost</font>
<br>
<br><font size=2 face="sans-serif">Which supports the nxclient option to
"Let the NX server decide, use host and port mandated by the NX server
administrator"</font>
<br>
<br><font size=2 face="sans-serif">If you want greater granularity, then
you can change the parmeters using /usr/bin/nxacl for selected users or
groups, which can overwrite whatever they select in nxclient,</font>
<br><font size=2 face="sans-serif">or</font>
<br><font size=2 face="sans-serif">if you trap port=-1 and then check the
user, you can allow them to have their own default but still choose if
they need to.</font>
<br>
<br><font size=2 face="sans-serif">If you want to, you can add the "-from
local-address" also to node.conf</font>
<br>
<br><font size=2 face="sans-serif">XDM_LOCAL_ADDRESS="$(hostname --fqdn)"</font>
<br><font size=2 face="sans-serif">or if you know the static ip address</font>
<br><font size=2 face="sans-serif">XDM_LOCAL_ADDRESS="192.168.1.100"</font>
<br><font size=2 face="sans-serif">depending</font>
<br><font size=2 face="sans-serif">upon which interface on the FreeNX server
the xdmcp will exit,</font>
<br>
<br><font size=2 face="sans-serif">however</font>
<br><font size=2 face="sans-serif">I have multihomed hosts and split dns
etc.</font>
<br><font size=2 face="sans-serif">so</font>
<br><font size=2 face="sans-serif">I set the default to ask "ip route
get xdmcp-server-name" for the src interface for the xdm host.</font>
<br>
<br><font size=2 face="sans-serif">This also allows for changing the addressing
or dhcp on your FreeNX machine.</font>
<br>
<br><font size=2 face="sans-serif">In this case eiher miss out XDM_LOCAL_ADDRESS
or put</font>
<br><font size=2 face="sans-serif">XDM_LOCAL_ADDRESS=""</font>
<br><font size=2 face="sans-serif">into node.conf</font>
<br>
<br><font size=2 face="sans-serif">The nxclient option "Query an X
desktop manager" works with Host set to "localhost" set
so you can test it against your FreeNX server itself.</font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif">--- nxnode 2008-08-23
13:09:39.000000000 +0100<br>
+++ nxnode.xdmcp 2011-11-28 11:58:33.000000000
+0000<br>
@@ -224,6 +224,9 @@<br>
unix-console)<br>
NODE_STARTX=$COMMAND_XTERM<br>
;;<br>
+ unix-xdm)<br>
+
NODE_STARTX=""<br>
+ ;;<br>
unix-default|*)<br>
if [ -x "$HOME/$USER_X_STARTUP_SCRIPT"
]; then<br>
NODE_STARTX="$HOME/$USER_X_STARTUP_SCRIPT"<br>
@@ -522,6 +525,68 @@<br>
#
nxproxy single application mode session<br>
[
"$SET_LD_LIBRARY_PATH" = "1" ] && export LD_LIBRARY_PATH="$PROXY_LIBRARY_PATH:$LD_LIBRARY_PATH"<br>
$PATH_BIN/nxproxy
-C :$display $PROXY_EXTRA_OPTIONS 2>&3 &<br>
+<br>
+ elif [ "$type" = "unix-xdm"
]
#eg --xdm_type="query" --xdm_host="192.168.1.100"
--xdm_port="177"<br>
+ then<br>
+ XDM_PORT_TEST=$(getparam
xdm_port) # need to get this first to
check for -1 . .<br>
+ if
[ $XDM_PORT_TEST != -1 ] ; then # DON'T
use any host/port values set up by the admin setting XDM_PORT XDM_TYPE
XDM_HOST in node.conf<br>
+
XDM_PORT=$(getparam xdm_port)<br>
+
XDM_TYPE=$(getparam xdm_type)<br>
+
XDM_HOST=$(getparam xdm_host)<br>
+ FROM_INTERFACE=""
# initialise the " -from " parameter. If querying localhost (!!??)
or listing localhost leave empty</font>
<br><font size=2 face="sans-serif">+
# else<br>
+
# $XDM_PORT_TEST = -1 so use the so
use the values already set from /etc/nxserver/node.conf (do nothing)<br>
+ fi<br>
+<br>
+ #
Anything parameters missing ??<br>
+ [
-z $XDM_PORT ] && XDM_PORT=177
#
Set default if blank<br>
+ [
-z $XDM_TYPE ] && XDM_TYPE="broadcast"
# No type is set,
try broadcast and clear XDM_HOST<br>
+ [
-z $XDM_HOST ] && XDM_HOST="localhost"
# Ensure XDM_HOST
is set to something<br>
+ [
$XDM_TYPE = "broadcast" ] && XDM_HOST=""
# Clear XDM_HOST if type is broadcast else
nxagent complains<br>
+ [
$XDM_TYPE = "list" ] && XDM_TYPE="indirect"
# nxclient says list but nxagent wants
indirect<br>
+<br>
+ if
[ $XDM_TYPE = "query" -a $XDM_HOST != "localhost" -o
$XDM_TYPE = "indirect" -a $XDM_HOST != "localhost"
] ; then # ensure we have a "-from local-address" set<br>
+
# NOTE<br>
+
# local-address in "-from local-address"
if a hostname,must resolve on the FREENX server<br>
+
#
to a (return) IP address accessible
from xdmcp target host which you want to use.<br>
+
# so either set the relevent IP address
or hostname manually in /etc/nxserver/node.conf</font>
<br><font size=2 face="sans-serif">+
#
i.e. add XDM_LOCAL_ADDRESS=hostname or XDM_LOCAL_ADDRESS=a.b.c.d<br>
+
# or hostname/hostname -fqdn should
work in most cases,instead of the IP address<br>
+
# i.e. you can uncomment here<br>
+
# XDM_LOCAL_ADDRESS="$(hostname
--fqdn)"<br>
+
# or<br>
+
# XDM_LOCAL_ADDRESS="$(hostname)"<br>
+
# both
of which will resolv to a local IP address (and can also be put in /etc/nxserver/node.conf
instead)<br>
+
# but<br>
+
# when multi-homed with a split DNS
you might be in for some fun, so I ask "ip route get" for an
egress address for the xdmcp host.<br>
+
# In fact -from is there for just this
reason, so . . . .<br>
+<br>
+
if [ -z $XDM_LOCAL_ADDRESS ] ; then
# If we don't have a local address/hostname set yet, let's see which interface
ip route will choose for the xdmcp host<br>
+
if
[ $(echo $XDM_HOST|egrep -c "^([0-9]{1,3}[.]){3}[0-9]{1,3}$"
) -eq 1 ] ; then<br>
+
# Not a host-name & (maybe not a
proper IP address, but I don't care)<br>
+
XDM_HOST_ADDRESS=$XDM_HOST<br>
+
else<br>
+
# A host name so resolv & get 1st
IP address to ask IP route for an egress IP as a -from local-address</font>
<br><font size=2 face="sans-serif">+
XDM_HOST_ADDRESS=$(dig
+short +search $XDM_HOST|egrep "^([0-9]{1,3}[.]){3}[0-9]{1,3}$"|tr
"\n" " "|cut -d " " -f1)<br>
+
fi<br>
+<br>
+
XDM_LOCAL_ADDRESS="$(ip route get
$XDM_HOST_ADDRESS|grep src|sed -e "s/^.* src //g") "<br>
+
fi<br>
+
# now we can set up the command line
parameter<br>
+
FROM_INTERFACE=" -from $XDM_LOCAL_ADDRESS
" <br>
+ fi<br>
+ #
add our options to AGENT_EXTRA_OPTIONS_X and need to remove the default
" -nolisten tcp " if its still there.<br>
+ AGENT_EXTRA_OPTIONS_X=$(echo
" $AGENT_EXTRA_OPTIONS_X -$XDM_TYPE $XDM_HOST $FROM_INTERFACE -port
$XDM_PORT "|sed -e "s/ -nolisten[ ]\{1,\}tcp//g")<br>
+<br>
+ [
"$SET_LD_LIBRARY_PATH" = "1" ] && export LD_LIBRARY_PATH="$AGENT_LIBRARY_PATH:$LD_LIBRARY_PATH"<br>
+ P=$(node_agent_persistent_session)<br>
+ FP=""<br>
+ [
-n "$AGENT_FONT_SERVER" ] && FP="-fp $AGENT_FONT_SERVER"<br>
+<br>
+ #
Start the agent<br>
+ <br>
+ PATH="$PATH_BIN:$PATH"
$PATH_BIN/nxagent $P $R -name "NX - $user@$SERVER_NAME:$display -
$session (GPL Edition)" -option "$USER_FAKE_HOME/.nx/C-$sess_id/options"
$K $G $B $FP $AGENT_EXTRA_OPTIONS_X :$display 2>&3 &</font>
<br><font size=2 face="sans-serif">+<br>
else<br>
#
nxagent session (X11)<br>
[
"$SET_LD_LIBRARY_PATH" = "1" ] && export LD_LIBRARY_PATH="$AGENT_LIBRARY_PATH:$LD_LIBRARY_PATH"</font>
<br>