Bugzilla bug #66325: use the DYNAMIC_PATH flag for shl_load() only if the NSPRPUB_RELEASE_4_1_BRANCH
authorwtc%netscape.com
Tue, 23 Jan 2001 20:47:16 +0000
branchNSPRPUB_RELEASE_4_1_BRANCH
changeset 1692 6b448df85f32ff0215aa8dbd79aa0a8742934ae5
parent 1666 a7c48b1f413edd292a4098a46d20ecf192ddf5b4
child 1704 40a215a23ca8cd282dc974efff2a985fe4bfea3d
push idunknown
push userunknown
push dateunknown
bugs66325
Bugzilla bug #66325: use the DYNAMIC_PATH flag for shl_load() only if the specified path name is a plain file name (containing no directory), to match the behavior of dlopen(). (NSPRPUB_RELEASE_4_1_BRANCH)
pr/src/linking/prlink.c
--- a/pr/src/linking/prlink.c
+++ b/pr/src/linking/prlink.c
@@ -750,19 +750,27 @@ pr_LoadLibraryByPathname(const char *nam
     if (flags & PR_LD_GLOBAL) {
         dl_flags |= RTLD_GLOBAL;
     }
     if (flags & PR_LD_LOCAL) {
         dl_flags |= RTLD_LOCAL;
     }
     h = dlopen(name, dl_flags);
 #elif defined(USE_HPSHL)
-    int shl_flags = DYNAMIC_PATH;
+    int shl_flags = 0;
     shl_t h;
 
+    /*
+     * Use the DYNAMIC_PATH flag only if 'name' is a plain file
+     * name (containing no directory) to match the behavior of
+     * dlopen().
+     */
+    if (strchr(name, PR_DIRECTORY_SEPARATOR) == NULL) {
+        shl_flags |= DYNAMIC_PATH;
+    }
     if (flags & PR_LD_LAZY) {
         shl_flags |= BIND_DEFERRED;
     }
     if (flags & PR_LD_NOW) {
         shl_flags |= BIND_IMMEDIATE;
     }
     /* No equivalent of PR_LD_GLOBAL and PR_LD_LOCAL. */
     h = shl_load(name, shl_flags, 0L);