[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SCO/bugfix patch 4 of 10: rpath variable

From: Kean Johnston
Subject: SCO/bugfix patch 4 of 10: rpath variable
Date: Sun, 30 Oct 2005 17:04:42 -0800
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Patch 4 of 10 attached ...

On SCO platforms it is very important to be able to create shared
libaries with absolute SONAME entries, and to have executables that
use those hard-coded names and not rely on DT_RUNPATH. The problem is
that only relatively recent versions of the OS had protection in the
RTLD against using LD_LIBRARY_PATH with elevated priveliges. Being
able to divert a library in a program with elevated priveliges is a
huge security risk. So the SCO patch (see next mail) provides the
facility to set absolute path names in shared libraries if the
environment variable `SCOABSPATH' is non-empty. In order for this to
work, libtool needs to know what the installation path of the shared
library is going to be. This is the value of -rpath. The problem with
the current mechanism is that -rpath accumulates args, and adds spaces.
I don't know if specifying multiple -rpath's has meaning to any platform,
so to be on the safe side, rather than making rpath be a non-accumulating
variable, I introduce a new variable called 'instrpath' that is set to
whatever the last -rpath argument was.

This is generically useful in case other platforms want to pick up the
ability to create shared libraries with absolute paths. There are other
good reasons why doing that is a good idea, but it is mostly only
applicable on platforms that dont have a suitably smart RTLD to deal with
elevated priveliges. However, even on platforms that are suitably
protected, absolute paths can still be a good idea. I can wax lyrical
about why if required. As it stands, this patch affects no-one except
SCO platforms.

2005-10-24  Kean Johnston  <address@hidden>

        * Set a non-accumulating installation
        rpath variable to facilitate setting absolute paths in shared

RCS file: /cvsroot/libtool/libtool/Attic/,v
retrieving revision 1.334.2.91
diff -u -3 -p -r1.334.2.91
---   18 Oct 2005 07:26:05 -0000      1.334.2.91
+++   30 Oct 2005 21:22:25 -0000
@@ -1314,7 +1314,8 @@ EOF
          if test "$prev" = rpath; then
            case "$rpath " in
            *" $arg "*) ;;
-           *) rpath="$rpath $arg" ;;
+           *) instrpath=$arg
+              rpath="$rpath $arg" ;;
            case "$xrpath " in

reply via email to

[Prev in Thread] Current Thread [Next in Thread]