From: Thierry Parmentelat Date: Mon, 17 Nov 2008 15:21:35 +0000 (+0000) Subject: log truncating for unrecognized IPs only & lowered to 4kB X-Git-Tag: nodeconfig-4.3-2~14 X-Git-Url: http://git.onelab.eu/?p=nodeconfig.git;a=commitdiff_plain;h=a8f0d8c5982060d95b762c0808e467009d2dbe6f log truncating for unrecognized IPs only & lowered to 4kB --- diff --git a/boot/upload-bmlog.php b/boot/upload-bmlog.php index 4584111..ed13534 100755 --- a/boot/upload-bmlog.php +++ b/boot/upload-bmlog.php @@ -1,11 +1,15 @@ GetInterfaces(array("ip"=>$ip)); if (! empty($interfaces) ) { @@ -54,8 +58,8 @@ fprintf ($log, "BootManager log created on: %s-%s\n",$month,$time); fprintf( $log, "From IP: %s\n",$ip); fprintf( $log, "hostname: %s\n",$hostname); fprintf ( $log, "uploaded file: %s (%d bytes)\n",$uploaded_name,$uploaded_size); -if ( $uploaded_size >= $limit_bytes) { - fprintf ( $log, "contents truncated to %d bytes\n",$limit_bytes); +if ( ( strcmp($hostname,$default_hostname)==0) && ( $uploaded_size >= $limit_bytes) ) { + fprintf ( $log, "contents from an unrecognized IP address was truncated to %d bytes\n",$limit_bytes); $truncated=TRUE; $uploaded_size=$limit_bytes; }