Re: ae history under X

From: Stephen Isard (S.IsardDeleteThis@ed.ac.uk)
Date: Wed Jan 24 2001 - 15:03:00 CET


Michele Andreoli wrote:
>
> On Fri, Jan 19, 2001 at 12:04:57PM +0000, Angel Martín Alganza nicely wrote:
> > Hello,
> >
> > History is working fine on console mode but not on an xterm (ae) under X.
> > How can I confugere it so that I can use the shell history also under X?
> >
>
> I never succeded in that. But if you type "ile" under the Xterm, you will
> have the history.

I have a way both of running X as a non-root user and of getting history
and
line editing in the xterm without having to explicitly type the'ile'
command. It is a crude, brute force method, but perhaps someone will be
inspired to improve on it. The fundamental problem is in getting the
pseudo-terminal in the xterm allocated to the user. I have a less than
complete understanding of how this happens. I thought the job was done
by the xterm program, i.e., aterm or rxvt, and that therefore making
aterm and rxvt be suid root would allow the pty to be allocated, but it
doesn't seem to make any difference.

Anyway, you need to do three things:

1. Replace /usr/X11R6/bin/xterm by the following slightly edited version

---------------------------
#!/bin/sh
# xterm wrapper
# (C) M. Andreoli for muLinux
# edited by Stephen Isard to give a history mechanism in the xterm
window
# and permit starting when logged in as non-root user (but there must be
a
# better way)

#Give things like this as arguments to this program. They will get
passed on
#to the real xterm program, aterm or rxvt, via "$@" in the "command"
line
#below.
#"-bg black"
#"-fg white"
#"-geometry 80x21+20+68"
#" -fn fixed"

ile="/usr/bin/ile -/etc/ilerc"

if [ "`which aterm`" ] ; then
    xterm="aterm"
else
    xterm=rxvt
fi

command="exec $xterm "$@" -e su - $USER -c \"$ile\""

#Next line depends on there being no root password. The reason I've done
it
#this way is that I can't figure out how else to get a pty allocated to
an
#ordinary user. Please fix if you know how.
su - -c "$command"
----------------------

2. In /usr/X11R6/bin/startx, replace occurrences of "MuLinux Console" by
\"Mulinux Console\", i.e., put backslashes before the quotes.

3. Make the loadkeys program be suid root, i.e., as root do
chmod +s `which loadkeys`

There are still error messages involving /setup/cnf/store and
/tmp/modules/preferred, but I don't think they matter. They seem to
come from attempts in setup to create directories that already exist in
this context.

Best wishes,

Stephen Isard

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:17 CET