aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-01 17:40:37 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-09-01 17:43:50 +0100
commit4197530f623ce9c9653b724baeda36efb08c3e63 (patch)
treeffb0f6a00044293e592565f877b2142ca867d63b
parent27b2bc28ebfc13bec3a03a8373e8625158a7bd9d (diff)
downloadpaludis-4197530f623ce9c9653b724baeda36efb08c3e63.tar.gz
paludis-4197530f623ce9c9653b724baeda36efb08c3e63.tar.xz
dodgy fs check
-rw-r--r--paludis/merger.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 0932b74..4e57d55 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -1154,6 +1154,13 @@ Merger::try_to_copy_xattrs(const FSEntry & src, int dst_fd, MergeStatusFlags & f
"Got error '" << ::strerror(errno) << "' when trying to find extended attributes size for '" << src << "'";
return;
}
+ else if (list_sz > (2 << 29))
+ {
+ Log::get_instance()->message("merger.xattrs.your_fs_sucks", ll_warning, lc_context) <<
+ "flistxattr returned " << list_sz << ", which clearly isn't right. Are you using some crazy "
+ "ricer filesystem or kernel?";
+ return;
+ }
std::tr1::shared_ptr<char> list_holder(static_cast<char *>(::operator new(list_sz)));
list_sz = flistxattr(src_fd, list_holder.get(), list_sz);