Xorg 6.8.1: can't switch VT or resolution (partially solved)
Glynn Clements
glynn.clements at virgin.net
Mon Oct 11 04:05:05 PDT 2004
Corey Hickey wrote:
> > I should ask, also, if there are any alternatives to using
> > LD_LIBRARY_PATH for what I want to do. Basically, I just want xorg to
> > not interfere with my current installation of xfree86, and vice versa. I
> > want xorg, and any programs I run within xorg, to look for libraries in
> > /usr/local/X11R6.8/lib first. Xfree86 and programs that run within
> > xfree86 should only look for libs in the usual places.
> Does anybody know what I should do here? I'm fresh out of ideas but
> don't want to abandon either X server yet. I'd appreciate whatever help
> anybody can give.
Essentially, you have to re-set the LD_* variables after running any
setuid program (unless you run it under the UID to which it's setuid;
i.e. running a setuid-root program as root won't clear LD_*).
If you're using xdm, you can re-set LD_LIBRARY_PATH in the Xsession
script. That will handle any non-setuid programs which are part of the
session. If xterm is setuid, LD_* will be cleared for the shell which
it spawns. You can either re-set it in your shell's startup script, or
you may be able to make make xterm non-setuid.
There are two reasons for making xterm setuid root:
1. To allow it to set the ownership of the pty.
2. To allow it to write utmp/wtmp entries.
On systems with Unix98 ptys and /dev/pts, #1 no longer applies, as the
kernel sets the ownership when it creates the pty device. Also, some
systems with BSD-style ptys provide a setuid-root helper program to
set pty ownership (on GNU libc 2.x, it's /usr/libexec/pt_chown).
As for point #2, xterm can use the utempter library (which available
on most Linux systems), which calls a setgid-utmp program (e.g.
/usr/sbin/utempter) to create the utmp/wtmp entries. Even if you don't
have utempter, if you don't care about utmp/wtmp logging, you can just
remove the setuid bit from xterm.
--
Glynn Clements <glynn.clements at virgin.net>
More information about the xorg
mailing list