Xorg 6.8.1: can't switch VT or resolution (partially solved)

Corey Hickey bugfood-ml at fatooh.org
Fri Oct 1 21:20:17 PDT 2004


Kristian Høgsberg wrote:

>>and it seemed that libxkbfile.so.1 wasn't found until I `export
>>LD_LIBRARY_PATH=/usr/local/X11R6cvs/lib/` after which ldd showed all the
>>libraries. The strange thing is, I have LD_LIBRARY_PATH set in the
>>console from which I start xorg. I tried unsetting LD_LIBRARY_PATH, and
>>it did make a difference: xorg wouldn't load, with the console output
>>saved and attached as nold.log.
> 
> 
> The X server strips out all LD* variables from the environment for 
> security.  See xc/programs/Xserver/os/utils.c:1847.
> 

Once again, thank you for your help. Modifying utils.c to not strip LD*
would suit my purposes for now, but I'm having trouble doing so. The
part of utils.c around 1847 originally reads:

/* Consider LD* variables insecure? */
#ifndef REMOVE_ENV_LD
#define REMOVE_ENV_LD 1
#endif

I changed that to read:

/* Consider LD* variables insecure? */
#ifndef REMOVE_ENV_LD
#define REMOVE_ENV_LD 0
#endif

...and I thought that would do it; however, the behavior is the same as
before. I even tried removing all code from line 1952 through line 2009,
but it's still the same. Every time I recompile I completely remove
/usr/local/X11R6.8, so unless there's something outside the project root
(I have "#define NothingOutsideProjectRoot YES" in host.def) everything
is installed cleanly.

If I understand the comment on line 1840, LD* is not stripped when
running as root. I did some further testing and that correlates with
what I am seeing:

REMOVE_ENV_LD 1, running as normal user ---> no good
REMOVE_ENV_LD 1, running as root        ---> works ok
REMOVE_ENV_LD 0, running as normal user ---> no good
REMOVE_ENV_LD 0, running as root        ---> works ok

Each of the cases above has LD_LIBRARY_PATH set to
/usr/local/X11R6.8/lib, and nothing for xorg in /etc/ld.so.conf. As
usual, unsetting LD_LIBRARY_PATH always prevents xorg from loading
unless there is a line in /etc/ld.so.conf, which always makes the
library business work.


There's one other thing I didn't mention before because I thought it was
unrelated. After installing xorg before, I had run:
# chmod 755 /usr/local/X11R6.8/bin/xterm
because it wouldn't load and I thought it was just a permissions issue
I'd investigate later. As it turns out, xterm has the same library
loading trouble as xkbcomp, but these problems go away when I change the
file mode to 755. Since xkbcomp is already 755, I haven't messed with
the permissions. Originally, xterm and xkbcomp get installed like this:

-rws--x--x  1 root staff 306908 Oct  1 20:34 bin/xterm
-rwxr-xr-x  1 root staff 213374 Oct  1 20:34 lib/X11/xkb/xkbcomp

Now that I'm leaving the permissions of xterm alone, the LD* stripping
results in xterm failing to load as well. I don't know how the file
permissions fit in, but it seems that as long as I can preserve
LD_LIBRARY_PATH I won't have any trouble with xterm either.


Thank you,
Corey



More information about the xorg mailing list