projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1359da6
)
find_root_device: use lstat - don't follow links
author
Denis Vlasenko
<vda.linux@googlemail.com>
Sat, 21 Apr 2007 23:28:03 +0000
(23:28 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Sat, 21 Apr 2007 23:28:03 +0000
(23:28 -0000)
libbb/find_root_device.c
patch
|
blob
|
history
diff --git
a/libbb/find_root_device.c
b/libbb/find_root_device.c
index 7182102c71962feb894511cf126f7761f6211ff5..9779f7e82d190d064782fdd38aba50522ca74e66 100644
(file)
--- a/
libbb/find_root_device.c
+++ b/
libbb/find_root_device.c
@@
-41,7
+41,8
@@
static char *find_block_device_in_dir(struct arena *ap)
while ((entry = readdir(dir)) != NULL) {
safe_strncpy(ap->devpath + len, entry->d_name, rem);
- if (stat(ap->devpath, &ap->st) != 0)
+ /* lstat: do not follow links */
+ if (lstat(ap->devpath, &ap->st) != 0)
continue;
if (S_ISBLK(ap->st.st_mode) && ap->st.st_rdev == ap->dev) {
retpath = xstrdup(ap->devpath);