ejabberd - Comments for "extauth: ejabberd not exec my script" https://www.ejabberd.im/node/919 en How did you solve that error? https://www.ejabberd.im/node/919#comment-2785 <p>Hi, I have the same error but i don't know how to solve.</p> Wed, 27 Dec 2006 08:53:17 +0000 calavera comment 2785 at https://www.ejabberd.im Sorry, errors was in my https://www.ejabberd.im/node/919#comment-1967 <p>Sorry, errors was in my scripts. Now extauth work.</p> Tue, 04 Jul 2006 12:01:21 +0000 shumkov comment 1967 at https://www.ejabberd.im I'm try my perl script to https://www.ejabberd.im/node/919#comment-1963 <p>I'm try my perl script to auth, but it does not run too. Perhaps i'm not correct connect my script in ejabberd.cfg? I'm use this string:</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>{auth_method, external}.<br /> {extauth_program, "/usr/local/etc/ejabberd/auth/auth.pl"}. </p></div> <p>My perl script:</p> <div class="quote-msg"> <div class="quote-author">Quote:</div> <p>#!/usr/bin/perl -w<br /> use strict;<br /> use DBI();</p> <p>my $g_db = DBI-&gt;connect("DBI:mysql:database=billing;host=192.168.0.137", "billing", "billing") or die "DB connect error\n";</p> <p>while(1)<br /> {<br /> my $buf = "";<br /> my $nread = sysread STDIN, $buf, 2;<br /> last if $nread != 2;<br /> my $len = unpack "n", $buf;<br /> $nread = sysread STDIN, $buf, $len;<br /> last if $nread != $len;</p> <p> my($op, $user, $password) = split /:/, $buf;</p> <p> my $result = 0;</p> <p> if ($op eq 'auth')<br /> {<br /> $result = 1 if $g_db-&gt;selectcol_arrayref("SELECT 1 FROM user WHERE login = ? AND password = ?", undef, $user, $password);<br /> }<br /> elsif ($op eq 'setpass')<br /> {<br /> $result = 0;<br /> }<br /> elsif ($op eq 'isuser')<br /> {<br /> $result = 1 if $g_db-&gt;selectcol_arrayref("SELECT 1 FROM user WHERE login = ?", undef, $user);<br /> }<br /> else<br /> {<br /> $result = 0;<br /> }<br /> syswrite STDOUT, (pack "nn", 2, $result);</p> <p>}</p> <p>$g_db-&gt;disconnect; </p></div> <p>Sorry for my english.</p> Mon, 03 Jul 2006 09:09:26 +0000 shumkov comment 1963 at https://www.ejabberd.im