diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-11-08 22:41:16 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-11-08 22:41:16 -0500 |
commit | 40d5f7eb8323bcc36344424023b82603fa04cb93 (patch) | |
tree | ed9f82ff32df4cb7bdba3f7a3bd28672a296f376 | |
parent | 3d9e3a309f794faf0df53c00b15d406f14931938 (diff) | |
download | musl-40d5f7eb8323bcc36344424023b82603fa04cb93.tar.gz musl-40d5f7eb8323bcc36344424023b82603fa04cb93.tar.bz2 musl-40d5f7eb8323bcc36344424023b82603fa04cb93.tar.xz musl-40d5f7eb8323bcc36344424023b82603fa04cb93.zip |
change ldso path file logic to replace rather than add to search path
this change was originally intended just to avoid repeated attempts to
open a nonexistant /etc/ls-musl-$(ARCH).path file, but I realized it
also prevents the default paths from being searched when such a path
file exists. despite the potential to break existing usage, I believe
the new behavior is the right behavior, and it's better to fix it
sooner rather than later. with the old behavior, it was impossible to
inhibit search of default paths which might contain musl-incompatible
libs (or even libs from a different cpu arch, on multi-arch machines).
-rw-r--r-- | src/ldso/dynlink.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c index 625f80cc..c295301f 100644 --- a/src/ldso/dynlink.c +++ b/src/ldso/dynlink.c @@ -483,8 +483,8 @@ static struct dso *load_library(const char *name) fclose(f); } } - if (sys_path) fd = path_open(name, sys_path, buf, sizeof buf); - else fd = path_open(name, "/lib:/usr/local/lib:/usr/lib", buf, sizeof buf); + if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib"; + fd = path_open(name, sys_path, buf, sizeof buf); } pathname = buf; } |