I finally got around to trying out the Perl ArcV2 library that
I mentioned earlier. It didn’t go well.
There were some issues early on that were due to me not having the sasl libraries installed on my Ubuntu. After rectifying that it made it past the pre-requisites.
However, the Arc tests did not work.
Running make test PERL_DL_NONLAZY=1 /u/jared/packages/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t t/arc1.t .. 1/17 shutdown() on closed socket GEN0 at /u/packages/lib/perl5/5.10.1/i686-linux-thread-multi/IO/Socket.pm line 295. t/arc1.t .. 2/17 # Failed test at t/arc1.t line 61. # Failed test at t/arc1.t line 63. Test Summary Report ------------------- t/arc1.t (Wstat: 3328 Tests: 17 Failed: 13) Failed tests: 3-15 Non-zero exit status: 13
I glanced at the tests to see what had managed to succeed. It doesn’t look good. Pretty much only ok(1) commands with no predicate passed.
Having said that, the test script looks interesting. It forks a process to fire up the server before running the tests. I’m reminded again how much I miss stuff like fork() when doing Windows development.
use Test::More tests => 17; use strict; # To work as a client/server we have to fork my $pid = fork(); my $user = "mannfred"; my $pass = "klaus"; if ($pid == 0) { # Child use Arc::Server; use Arc::Connection::Server; my $server = new Arc::Server(...); $server->Start(); exit 0; } elsif ($pid) { # Parent use Arc::Connection::Client; ok(1); #1 sleep(3); # Wait for the server to get ready my $client = new Arc::Connection::Client(...) or ok(0); ok(1); #2 my $s; if ($client->StartSession()) { ok(1); } else { ok(0); } # ... }
I then split out the client and server so I could run them individually.
$ perl -Mblib=../blib test-client.pl [err]: (client) Evaluation of command _RAUTHTYPE failed (Can't locate auto/Authen/SASL/Cyrus/need_step.al in @INC (@INC contains: ../blib/arch ../blib/lib /u/packages/lib/perl5/5.10.1/i686-linux-thread-multi /u/packages/lib/perl5/5.10.1 /u/packages/lib/perl5/site_perl/5.10.1/i686-linux-thread-multi /u/packages/lib/perl5/site_perl/5.10.1 .) at ../blib/lib/Arc/Connection/Client.pm line 157).
The server output looked like this.
$ perl -Mblib=../blib test-server.pl [info]: (server) Arc v2.1 Session recognized. [err]: (server) Connection closed by foreign host.
Okay, so it looks like the code has bit-rotted away (the last release was in 2005). This is the line in Arc::Connection::Client that is failing. need_step() is no longer mentioned in the SASL documentation.
if ($sasl->need_step || $sasl->code == 0) {
The question is, how much I would have to change to get this to work. Or to put another way, is what I have already with my AnyEvent based code closer to what I need than the currently broken Arc.
And if it doesn’t even work on Linux, what chance do I have on Windows.
I’d advise against patching someone else’s bit-rotted authentication code even more than I would writing your own from scratch.
I think you have to consider that avenue a dead-end.
If I were you I’d leave perl for a while, check for other windows programs that perform the kind of authentication that you need.
Find out how they do it, find the name of whatever they call the library they use to perform that, then check to see if there’s a perl binding.
Looking for a perl sockets authentication method that supports windows is going to get you checking a lot of things that don’t support windows.
On the other hand, looking for a windows sockets authentication method that has a perl wrapper, that could trim out a lot of the noise.
May not help of course.
> I’d advise against patching someone else’s bit-rotted authentication
> code even more than I would writing your own from scratch.
>
> I think you have to consider that avenue a dead-end.
Yes, after some futher investigation, I’ve reached the same conclusion which I think is a real shame. The pdf I linked to in my original post that mentioned arc indicated that the guy had put some real thought into the design of the system. I am unlikely to have the time to do the same for mine.
> If I were you I’d leave perl for a while, check for other windows
> programs that perform the kind of authentication that you need.
>
> Find out how they do it, find the name of whatever they call the
> library they use to perform that, then check to see if there’s a perl
> binding.
I like the way you’re thinking here, and if I only had to support Windows, that is what I would do. Unfortunately, I need to support Linux too, and infact, Windows is going to be the second class citizen
> Looking for a perl sockets authentication method that supports windows
> is going to get you checking a lot of things that don’t support
> windows.
*nods* good advice again I think, but I suspect I am going to have to trawl through the Authen:: libraries.
Cheers