Apache-AuthenProgram

 view release on metacpan or  search on metacpan

examples/filelogon  view on Meta::CPAN

open(IFH, $passfile)
 || die "FAILURE: can't open password file '$passfile' because: $!\n";
$password = <IFH>;
chomp($password);
close(IFH)
 || die "FAILURE: can't close password file '$passfile' because: $!\n";
if (!defined($password) || $password =~ m/^\s*$/) {
    die "FAILURE: missing or empty password\n";
}

# ------ verify username/password
if ($username eq "fred" && $password eq "Scooby-Do!2002") {
    print "OK: File login succeeded.\n";
} else {
    print "FAILURE: bad username or password.\n";
}

examples/smblogon  view on Meta::CPAN

# ------ define variables
my @output   = ();	# smbclient output lines
my $password = "";	# $username's password
my $server   = "";	# server NetBIOS name
my $share    = "";	# share on $server (cannot be hidden share)
my $smbclient		# Samba smbclient pathname
 = "/www/bin/smbclient";
my $username = "";	# user ID for access


# ------ verify and untaint arguments
$ENV{"PATH"} = "/bin:/usr/bin";
if (scalar(@ARGV) < 4) {
    die "usage: smblogon username password server share\n";
}
$ARGV[0] =~ m#([^`']+)#;
$username = $1;
$ARGV[1] =~ m#([^`']+)#;
$password = $1;
$ARGV[2] =~ m#(([a-zA-Z0-9]|-|\+|_|\.)+)#;
$server   = $1;



( run in 0.733 second using v1.01-cache-2.11-cpan-5467b0d2c73 )