Re: Updated xrexecd.sh

Warren Togami <[email protected]>
Newsgroups gmane.linux.terminal-server.devel
Message-ID <[email protected]>
Warren Togami wrote:
> So we need the following...
> 
> Non-root users need access to the client system's .Xauthority as a local 
> file.  /root/.Xauthority is the current location.  This is a bit messy 
> because the permissions on this directory on Fedora are 0700 by default. 
>   I was never comfortable with this hard coded location to begin with. 
> I might propose we change this in the following way:
> 
>     * XAUTHORITY=/var/run/Xauthority-randomstring
>     * /var/run/Xauthority-randomstring permissions 0600
>       S01-localapps uses setfacl to allow only LDM_USERNAME access.  So 
> other possible logged in non-root users can't screw with it.
>     * Figure out some way to pass this XAUTHORITY into the su launched 
> environment.  We also need a way to set HOME which currently isn't set 
> for some reason.
> 

dberkholz brought up the good point, that instead of fs acl's we might
be able to simply change ownership of the Xauthority file to the user.

I guess I can't think of any drawback to this.  Anyone?

I'll give this a try today.

Attached is a modified versions of Gadi's shell version of xrexecd.sh 
with some temporary hacks prior to moving Xauthority that I will work on 
today.

Warren Togami
[email protected]

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

_____________________________________________________________________
Ltsp-developer mailing list.   To un-subscribe, or change prefs, goto:
      https://lists.sourceforge.net/lists/listinfo/ltsp-developer
For additional LTSP help,   try #ltsp channel on irc.freenode.net
xrexecd.sh (application/x-sh, 1.1 KB)
#!/bin/sh

LOGFILE=/var/log/ldm.log

logit() {
    if [ -n "${LOGFILE}" ]; then
        echo "$1" >> ${LOGFILE}
    else
        echo "$1"
    fi 
}

if [ -n "${LDM_USERNAME}" -a -n "$(/usr/bin/id ${LDM_USERNAME})" ]; then
    true
    #logit "LDM_USERNAME is valid"
else
    logit "Unknown user:  $LDM_USERNAME"
    exit 1
fi

if [ -z "$DISPLAY" ];then 
    logit "Unknown DISPLAY"
    exit 1
fi

# Initialize LTSP_COMMAND as blank
xprop -root -f LTSP_COMMAND 8s -set LTSP_COMMAND ""

# Ugly temporary hacks until we move the Xauthority file into /var/run
chmod 777 /root
chmod 666 /root/.Xauthority
# See what is going on
set -x 

# Poll for LTSP_COMMAND changes and execute
while :; do
    LTSP_COMMAND="$(xprop -root -notype LTSP_COMMAND)"
    [ "$?" != 0 ] && exit 

    LTSP_COMMAND=$(echo "${LTSP_COMMAND}"|sed -e 's/^LTSP_COMMAND = //' -e 's/^"//' -e 's/"$//')
    if [ -n "${LTSP_COMMAND}" ]; then
        logit "Executing the following command as ${LDM_USERNAME}: ${LTSP_COMMAND} "

        su - ${LDM_USERNAME} -c "XAUTHORITY=$XAUTHORITY XMODIFIERS=@im=SCIM ${LTSP_COMMAND}"

        xprop -root -f LTSP_COMMAND 8s -set LTSP_COMMAND ""
    fi
    sleep 2
done
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.