mirror of
https://github.com/processone/ejabberd
synced 2025-10-03 09:49:18 +02:00
* examples/extauth/check_pass_null.pl: A reference "null"
implementation of external authentification script (thanks to Leif Johansson) * src/extauth.erl: Support for external authentification (thanks to Leif Johansson) * src/ejabberd_auth.erl: Likewise * src/mod_vcard_ldap.erl: A drop-in replacement for mod_vcard.erl which uses ldap for JUD and vCard (thanks to Leif Johansson) SVN Revision: 251
This commit is contained in:
parent
76f00658f2
commit
6cd02b9714
5 changed files with 764 additions and 5 deletions
50
examples/extauth/check_pass_null.pl
Normal file
50
examples/extauth/check_pass_null.pl
Normal file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/local/bin/perl
|
||||
|
||||
use Unix::Syslog qw(:macros :subs);
|
||||
|
||||
my $domain = $ARGV[0] || "example.com";
|
||||
|
||||
while(1)
|
||||
{
|
||||
# my $rin = '',$rout;
|
||||
# vec($rin,fileno(STDIN),1) = 1;
|
||||
# $ein = $rin;
|
||||
# my $nfound = select($rout=$rin,undef,undef,undef);
|
||||
|
||||
my $buf = "";
|
||||
syslog LOG_INFO,"waiting for packet";
|
||||
my $nread = sysread STDIN,$buf,2;
|
||||
do { syslog LOG_INFO,"port closed"; exit; } unless $nread == 2;
|
||||
my $len = unpack "n",$buf;
|
||||
my $nread = sysread STDIN,$buf,$len;
|
||||
|
||||
my ($op,$user,$password) = split /:/,$buf;
|
||||
#$user =~ s/\./\//og;
|
||||
my $jid = "$user\@$domain";
|
||||
my $result;
|
||||
|
||||
syslog(LOG_INFO,"request (%s)", $op);
|
||||
|
||||
SWITCH:
|
||||
{
|
||||
$op eq 'auth' and do
|
||||
{
|
||||
$result = 1;
|
||||
},last SWITCH;
|
||||
|
||||
$op eq 'setpass' and do
|
||||
{
|
||||
$result = 1;
|
||||
},last SWITCH;
|
||||
|
||||
$op eq 'isuser' and do
|
||||
{
|
||||
# password is null. Return 1 if the user $user\@$domain exitst.
|
||||
$result = 1;
|
||||
},last SWITCH;
|
||||
};
|
||||
my $out = pack "nn",2,$result ? 1 : 0;
|
||||
syswrite STDOUT,$out;
|
||||
}
|
||||
|
||||
closelog;
|
Loading…
Add table
Add a link
Reference in a new issue