[FreeNX-kNX] Little bit of recoding :)

s.maddox at functionoffice.org s.maddox at functionoffice.org
Mon Mar 30 13:59:41 UTC 2009



Hi Shima, 

Your code did work in the end I just had to change the == for a = and then
it recognized who had logged in, not sure why that was needed but hey it
worked! 

I have however left it at the bottom of the find node_find_application()
as this seems to stop desktop environments, window managers, vnc, the lot! 

Heres the dif... 

*** nxnode_orig 2009-03-30 15:51:17.000000000 +0100
--- nxnode 2009-03-30 14:09:01.000000000 +0100
***************
*** 236,249 ****
 esac

! #
! # Override startup if Firefox
! #
!
! if [ "$user" = "guest" ]
! then
! echo "firefox"
! else
! echo "$NODE_STARTX"
! fi
 }

--- 236,240 ----
 esac

! echo "$NODE_STARTX"
 }

On Mon, 30 Mar 2009 10:30:23 -0300, Marcelo Boveto Shima  wrote: If you
are worried about this:
 if [ "$virtualdesktop" = "1" -a "$type" = "unix-application" -a
"$DEFAULT_X_WM" != "" -a -x "$(find_app $DEFAULT_X_WM)" ]
 then
 DISPLAY=:$display $DEFAULT_X_WM
>>"$USER_FAKE_HOME/.nx/C-$sess_id/session" 2>&1 &
 NODE_WM_PID=$!
 fi

You
should know that the only place you can set DEFAULT_X_WM is 
 at node.conf. So it will do nothing unless you set it to something like
metacity.

Everything before the "Startup the application" session only manipulate
NODE_APPLICATION and exports some variables like ESPEAKER.

As for don't allow the guest user to run windows/vnc sessions:
[ "$user" = "guest] & margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> 

Hi Shima, 

Using this method allows someone to start a window manager like Gnome and
then do other things. If the user logging in is 'guest' I need them to be
able to run absolutely nothing no matter what they have chosen except for
the given command. 

I'll try putting your code elsewhere to see if it can work better to get
around this. 

Thanks! 

Steven   

On Sun, 29 Mar 2009 22:28:50 -0300, Marcelo Boveto Shima  wrote: Probably
you will want to hack on "node_start_applications()" function at the 
"Startup the application" session.

Something like:
 if [ "$user" == "guest"
]
 then
 NODE_APPLICATION="firefox"
 fi

just before the app invocation line:
DISPLAY=:$display $NODE_APPLICATION
>>"$USER_FAKE_HOME/.nx/C-$sess_id/session" 2>&1 margin: 0pt 0pt 0pt 0.8ex;
padding-left: 1ex;">Hey, here is an extract out of file 'nxnode'...

 node_find_application()
 {
 NODE_STARTX=""
 case $1 in
 shadow|windows|vnc)
 :
 ;;
 unix-kde)
 NODE_STARTX=$COMMAND_START_KDE
 ;;
 unix-gnome)
 NODE_STARTX=$COMMAND_START_GNOME
 ;;
 unix-cde)
 NODE_STARTX=$COMMAND_START_CDE
 ;;
 unix-application|windows-helper|vnc-helper)
 [ "$application" = "xterm" ] &;
 unix-console)
 NODE_STARTX=$COMMAND_XTERM
 ;;
 unix-default|*)
 if [ -x "$HOME/$USER_X_STARTUP_SCRIPT" ]; then
 NODE_STARTX="$HOME/$USER_X_STARTUP_SCRIPT"
 elif which "$DEFAULT_X_SESSION" >/dev/null 2> then
 NODE_STARTX="$DEFAULT_X_SESSION"
 else
 NODE_STARTX=$COMMAND_XTERM
 fi
 ;;
 esac

 # if [ "$HOME" != "guest" ] then
 # echo "$NODE_STARTX"
 # else
 echo "firefox"
 # fi
 }

 At the end you can see I've added some lines so it
ignores whatever was
picked
 and instead overrides it with my application... firefox.

 Basically you log in to my box with user/pass guest:guest.
 And you get a locked down... intranet only... remote firefox window.

 Only thing is I'd like to use this box for normal NX sessions too and
this
 prevents that.
 My commented out attempt at checking if the user is 'guest' and -then- go
force
 firefox isn't working for some reason and I'm not the greatest bash coder
in
 the world.

 Any tips on if this is a secure way of doing what I want and/or how to
make
 it work?

 Steve

 ________________________________________________________________
 Were you helped on this list with your FreeNX problem?
 Then please write up the solution in the FreeNX Wiki/FAQ:

 http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
[2]

 Don't forget to check the NX Knowledge Base:
 http://www.nomachine.com/kb/ [3]

 ________________________________________________________________
 FreeNX-kNX
mailing list --- FreeNX-kNX at kde.org [4]
 https://mail.kde.org/mailman/listinfo/freenx-knx [5]
 ________________________________________________________________

________________________________________________________________
 Were you helped on this list with your FreeNX problem?
 Then please write up the solution in the FreeNX Wiki/FAQ:

 http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
[6]

 Don't forget to check the NX Knowledge Base:
 http://www.nomachine.com/kb/ [7]

 ________________________________________________________________
 FreeNX-kNX mailing list --- FreeNX-kNX at kde.org [8]
 https://mail.kde.org/mailman/listinfo/freenx-knx [9]
 ________________________________________________________________

 

Links:
------
[1] mailto:marceloshima at gmail.com
[2]
http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
[3] http://www.nomachine.com/kb/
[4] mailto:FreeNX-kNX at kde.org
[5]
https://mail.kde.org/mailman/listinfo/freenx-knx
[6]
http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ
[7] http://www.nomachine.com/kb/
[8] mailto:FreeNX-kNX at kde.org
[9] https://mail.kde.org/mailman/listinfo/freenx-knx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/freenx-knx/attachments/20090330/06259254/attachment.html>


More information about the FreeNX-kNX mailing list