- while ( 1 ) {
- $_ = $fh->readLine();
- last if ( $_ eq "" );
- # remove any passwords and user names
- s/(SmbSharePasswd.*=.*['"]).*(['"])/$1$2/ig;
- s/(SmbShareUserName.*=.*['"]).*(['"])/$1$2/ig;
- s/(RsyncdPasswd.*=.*['"]).*(['"])/$1$2/ig;
- s/(ServerMesgSecret.*=.*['"]).*(['"])/$1$2/ig;
- $content .= ${EscHTML($_)};
- }
+ #
+ # Because the content might be large, we use
+ # a sub to return the data in 64K chunks.
+ #
+ $contentSub = sub {
+ my($c, $s);
+ while ( length($c) < 65536 ) {
+ $s = $fh->readLine();
+ last if ( $s eq "" );
+ $s =~ s/[\n\r]+//g;
+ # remove any passwords and user names
+ $s =~ s/(SmbSharePasswd.*=.*['"]).*(['"])/$1****$2/ig;
+ $s =~ s/(SmbShareUserName.*=.*['"]).*(['"])/$1****$2/ig;
+ $s =~ s/(RsyncdPasswd.*=.*['"]).*(['"])/$1****$2/ig;
+ $s =~ s/(ServerMesgSecret.*=.*['"]).*(['"])/$1****$2/ig;
+ $s = ${EscHTML($s)};
+ $s =~ s[(\$Conf\{.*?\})][
+ my $c = $1;
+ my $s = lc($c);
+ $s =~ s{(\W)}{sprintf("%%%02x", ord($1) )}gxe;
+ "<a href=\"?action=view&type=docs#item_$s\"><tt>$c</tt></a>"
+ ]eg;
+ $c .= $s . "\n";
+ }
+ return $c;
+ };
+ } elsif ( $type eq "docs" ) {
+ #
+ # Because the content might be large, we use
+ # a sub to return the data in 64K chunks.
+ #
+ $contentSub = sub {
+ my($c, $s);
+ while ( length($c) < 65536 ) {
+ $s = $fh->readLine();
+ last if ( $s eq "" );
+ $c .= $s;
+ }
+ return $c;
+ };
+ #
+ # Documentation has a different header and no pre or post text,
+ # so just handle it here
+ #
+ Header($Lang->{BackupPC__Documentation}, "", 0, $contentSub);
+ Trailer();
+ return;