Operating System - HP-UX
1833653 Members
3794 Online
110062 Solutions
New Discussion

changing the path for dld.so

 
NIklas Wirstrom
New Member

changing the path for dld.so

Hi,

I want to configure a copy of the chroot binary to run in a compartment.

Chroot uses dynamic libraries, and therefore loads the dld.so. The compartment settings disallows all reading of the /lib directory (where dld.so lives).

I have tried to compile my own chroot with static linking, but it doesn't seem to work.

Another solution would be to specify where to find the dld.so file, but I don't know how.

Does anybody have a solution to this?

/Best regards Niklas
4 REPLIES 4
Peter Godron
Honored Contributor

Re: changing the path for dld.so

ranganath ramachandra
Esteemed Contributor

Re: changing the path for dld.so

cant you make copies of uld.so and dld.so at the appropriate paths in the compartment ? or do you mean /usr/lib is unusable even inside the compartment?

as of now, there is no hpux tool to do this (or to edit embedded paths).

if you are able to relink the executables that you want to use in this way, you can use the linker's "+interp" option followed by a string that specifies the interpreter. for IPF binaries this string specifies the uld and dld paths delimited by a colon (':') character (see the output of "elfdump +interp " for example).

if you are not able to relink the executables, you will have to edit the binary (e.g. using bvi or "vim -b") to replace the string in place with another of the same or lesser length. be sure to terminate a shorter string with null characters (ctrl-V ctrl-@ in bvi/vim).
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

NIklas Wirstrom
New Member

Re: changing the path for dld.so

Thanks!
I linked a home made chroot with the interp option. Works fine.
ranganath ramachandra
Esteemed Contributor

Re: changing the path for dld.so

actually, a much simpler workaround which i didnt thnk of earlier is to build (or ask hp for) a fully archived version of chroot. i'll talk to the owners of chroot about this.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo