mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
Don't recurse symlinked dirs such as /dev/fd on 2.6.
This commit is contained in:
parent
68c07aeeb3
commit
08c419da66
@ -313,6 +313,17 @@ static int _insert(const char *path, int rec)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (S_ISDIR(info.st_mode)) { /* add a directory */
|
if (S_ISDIR(info.st_mode)) { /* add a directory */
|
||||||
|
/* check it's not a symbolic link */
|
||||||
|
if (lstat(path, &info) < 0) {
|
||||||
|
log_sys_very_verbose("lstat", path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (S_ISLNK(info.st_mode)) {
|
||||||
|
log_debug("%s: Symbolic link to directory", path);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (rec)
|
if (rec)
|
||||||
r = _insert_dir(path);
|
r = _insert_dir(path);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user