Re: ncsa_auth module DONE

From: Henrik Nordstrom <hno@dont-contact.us>
Date: Tue, 11 Apr 2000 22:37:46 +0200

Cliff Green wrote:

> Is it possible to have more than one authenticate_program entry, and one
> proxy_auth acl?

Not directly, but it isn't that hard implement it in a small perl
frontent to two or more proxy_auth modules.

#!/usr/bin/perl
use IPC::Open2;
open2(*read1,*write1,"/foo/bar/ncsa_auth /etc/passwd");
open2(*read2,*write2,"/bar/baz/squid_ldap_auth ldap.server.edu");
while(<>) {
  print write1 $_; $ans = <read1>;
  if ($ans =~ /^OK/) { print $ans; next; }
  print write2 $_; $ans = <read2>;
  if ($ans =~ /^OK/) { print $ans; next; }
  print $ans;
}

Or if separation is based on username:

#!/usr/bin/perl
open(auth1,"|/foo/bar/ncsa_auth /etc/passwd");
open(auth2,"|/bar/baz/squid_ldap_auth ldap.server.edu");
while(<>) {
  # users aXXX, bXXX, cXXX is sent to ncsa_auth
  if (/^[abc]/) { print auth1 $_; }
  # all others are sent to ldap_auth
  else { print auth2 $_; }
}

--
Henrik Nordstrom
Squid hacker
Received on Tue Apr 11 2000 - 15:17:43 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:52:54 MST