Or try this:

#!/bin/bash
if [ "$1" == "" -o "$1" == "fromremote" ] ; then
# same machine
        su -c "cd ; xauth add `xauth list $DISPLAY`; xterm -ls -vb -sb -sl
2000 -T Root@`hostname -f` -n Root@`hostname -f` -j -rw +vb -bg \#ff8c6d
-fn 10x20 &"
# sleep to give the xterm time to open
        [ "$1" == "fromremote" ] && sleep 1
else
        cmd="\"export DISPLAY=$DISPLAY;xauth add `xauth list
$DISPLAY`;xterm -geometry 20x1 +sb -e xsu fromremote\""
        rsh $1 "bash -c $cmd"
fi

Works very nice over rlogin, too. It add's the users xauth entry to roots
XAuthority instead of letting root manipulate the users .XAuthority

Have Fun,
Schlomo

PS: I couldn't resist sending it because it's the product of a quite long
improvement curve and I still have some open issues: Like skipping the
cmd= stuff for the rsh. Without it it always would loose the quotes ...


 On Fri, 4 Jan
2002, Tzafrir Cohen
wrote:

> On Fri, 4 Jan 2002, Shlomi Fish wrote:
>
> >
> > I am using Mandrake Linux 8.1 and recently got a problem when using su
> > under xterms.
> >
> > The problem is that when su exits I get a "Bus Error"
> > signal. The reason is that the pam_xauth PAM module tries to create a very
> > large file at $HOME/.xauth/refcount/root/localhost.localdomain/unix\:0. (I
> > traced this problem into a bug in pam_xauth and reported it to the PAM
> > mailing list)
> >
> > Now, when I try to su again, I get a "File size limit exceeded" notice
> > after I type the password.
> >
> > I can overcome this method by deleting my $HOME/.Xauthority file. However,
> > when I run startx, it is created once more, so I have to delete it time
> > and again. I don't know what I did to trigger this problem because since I
> > installed Linux Mandrake 7.1 (and upgraded it to the more recent versions)
> > su ran fine.
>
> WorksForMe .
>
> Just a note about your current workaround:
>
> deleting .Xauthority prevents you from authenticating to the X server. In
> that case pam_xauth does nothing.
>
> If pam_xauth is indeed buggy and there is no easy way around it, disable
> pam_xauth . At least you will be able to use X Authority for your user's
> clients.
>
> Instead of using xauth you can manually forward X authority. Or, you can
> use:
>
>   alias xsu=='su -c "env DISPLAY=$DISPLAY XAUTHORITY=$XAUTHORITY $SHELL" -'
>
> Or:
>
>   alias xsu=='su -c "env DISPLAY=$DISPLAY XAUTHORITY=$HOME/.Xauthority $SHELL" -'
>
> This is supposed to run a root shell that uses the same DISPLAY and
> XAUTHORITY file as the original shell.
>
>

-- 
Schlomo Schapiro
Senior System Administrator
MobilEye Vision Technologies Ltd.

24 Mishol Hadkalim St.,97278 Jerusalem, Israel
Telephone:  + 972-2-586-6989 Ext. 131
Mobile:     + 972-55-767898
Fax:        + 972-2-586-7720

email: [EMAIL PROTECTED]
WWW:   http://www.mobileye.com


=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to