AIX 3.2 Shared Libraries with LIBPATH

AIX 3.2 Shared Libraries with LIBPATH

Post by Marc Ausland » Wed, 27 Apr 1994 22:46:26



Interesting problem!

at is an SUID program.  For security reasons, LIBPATH is removed by
exec when an SUID program is invoked - to prevent the caller from
inserting a bogus library!  So "at" never sees the value of LIBPATH you
are running with when you invoke it!

I would advise writing the shell script to set the value.  You could
put it in another environment variable, and have the shell script be,
for example:

#!/bin/ksh
export LIBPATH=$MYLIBPATH
exec $*
--


 
 
 

AIX 3.2 Shared Libraries with LIBPATH

Post by Gary R. Ho » Thu, 28 Apr 1994 00:15:35


|>
|> Is there a way around this other than creating scripts which determine which
|> version I want, set the LIBPATH, then call the real application?  I really
|> want LIBPATH to be treated as any other environment variable in this case.

You might try letting your command line look like

export LIBPATH=/directory2 && your_cmd_goes_here

If you feed this to at, I believe it will set up the environment
as desired.

The problem is that "at" is a setUID program.  As such, LIBPATH is
filtered by it, so you'll have to make the LIBPATH part of the command
to execute.

--
________________________________________________________________________
Gary R. Hook                         | "It's hard to work in groups
AIX Application Enabling             | when you're omnipotent."
IBM Corporation, Southlake, Texas    |  - Q in Star Trek: The Next
The above opinions are all mine.     |    Generation

 
 
 

1. AIX 3.2 Shared Libraries with LIBPATH

I have an application using a shared library, x.  There are two versions of
this library which perform the same functions implemented differently.  I
want to be able to switch between the two versions at run-time *without*
relinking the binary.  Simple enough right? - Just use the LIBPATH environment
variable to specify directory 1 for version 1, directory 2 for version 2.

This all works well except that part of the application gets started in batch
mode using "at".  The problem is that LIBPATH does not appear to get copied
into the environment when I start a job using "at" (LIBPATH is not in the
/var/spool/cron/atjobs/??? file).  

Is there a way around this other than creating scripts which determine which
version I want, set the LIBPATH, then call the real application?  I really
want LIBPATH to be treated as any other environment variable in this case.

Thanks for any ideas.

2. Rage 128 16MB XFree86 Fix

3. LIBPATH bug under AIX 3.2?

4. nVIDIA GeForce4 installation and configuration

5. shared libraries and LIBPATH

6. Booting From Syjet Cartridge

7. Strange Shared libraries behavior and LIBPATH

8. just testing , sorry

9. Trouble with ldconfig and shared libraries after installing XF86 3.2

10. mmap() with shared access fails over NFS using AIX 3.2 on RS 6000

11. Anyone ported shared-X to AIX 3.2 ???

12. X11 R5 Gl library AIX 3.2

13. Shared libs under AIX 3.2