From 8fb28ab914a9a9db46f8994f481806e086b1246d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fabian=20Gr=C3=BCnbichler?= Date: Fri, 14 Aug 2020 09:48:33 +0200 Subject: [PATCH] safe_read_from: bump default size limit to 512k MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit this is (via file_get_contents and file_copy) used for reading from pmxcfs, which has a file size limit of 512k. since quite a number of call sites would need to explicitly override this (and then get updated if we bump the limit on the pmxcfs side again in the future), making our default file reader compatible by default seems the better solution. Signed-off-by: Fabian Grünbichler --- src/PVE/Tools.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm index 4399b2f..5d53127 100644 --- a/src/PVE/Tools.pm +++ b/src/PVE/Tools.pm @@ -288,7 +288,8 @@ sub file_read_firstline { sub safe_read_from { my ($fh, $max, $oneline, $filename) = @_; - $max = 32768 if !$max; + # pmxcfs file size limit + $max = 512*1024 if !$max; my $subject = defined($filename) ? "file '$filename'" : 'input'; -- 2.39.2