e2fsprogs/e2fsprogs-1.39-logdump-symlinks.patch
Eric Sandeen 66fd3626d0 * Fri Jun 22 2007 Eric Sandeen <esandeen@redhat.com> 1.39-14
- Many coverity-found potential leaks, segfaults, etc (#239354)
- Fix debugfs segfaults when no fs open (#208416, #209330)
- Avoid recursive loops in logdump due to symlinks in /dev (#210371)
- Don't write changes to the backup superblocks by default (#229561)
- Correct byteswapping for fast symlinks with xattrs (#232663)
- e2fsck: added sanity check for xattr validation (#230193)
2007-06-22 17:04:55 +00:00

50 lines
1.6 KiB
Diff

# HG changeset patch
# User tytso@mit.edu
# Date 1159151618 14400
# Node ID 6ded68c87fd5e19be3a43ced60477d96b87cbae0
# Parent d39ab0d5fde2da82c7de72a536c9bd635d372836
blkid_devno_to_devname(): Avoid recursive loops due to symlinks in /dev
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Index: e2fsprogs-1.39-RHEL5/lib/blkid/ChangeLog
===================================================================
--- e2fsprogs-1.39-RHEL5.orig/lib/blkid/ChangeLog
+++ e2fsprogs-1.39-RHEL5/lib/blkid/ChangeLog
@@ -2,6 +2,11 @@
* read.c (parse_dev): Fix memory leak on error path.
+2006-09-24 Theodore Tso <tytso@mit.edu>
+
+ * devno.c (scan_dir): Don't follow symlinks when recursively
+ searching directories under /dev.
+
2006-09-17 Karel Zak <kzak@redhat.com>
* probe.c (probe_fat): Fix problem with empty FAT label.
Index: e2fsprogs-1.39-RHEL5/lib/blkid/devno.c
===================================================================
--- e2fsprogs-1.39-RHEL5.orig/lib/blkid/devno.c
+++ e2fsprogs-1.39-RHEL5/lib/blkid/devno.c
@@ -120,15 +120,16 @@ static void scan_dir(char *dirname, dev_
if (stat(path, &st) < 0)
continue;
- if (S_ISDIR(st.st_mode))
- add_to_dirlist(path, list);
- else if (S_ISBLK(st.st_mode) && st.st_rdev == devno) {
+ if (S_ISBLK(st.st_mode) && st.st_rdev == devno) {
*devname = blkid_strdup(path);
DBG(DEBUG_DEVNO,
printf("found 0x%llx at %s (%p)\n", devno,
path, *devname));
break;
}
+ if (S_ISDIR(st.st_mode) && !lstat(path, &st) &&
+ S_ISDIR(st.st_mode))
+ add_to_dirlist(path, list);
}
closedir(dir);
return;