HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/share/webmin/squid/squid-auth.pl
#!/usr/bin/perl
# squid-auth.pl
# A basic squid authentication program

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';

my %auth;
open(my $fh, "<".$ARGV[0]);
while(<$fh>) {
	s/\r|\n//g;
	s/#.*$//;
	if (/^(\S+):(\S+)/) {
		$auth{$1} = $2;
		}
	}
close($fh);

$| = 1;
while(<STDIN>) {
	s/\r|\n//g;
	my ($u, $p) = split(/\s+/, $_);
	print $auth{$u} &&
	      $auth{$u} eq crypt($p, $auth{$u}) ? "OK\n" : "ERR\n";
	}