[PATCH] rtld: properly handle root directory in load path (bug 30435)
Andreas Schwab
schwab@suse.de
Tue May 16 14:37:44 GMT 2023
Don't strip the trailing slash when checking for existence of a load path
element to handle the special case of the root directory.
---
elf/dl-load.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/elf/dl-load.c b/elf/dl-load.c
index 39c63ff1b3..2aa487b49a 100644
--- a/elf/dl-load.c
+++ b/elf/dl-load.c
@@ -1859,7 +1859,7 @@ open_path (const char *name, size_t namelen, int mode,
test whether there is any directory at all. */
struct __stat64_t64 st;
- buf[buflen - namelen - 1] = '\0';
+ buf[buflen - namelen] = '\0';
if (__stat64_time64 (buf, &st) != 0
|| ! S_ISDIR (st.st_mode))
--
2.40.1
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list