do not use default when dynamic linker fails to open existing path file
if fopen fails for a reason other than ENOENT, we must assume the intent is that the path file be used. failure may be due to misconfiguration or intentional resource-exhaustion attack (against suid programs), in which case falling back to loading libraries from an unintended path could be dangerous.
This commit is contained in:
parent
067aea7c9b
commit
ff4be700d0
1 changed files with 2 additions and 0 deletions
|
|
@ -614,6 +614,8 @@ static struct dso *load_library(const char *name, struct dso *needed_by)
|
||||||
sys_path = "";
|
sys_path = "";
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
} else if (errno != ENOENT) {
|
||||||
|
sys_path = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib";
|
if (!sys_path) sys_path = "/lib:/usr/local/lib:/usr/lib";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue