Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F153551601
D12741.id34177.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D12741.id34177.diff
View Options
Index: libexec/rtld-elf/libmap.c
===================================================================
--- libexec/rtld-elf/libmap.c
+++ libexec/rtld-elf/libmap.c
@@ -99,45 +99,35 @@
struct lmc *p;
struct stat st;
int fd;
- char *rpath;
char *lm_map;
- rpath = realpath(path, NULL);
- if (rpath == NULL)
- return;
-
TAILQ_FOREACH(p, &lmc_head, next) {
- if (strcmp(p->path, rpath) == 0) {
- free(rpath);
+ if (strcmp(p->path, path) == 0)
return;
- }
}
- fd = open(rpath, O_RDONLY | O_CLOEXEC);
+ fd = open(path, O_RDONLY | O_CLOEXEC);
if (fd == -1) {
- dbg("lm_parse_file: open(\"%s\") failed, %s", rpath,
+ dbg("lm_parse_file: open(\"%s\") failed, %s", path,
rtld_strerror(errno));
- free(rpath);
return;
}
if (fstat(fd, &st) == -1) {
close(fd);
- dbg("lm_parse_file: fstat(\"%s\") failed, %s", rpath,
+ dbg("lm_parse_file: fstat(\"%s\") failed, %s", path,
rtld_strerror(errno));
- free(rpath);
return;
}
lm_map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (lm_map == (const char *)MAP_FAILED) {
close(fd);
- dbg("lm_parse_file: mmap(\"%s\") failed, %s", rpath,
+ dbg("lm_parse_file: mmap(\"%s\") failed, %s", path,
rtld_strerror(errno));
- free(rpath);
return;
}
close(fd);
p = xmalloc(sizeof(struct lmc));
- p->path = rpath;
+ p->path = xstrdup(path);
TAILQ_INSERT_HEAD(&lmc_head, p, next);
lmc_parse(lm_map, st.st_size);
munmap(lm_map, st.st_size);
@@ -151,26 +141,17 @@
struct lmc *p;
char conffile[MAXPATHLEN];
char *ext;
- char *rpath;
- rpath = realpath(idir, NULL);
- if (rpath == NULL)
- return;
-
TAILQ_FOREACH(p, &lmc_head, next) {
- if (strcmp(p->path, rpath) == 0) {
- free(rpath);
+ if (strcmp(p->path, idir) == 0)
return;
- }
}
d = opendir(idir);
- if (d == NULL) {
- free(rpath);
+ if (d == NULL)
return;
- }
p = xmalloc(sizeof(struct lmc));
- p->path = rpath;
+ p->path = xstrdup(idir);
TAILQ_INSERT_HEAD(&lmc_head, p, next);
while ((dp = readdir(d)) != NULL) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 22, 8:27 PM (17 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31998468
Default Alt Text
D12741.id34177.diff (1 KB)
Attached To
Mode
D12741: Don't call realpath(3) from libmap rtld code.
Attached
Detach File
Event Timeline
Log In to Comment