diff options
author | Dale Rahn <drahn@cvs.openbsd.org> | 2005-03-22 18:03:40 +0000 |
---|---|---|
committer | Dale Rahn <drahn@cvs.openbsd.org> | 2005-03-22 18:03:40 +0000 |
commit | 519a79b1b18b016954de76855eb814d00ca0140f (patch) | |
tree | fcb87a4dcaa6ff29c958e6ac5404f81abd7e2ac1 /libexec/ld.so | |
parent | b2d35bcfb0d6b0848d64cfcbb7d4f3b03a039ee5 (diff) |
fix PR3944 on i386 (ugh), from library.c
--
Fix some problems related to LD_LIBRARY_PATH parsing where it would not
correctly deal with current directory searches specified by "::", ":foo" or
"foo:"
--
ok mickey@
Diffstat (limited to 'libexec/ld.so')
-rw-r--r-- | libexec/ld.so/library_mquery.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/libexec/ld.so/library_mquery.c b/libexec/ld.so/library_mquery.c index 0ea683dd7ad..46139beda9e 100644 --- a/libexec/ld.so/library_mquery.c +++ b/libexec/ld.so/library_mquery.c @@ -1,4 +1,4 @@ -/* $OpenBSD: library_mquery.c,v 1.14 2004/07/05 00:47:40 kjell Exp $ */ +/* $OpenBSD: library_mquery.c,v 1.15 2005/03/22 18:03:39 drahn Exp $ */ /* * Copyright (c) 2002 Dale Rahn @@ -134,6 +134,12 @@ _dl_find_shlib(struct sod *sodp, const char *searchpath, int nohints) *path++ = *pp++; *path = 0; + /* interpret "" as curdir "." */ + if (lp[0] == '\0') { + lp[0] = '.'; + lp[1] = '\0'; + } + hint = _dl_findhint((char *)sodp->sod_name, sodp->sod_major, sodp->sod_minor, lp); if (hint != NULL) @@ -165,6 +171,12 @@ nohints: *path++ = *pp++; *path = 0; + /* interpret "" as curdir "." */ + if (lp[0] == '\0') { + lp[0] = '.'; + lp[1] = '\0'; + } + if ((dd = _dl_opendir(lp)) != NULL) { match = 0; while ((dp = _dl_readdir(dd)) != NULL) { |