Return-Path: Delivered-To: apmail-modperl-archive@apache.org Received: (qmail 91801 invoked by uid 500); 22 Feb 2002 18:31:30 -0000 Mailing-List: contact modperl-help@apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Delivered-To: mailing list modperl@apache.org Received: (qmail 91771 invoked from network); 22 Feb 2002 18:31:28 -0000 Sender: ramirezc@roses.bna.boeing.com Message-ID: <3C768E7E.740C6370@roses.bna.boeing.com> Date: Fri, 22 Feb 2002 10:31:26 -0800 From: Carlos Ramirez Organization: Boeing - Human Space Flight & Exploration X-Mailer: Mozilla 4.73 [en] (X11; U; SunOS 5.5.1 sun4u) X-Accept-Language: en MIME-Version: 1.0 To: Andrew Afliatunov CC: Carlos Ramirez , "Stathy G. Touloumis" , Mod_perl Subject: Re: [Samba authorization] References: <20020219223935.OWXC379.out019.verizon.net@out019> <3C75EBAA.4B86FE01@taom.ru> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Write a test script using Authen::Smb and run it from the commandline. You can copy-paste the synopsis portion of the Authen::Smb documentation (i.e. perldoc Authen::Smb). If (you can connect and and authenticate from the commandline) { the problem resides in your mod_perl installation, # either an @INC problem, or re-install mod_perl. } else { problem with your Perl installation # re-install Perl } -Carlos Andrew Afliatunov wrote: > > Carlos Ramirez wrote: > > > Here are some fixes I incorporated into my private copy of > > Authen::Smb and Apache::AuthenSmb modules. These changes > > are based on some discussion I found in the modperl > > mailing list posted on Thu, 16 Sep 1999 by Matt Arnold. I > > basically copied Matt's suggestions and added them in. > > I was getting the same error messages but after I > > incorporated theses changes, it to fixed the problem on > > SUN Sparc Solaris 2.5.1..2.8. > > > > =Begin Snippet from mailing list > > > > The resulting additions to Authen::Smb look like this: > > > > use Fcntl qw(:flock); > > ... > > open S, "> /full/path/to/AuthenSmb.lck" or die "Can't open > > AuthenSmb.lck: $!\n"; > > flock S, LOCK_EX; > > my $res = Valid_User($username, $password, $server, $backup, $domain); > > > > close S; > > > > In short, I ended up adding > > the following two lines to Apache::AuthenSmb. > > > > use Memoize; > > memoize('Authen::Smb::authen'); > > > > =End of Snippet > > > > I contacted the author of Apache::AuthenSmb (a long time > > ago) and asked him if he could add these changes into > > the module. He stated he no longer has access to machines > > where he can test his module and asked me to post > > it in the modperl mailing list (which I never did). > > I used this module extensively in our environment and > > have also added some other nice features. Anyhow, if > > the author can no longer maintain it, i'd be glad ty > > update it ;) > > > > Since, this fix also requires that Authen::Smb to be > > modified, maybe the author of the cool Authen::Smb module > > add some option to allow a lock file or force it to use a > > lock file (??). > > > > Something along the lines: > > sub authen { > > my @args = @_; > > > > # Truncate everything to length 80 to avoid poor coding practices in the > > # smbvalid.a (buffer overflows) PMK--fixme in smbvalid.a when possible. > > for my $i ( 0..$#args ) { > > $args[$i] = substr($args[$i], 0, 80); > > } > > > > my($username, $password, $server, $backup, $domain, $lockfile) = @args; > > my $res; > > if ($lockfile) { > > open L, "> $lockfile" or die "Can't open AuthenSmb.lck: $!\n"; > > flock L, LOCK_EX; > > $res = Valid_User($username, $password, $server, $backup, $domain); > > close L; > > } > > else { > > $res = Valid_User($username, $password, $server, $backup, $domain); > > } > > > > return $res; > > } > > > > > > Anyhow, hope this helps. > > > > > > Please, let's continue discussing my problem. Remind you, that I > > > > installed mod_perl, Authen-Smb-0.91 and Apache-AuthenSmb-0.60 for > > > > authorization in apache against NT server. And I get this error in > > > > apache error.log file: > > > > "Undefined subroutine &Apache::AuthenSmb::handler called". > > > > In discussion we stopped at the point that I have wrong Smb.so file, > > > > because when I put "PerlModule Apache::AuthenSmb" in my httpd.conf file > > > > I get > > > > -- > > > > Syntax error on line 346 of /usr/local/apache/conf/httpd.conf: > > > > Can't load > > > > '/usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/Authen/Smb/Smb.so' > > > > for > > > > module Authen::Smb: ld.so.1: /usr/local/apache/bin/httpd: fatal: > > > > relocation error: file > > > > /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/auto/Authen/Smb/Smb.so: > > > > symbol main: referenced symbol not found at > > > > /usr/local/lib/perl5/5.6.1/sun4-solaris/DynaLoader.pm line 206. > > > > at /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5 > > > > Compilation failed in require at > > > > /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5. > > > > BEGIN failed--compilation aborted at > > > > /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5. > > > > Compilation failed in require at (eval 3) line 3. > > > > -- > > > > when making 'apachectl configtest'. I tried to reinstall AuthenSmb with > > > > its default options (default Makefile.PL), - no success. > > > > Maybe I must install it with some different from default options? Who > > > > knows what are such options? What is configurable there? Or what may be > > > > done with my Smb.so in oder Authen:Smb to understand it? > > > > > > > > > > > > Hi! > I did suggested changes: > In Authen::Smb added lines 'use Fcntl qw(:flock);' and > -- > open S, "> /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Authen/AuthenSmb.lck" > or die "Can't open AuthenSmb.lck: $!\n"; > flock S, LOCK_EX; > my $res = Valid_User($username, $password, $server, $backup, $domain); > close S; > -- > Replaced subroutine 'authen' as shown above. > > In Apache::AuthenSmb added > -- > use Memoize; > memoize('Authen::Smb::authen'); > -- > > And now I get this error when making 'apachectl configtest': > -- > Syntax error on line 346 of /usr/local/apache/conf/httpd.conf: > Can't load '/usr/local/lib/perl5/5.6.1/sun4-solaris/auto/Fcntl/Fcntl.so' for > module Fcntl: ld.so.1: /usr/local/apache/bin/httpd: fatal: relocation error: file > /usr/local/lib/perl5/5.6.1/sun4-solaris/auto/Fcntl/Fcntl.so: symbol main: > referenced symbol not found at /usr/local/lib/perl5/5.6.1/sun4-solaris/XSLoader.pm > line 75. > at /usr/local/lib/perl5/5.6.1/sun4-solaris/Fcntl.pm line 220 > Compilation failed in require at > /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Authen/Smb.pm line 6. > BEGIN failed--compilation aborted at > /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris/Authen/Smb.pm line 6. > Compilation failed in require at > /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5. > BEGIN failed--compilation aborted at > /usr/local/lib/perl5/site_perl/5.6.1/Apache/AuthenSmb.pm line 5. > Compilation failed in require at (eval 3) line 3. > -- > Line 346 of httpd.conf contains 'PerlModule Apache::AuthenSmb'. > > So, what am I supposed to do now? > > -- > Andrew -- ------------------------------------------------------------------------- Carlos Ramirez + Boeing + Human Flight & Space Exploration + 714.372.4181 -------------------------------------------------------------------------