[FreeNX-kNX] Little bit of recoding :)

Marcelo Boveto Shima marceloshima at gmail.com
Mon Mar 30 13:30:23 UTC 2009


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] && type="unix-application"
first thing at node_start_agent() should do the trick.

Regards.

2009/3/30 <s.maddox at functionoffice.org>

> 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 <
> marceloshima at gmail.com> 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 &
>
> Changing NODE_APPLICATION just before it will be called ensures you that
> the session will
> not be called with something like Xsession.
>
> Regards.
> Shima
>
> On Thu, Mar 26, 2009 at 8:17 AM, Steven Maddox <s.maddox at cyorxamp.info>wrote:
>
>> 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" ] &&
>> application=$COMMAND_XTERM
>>                        NODE_STARTX=$application
>>                ;;
>>                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>&1 ;
>> 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
>>
>>         Don't forget to check the NX Knowledge Base:
>>                 http://www.nomachine.com/kb/
>>
>> ________________________________________________________________
>>       FreeNX-kNX mailing list --- FreeNX-kNX at kde.org
>>      https://mail.kde.org/mailman/listinfo/freenx-knx
>> ________________________________________________________________
>>
>
>
>
> ________________________________________________________________
>     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
>
>         Don't forget to check the NX Knowledge Base:
>                 http://www.nomachine.com/kb/
>
> ________________________________________________________________
>       FreeNX-kNX mailing list --- FreeNX-kNX at kde.org
>      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/71a5b945/attachment.html>


More information about the FreeNX-kNX mailing list