| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Authen::Smb; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 2463 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 52 |  | 
| 4 | 1 |  |  | 1 |  | 6 | use Carp; | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 350 |  | 
| 5 | 1 |  |  | 1 |  | 7 | use vars qw($VERSION @ISA @EXPORT @EXPORT_OK $AUTOLOAD); | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 476 |  | 
| 6 |  |  |  |  |  |  |  | 
| 7 |  |  |  |  |  |  | require Exporter; | 
| 8 |  |  |  |  |  |  | require DynaLoader; | 
| 9 |  |  |  |  |  |  | require AutoLoader; | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | @ISA = qw(Exporter DynaLoader); | 
| 12 |  |  |  |  |  |  | # Items to export into callers namespace by default. Note: do not export | 
| 13 |  |  |  |  |  |  | # names by default without a very good reason. Use EXPORT_OK instead. | 
| 14 |  |  |  |  |  |  | # Do not simply export all your public functions/methods/constants. | 
| 15 |  |  |  |  |  |  | @EXPORT_OK = qw( | 
| 16 |  |  |  |  |  |  | NTV_LOGON_ERROR | 
| 17 |  |  |  |  |  |  | NTV_NO_ERROR | 
| 18 |  |  |  |  |  |  | NTV_PROTOCOL_ERROR | 
| 19 |  |  |  |  |  |  | NTV_SERVER_ERROR | 
| 20 |  |  |  |  |  |  | ); | 
| 21 |  |  |  |  |  |  | $VERSION = '0.91'; | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | sub authen { | 
| 24 | 0 |  |  | 0 | 0 |  | my @args = @_; | 
| 25 |  |  |  |  |  |  |  | 
| 26 |  |  |  |  |  |  | # Truncate everything to length 80 to avoid poor coding practices in the | 
| 27 |  |  |  |  |  |  | # smbvalid.a (buffer overflows) PMK--fixme in smbvalid.a when possible. | 
| 28 | 0 |  |  |  |  |  | for my $i ( 0..$#args ) { | 
| 29 | 0 |  |  |  |  |  | $args[$i] = substr($args[$i], 0, 80); | 
| 30 |  |  |  |  |  |  | } | 
| 31 |  |  |  |  |  |  |  | 
| 32 | 0 |  |  |  |  |  | my($username, $password, $server, $backup, $domain) = @args; | 
| 33 |  |  |  |  |  |  |  | 
| 34 | 0 |  |  |  |  |  | my $res = Valid_User($username, $password, $server, $backup, $domain); | 
| 35 | 0 |  |  |  |  |  | $res | 
| 36 |  |  |  |  |  |  | } | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  |  | 
| 39 |  |  |  |  |  |  | sub AUTOLOAD { | 
| 40 |  |  |  |  |  |  | # This AUTOLOAD is used to 'autoload' constants from the constant() | 
| 41 |  |  |  |  |  |  | # XS function.  If a constant is not found then control is passed | 
| 42 |  |  |  |  |  |  | # to the AUTOLOAD in AutoLoader. | 
| 43 |  |  |  |  |  |  |  | 
| 44 | 0 |  |  | 0 |  |  | my $constname; | 
| 45 | 0 |  |  |  |  |  | ($constname = $AUTOLOAD) =~ s/.*:://; | 
| 46 | 0 | 0 |  |  |  |  | my $val = constant($constname, @_ ? $_[0] : 0); | 
| 47 | 0 | 0 |  |  |  |  | if ($! != 0) { | 
| 48 | 0 | 0 |  |  |  |  | if ($! =~ /Invalid/) { | 
| 49 | 0 |  |  |  |  |  | $AutoLoader::AUTOLOAD = $AUTOLOAD; | 
| 50 | 0 |  |  |  |  |  | goto &AutoLoader::AUTOLOAD; | 
| 51 |  |  |  |  |  |  | } | 
| 52 |  |  |  |  |  |  | else { | 
| 53 | 0 |  |  |  |  |  | croak "Your vendor has not defined Authen::Smb macro $constname"; | 
| 54 |  |  |  |  |  |  | } | 
| 55 |  |  |  |  |  |  | } | 
| 56 | 0 |  |  |  |  |  | eval "sub $AUTOLOAD { $val }"; | 
| 57 | 0 |  |  |  |  |  | goto &$AUTOLOAD; | 
| 58 |  |  |  |  |  |  | } | 
| 59 |  |  |  |  |  |  |  | 
| 60 |  |  |  |  |  |  | bootstrap Authen::Smb $VERSION; | 
| 61 |  |  |  |  |  |  |  | 
| 62 |  |  |  |  |  |  | # Preloaded methods go here. | 
| 63 |  |  |  |  |  |  |  | 
| 64 |  |  |  |  |  |  | # Autoload methods go after =cut, and are processed by the autosplit program. | 
| 65 |  |  |  |  |  |  |  | 
| 66 |  |  |  |  |  |  | 1; | 
| 67 |  |  |  |  |  |  | __END__ |