MOON
Server: Apache/2.2.31 (Unix) mod_ssl/2.2.31 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4
System: Linux csr818.wilogic.com 2.6.18-419.el5xen #1 SMP Fri Feb 24 22:50:37 UTC 2017 x86_64
User: obrechts (544)
PHP: 5.4.45
Disabled: NONE
Upload Files
File: //var/usr/webmin-1.941/file/upload2.cgi
#!/usr/bin/perl
# upload2.cgi
# Rename a file that has already been uploaded

require './file-lib.pl';
$disallowed_buttons{'upload'} && &error($text{'ebutton'});
&header();
&ReadParse();

if ($in{'yes'}) {
	# Put it in place, overwriting any other file
	&webmin_log("upload", undef, $in{'path'});
	&switch_acl_uid($running_as_root ? $in{'user'} : undef);
	if ($access{'ro'} || !&can_access($in{'path'})) {
		print "<p><b>",&text('upload_eperm', $in{'path'}),"</b><p>\n";
		}
	elsif (!&open_tempfile(FILE, ">".&unmake_chroot($in{'path'}), 1)) {
		print "<p><b>",&text('upload_ewrite', $in{'path'}, $!),"</b><p>\n";
		}
	else {
		open(TEMP, $in{'temp'});
		&copydata(TEMP, FILE) ||
			&error(&text('upload_ewrite', $in{'path'}, $!));
		close(TEMP);
		&close_tempfile(FILE);
		&post_upload($in{'path'}, $in{'dir'}, $in{'zip'});
		}
	unlink($in{'temp'});
	}
else {
	# Just delete the temp file
	&switch_acl_uid();
	unlink($in{'temp'});
	print "<script>\n";
	print "close();\n";
	print "</script>\n";
	}