Handle hostnames with upper-case letters
[webmin.git] / file / contents.cgi
1 #!/usr/local/bin/perl
2 # Show the contents of a zip, tar, tar.gz or tar.bz file on the server
3
4 require './file-lib.pl';
5 &ReadParse();
6 print "Content-type: text/plain\n\n";
7
8 # Check permissions
9 $disallowed_buttons{'upload'} && &error($text{'ebutton'});
10 if (!&can_access($in{'file'})) {
11         print &text('extract_eperm', $in{'file'}),"\n";
12         exit(0);
13         }
14
15 # Go for it
16 $realfile = &unmake_chroot($in{'file'});
17 &switch_acl_uid();
18 ($err, @lines) = &extract_archive($realfile, 0, 1);
19 print $err,"\n";
20 foreach my $l (@lines) {
21         print $l,"\n";
22         }
23