This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: ldconfig.c considers entries before/lib,/usr/lib

Ben Collins <> writes:

> On Wed, Aug 29, 2001 at 08:34:34PM -0700, Ulrich Drepper wrote:
> > Dirk Eddelbuettel <> writes:
>> > ldconfig -v [from Debian's libc6_2.2.4-1 package] reads /lib and /usr/lib
>> > before it considers the directories in /etc/  This is in conflict
>> > with as well as ldconfig(8).
>> It's completely irrelevant what the man pages say.  If they are not in
>> line with the implementation it's the implementation setting the
>> standard.
>> The current way ldconfig works is how it worked ever since.  There is
>> no reason to change it since this will have negative effects and might
>> suddenly change the behavior of people's systems.
> Not entirely true. From the original ldconfig.c in the sources:

Please note that the ldconfig implementation in glibc is a clean
implementation.  Due to copyright concerns we couldn't take the so
called "original" ldconfig and I couldn't look up how exactly ldconfig
worked in some details.

>         /* look ma, no defaults */
>         if (!nodefault)
>         {
>             /* I guess the defaults aren't good enough */
>             if ((extpath = get_extpath()))
>             {
>                 for (cp = strtok(extpath, DIR_SEP); cp;
>                      cp = strtok(NULL, DIR_SEP))
>                     scan_dir(cp);
>                 free(extpath);
>             }
>             /* everybody needs these, don't they? */
>             scan_dir("/usr/lib");
>             scan_dir("/lib");
>         }
> get_extpath() retrieves the paths from the config file. So glibc 2.2.x
> is not following the old "standard", which has worked for ages.

IMO there's also a usability aspect to this:

If you do not use ldconfig, glibc searches per default only /lib and
/usr/lib.  Those are the normal paths.

For setuid applications, the pathes /lib and /usr/lib are also special
since glibc will not lookup any libs in the cache.  Putting /lib and
/usr/lib first will give the same libraries independ whether you're
running setuid or not.

Why can't you put the libs into /usr/lib ?  What kind of problem do
you have that you need to install the libs twice in the system and
additionally need to edit /etc/ and then run ldconfig?

 Andreas Jaeger
  SuSE Labs

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]