<p>Hi Shima,</p>
<p>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!</p>
<p>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!</p>
<p>Heres the dif...</p>
<p>*** nxnode_orig 2009-03-30 15:51:17.000000000 +0100<br />--- nxnode 2009-03-30 14:09:01.000000000 +0100<br />***************<br />*** 236,249 ****<br /> esac<br /><br />! #<br />! # Override startup if Firefox<br />! #<br />!<br />! if [ "$user" = "guest" ]<br />! then<br />! echo "firefox"<br />! else<br />! echo "$NODE_STARTX"<br />! fi<br /> }<br /><br />--- 236,240 ----<br /> esac<br /><br />! echo "$NODE_STARTX"<br /> }<br /><br /></p>
<p>On Mon, 30 Mar 2009 10:30:23 -0300, Marcelo Boveto Shima <marceloshima@gmail.com> wrote:</p>
<blockquote style="border-left: 2px solid #1010ff; padding-left: 5px; margin-left: 5px; width: 100%;">If you are worried about this:<br /> if [ "$virtualdesktop" = "1" -a "$type" = "unix-application" -a "$DEFAULT_X_WM" != "" -a -x "$(find_app $DEFAULT_X_WM)" ]<br /> then<br /> DISPLAY=:$display $DEFAULT_X_WM >>"$USER_FAKE_HOME/.nx/C-$sess_id/session" 2>&1 &<br /> NODE_WM_PID=$!<br /> fi<br /><br />You should know that the only place you can set DEFAULT_X_WM is <br /> at node.conf. So it will do nothing unless you set it to something like<br />metacity.<br /><br />Everything before the "Startup the application" session only manipulate<br />NODE_APPLICATION and exports some variables like ESPEAKER.<br /> <br />As for don't allow the guest user to run windows/vnc sessions:<br />[ "$user" = "guest] && type="unix-application"<br />first thing at node_start_agent() should do the trick.<br /><br />Regards.<br /> <br />
<div class="gmail_quote">2009/3/30 <span><<a href="mailto:s.maddox@functionoffice.org">s.maddox@functionoffice.org</a>></span><br />
<blockquote class="gmail_quote" style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<p>Hi Shima,</p>
<p>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.</p>
<p>I'll try putting your code elsewhere to see if it can work better to get around this.</p>
<p>Thanks!</p>
<p>Steven</p>
<div>
<div class="h5">
<p> </p>
<p>On Sun, 29 Mar 2009 22:28:50 -0300, Marcelo Boveto Shima <<a href="mailto:marceloshima@gmail.com" target="_blank">marceloshima@gmail.com</a>> wrote:</p>
<blockquote style="border-left: 2px solid #1010ff; padding-left: 5px; margin-left: 5px; width: 100%;">Probably you will want to hack on "node_start_applications()" function at the <br />"Startup the application" session.<br /> <br />Something like:<br /> if [ "$user" == "guest" ]<br /> then<br /> NODE_APPLICATION="firefox"<br /> fi<br /><br />just before the app invocation line:<br />DISPLAY=:$display $NODE_APPLICATION >>"$USER_FAKE_HOME/.nx/C-$sess_id/session" 2>&1 &<br /> <br />Changing NODE_APPLICATION just before it will be called ensures you that the session will<br /> not be called with something like Xsession.<br /><br />Regards.<br />Shima<br /><br />
<div class="gmail_quote">On Thu, Mar 26, 2009 at 8:17 AM, Steven Maddox <span><<a href="mailto:s.maddox@cyorxamp.info" target="_blank">s.maddox@cyorxamp.info</a>></span> wrote:<br />
<blockquote class="gmail_quote" style="border-left: 1px solid #cccccc; margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hey, here is an extract out of file 'nxnode'...<br /> <br /> node_find_application()<br /> {<br /> NODE_STARTX=""<br /> case $1 in<br /> shadow|windows|vnc)<br /> :<br /> ;;<br /> unix-kde)<br /> NODE_STARTX=$COMMAND_START_KDE<br /> ;;<br /> unix-gnome)<br /> NODE_STARTX=$COMMAND_START_GNOME<br /> ;;<br /> unix-cde)<br /> NODE_STARTX=$COMMAND_START_CDE<br /> ;;<br /> unix-application|windows-helper|vnc-helper)<br /> [ "$application" = "xterm" ] && application=$COMMAND_XTERM<br /> NODE_STARTX=$application<br /> ;;<br /> unix-console)<br /> NODE_STARTX=$COMMAND_XTERM<br /> ;;<br /> unix-default|*)<br /> if [ -x "$HOME/$USER_X_STARTUP_SCRIPT" ]; then<br /> NODE_STARTX="$HOME/$USER_X_STARTUP_SCRIPT"<br /> elif which "$DEFAULT_X_SESSION" >/dev/null 2>&1 ; then<br /> NODE_STARTX="$DEFAULT_X_SESSION"<br /> else<br /> NODE_STARTX=$COMMAND_XTERM<br /> fi<br /> ;;<br /> esac<br /> <br /> # if [ "$HOME" != "guest" ] then<br /> # echo "$NODE_STARTX"<br /> # else<br /> echo "firefox"<br /> # fi<br /> }<br /> <br /> At the end you can see I've added some lines so it ignores whatever was picked<br /> and instead overrides it with my application... firefox.<br /> <br /> Basically you log in to my box with user/pass guest:guest.<br /> And you get a locked down... intranet only... remote firefox window.<br /> <br /> Only thing is I'd like to use this box for normal NX sessions too and this<br /> prevents that.<br /> My commented out attempt at checking if the user is 'guest' and -then- go force<br /> firefox isn't working for some reason and I'm not the greatest bash coder in<br /> the world.<br /> <br /> Any tips on if this is a secure way of doing what I want and/or how to make<br /> it work?<br /> <br /> Steve<br /> <br /> ________________________________________________________________<br /> Were you helped on this list with your FreeNX problem?<br /> Then please write up the solution in the FreeNX Wiki/FAQ:<br /> <br /> <a href="http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ" target="_blank">http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ</a><br /> <br /> Don't forget to check the NX Knowledge Base:<br /> <a href="http://www.nomachine.com/kb/" target="_blank">http://www.nomachine.com/kb/</a><br /> <br /> ________________________________________________________________<br /> FreeNX-kNX mailing list --- <a href="mailto:FreeNX-kNX@kde.org" target="_blank">FreeNX-kNX@kde.org</a><br /> <a href="https://mail.kde.org/mailman/listinfo/freenx-knx" target="_blank">https://mail.kde.org/mailman/listinfo/freenx-knx</a><br /> ________________________________________________________________<br /></blockquote>
</div>
<br /></blockquote>
<p> </p>
</div>
</div>
<br />________________________________________________________________<br /> Were you helped on this list with your FreeNX problem?<br /> Then please write up the solution in the FreeNX Wiki/FAQ:<br /> <br /> <a href="http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ" target="_blank">http://openfacts2.berlios.de/wikien/index.php/BerliosProject:FreeNX_-_FAQ</a><br /> <br /> Don't forget to check the NX Knowledge Base:<br /> <a href="http://www.nomachine.com/kb/" target="_blank">http://www.nomachine.com/kb/</a><br /> <br /> ________________________________________________________________<br /> FreeNX-kNX mailing list --- <a href="mailto:FreeNX-kNX@kde.org">FreeNX-kNX@kde.org</a><br /> <a href="https://mail.kde.org/mailman/listinfo/freenx-knx" target="_blank">https://mail.kde.org/mailman/listinfo/freenx-knx</a><br /> ________________________________________________________________<br /></blockquote>
</div>
<br /></blockquote>
<p> </p>