This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
PATCH: "ldconfig ." issue
On Tue, Jul 22, 2003 at 01:00:16PM -0700, Roland McGrath wrote:
> > On Tue, Jul 22, 2003 at 12:54:12PM -0700, Roland McGrath wrote:
> > > > "ldconfig ." will add '.' to /etc/ld.so.cache. Shouldn't it convert
> > > > a relative path to the absolute path first?
> > >
> > > I don't know why anyone would give it a relative path.
> > > It would be reasonable just to refuse anything not starting with /.
> >
> > When I play with shared libraries, I may do
> >
> > # ldconfig -n .
> >
> > to create the right symlinks for me.
>
> Ok, then. In that case the issue you raised is moot. So refuse relative
> paths unless -n.
Here is the patch. It ignore relative path if cache will be built.
H.J.
----
2003-07-22 H.J. Lu <hongjiu.lu@intel.com>
* elf/ldconfig.c (main): Ignore relative path if cache will be
built.
--- elf/ldconfig.c.relpath 2003-07-22 08:55:23.000000000 -0700
+++ elf/ldconfig.c 2003-07-22 13:41:39.000000000 -0700
@@ -1009,13 +1009,16 @@ main (int argc, char **argv)
/* Parse and process arguments. */
argp_parse (&argp, argc, argv, 0, &remaining, NULL);
- /* Remaining arguments are additional libraries if opt_manual_link
+ /* Remaining arguments are additional directories if opt_manual_link
is not set. */
if (remaining != argc && !opt_manual_link)
{
int i;
for (i = remaining; i < argc; ++i)
- add_dir (argv[i]);
+ if (opt_build_cache && argv[i][0] == '.')
+ error (0, 0, _("relative path `%s' ignored"), argv[i]);
+ else
+ add_dir (argv[i]);
}
set_hwcap ();