aboutsummaryrefslogtreecommitdiff
path: root/sysutils/e2fsprogs
diff options
context:
space:
mode:
authorMatthias Andree <mandree@FreeBSD.org>2010-03-14 10:46:48 +0000
committerMatthias Andree <mandree@FreeBSD.org>2010-03-14 10:46:48 +0000
commit03b879ce634302acfd31fd8a2c9466976c737313 (patch)
treea692a3235e34167dd3d8a52d9f5a3158c7050ab8 /sysutils/e2fsprogs
parentecfbdfca87da7fc3d4bce89465ecf71b1bc5a3a8 (diff)
downloadports-03b879ce634302acfd31fd8a2c9466976c737313.tar.gz
ports-03b879ce634302acfd31fd8a2c9466976c737313.zip
Notes
Diffstat (limited to 'sysutils/e2fsprogs')
-rw-r--r--sysutils/e2fsprogs/files/patch-53fbfb236
1 files changed, 36 insertions, 0 deletions
diff --git a/sysutils/e2fsprogs/files/patch-53fbfb2 b/sysutils/e2fsprogs/files/patch-53fbfb2
new file mode 100644
index 000000000000..3094e067b4e7
--- /dev/null
+++ b/sysutils/e2fsprogs/files/patch-53fbfb2
@@ -0,0 +1,36 @@
+commit 53fbfb2bc3490d0ff317666322dd077c08116e0c
+Author: Theodore Ts'o <tytso@mit.edu>
+Date: Mon Feb 22 23:51:26 2010 -0500
+
+ e2fsck: Fix bug which can cause e2fsck -fD to corrupt non-indexed directories
+
+ E2fsprogs 1.41.10 introduced a regression (in commit b71e018) where
+ e2fsck -fD can corrupt non-indexed directories when are exists one or
+ more file names which alphabetically sort before ".". This can happen
+ with ext2 filesystems or for small directories (take less than a
+ block) which contain filenames that begin with a space or some other
+ punctuation mark.
+
+ Fix this by making sure we never reorder the '.' or '..' entry in the
+ directory, since they must be first.
+
+ Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
+
+diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c
+index 780742e..ceb8543 100644
+--- a/e2fsck/rehash.c
++++ b/e2fsck/rehash.c
+@@ -763,7 +763,12 @@ retry_nohash:
+
+ /* Sort the list */
+ resort:
+- qsort(fd.harray, fd.num_array, sizeof(struct hash_entry), hash_cmp);
++ if (fd.compress)
++ qsort(fd.harray+2, fd.num_array-2, sizeof(struct hash_entry),
++ hash_cmp);
++ else
++ qsort(fd.harray, fd.num_array, sizeof(struct hash_entry),
++ hash_cmp);
+
+ /*
+ * Look for duplicates