Handle hostnames with upper-case letters
[webmin.git] / file / extract.cgi
1 #!/usr/local/bin/perl
2 # Extract 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 &webmin_log("extract", undef, $in{'file'});
17 $realfile = &unmake_chroot($in{'file'});
18 &switch_acl_uid();
19 $err = &extract_archive($realfile, $in{'delete'});
20 print $err,"\n";
21