Apache2-AuthenNTLM

 view release on metacpan or  search on metacpan

smb/Smb.pm  view on Meta::CPAN


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) = @args;

  my $res = Valid_User($username, $password, $server, $backup, $domain);
  $res
}


sub AUTOLOAD {
    # This AUTOLOAD is used to 'autoload' constants from the constant()
    # XS function.  If a constant is not found then control is passed
    # to the AUTOLOAD in AutoLoader.

    my $constname;

smb/Smb.pm  view on Meta::CPAN


  if ( $authResult == Authen::Smb::NO_ERROR ) {
    print "User successfully authenticated.\n";
  } else {
    print "User not authenticated with error level $authResult\n";
  }

=head1 DESCRIPTION

Authen::Smb allows you to authenticate a user against an NT domain.  You can
specify both a primary and a backup server to use for authentication.  The
NT names of the machines should be used for specifying servers.

An authentication request will return one of four values:

NTV_NO_ERROR (0)
NTV_SERVER_ERROR (1)
NTV_PROTOCOL_ERROR (2)
NTV_LOGON_ERROR (3)

NTV_NO_ERROR is the only return value possible for a successful authentication.

smb/Smb.xs  view on Meta::CPAN


MODULE = Authen::Smb	PACKAGE = Authen::Smb		


double
constant(name,arg)
	char *		name
	int		arg

int
Valid_User(username, password, server, backup, domain)
	char *		username
	char *		password
	char *		server
	char *		backup
	char *		domain
	OUTPUT:
	RETVAL



void *
Valid_User_Connect(server,backup,domain,nonce)
    char *server
    char *backup
    char *domain
    char *nonce
CODE:
    if (!SvPOK (ST(3)) || SvCUR(ST(3)) < 8)
        croak ("nonce muist be preallocated with an 8 character string") ;

    RETVAL = Valid_User_Connect(server, backup, domain, nonce);
OUTPUT:
    RETVAL



int 
Valid_User_Auth(handle,username,password,precrypt=0,domain="")
    void *handle
    char *username
    char *password

smb/smbval/valid.h  view on Meta::CPAN

#ifndef _VALID_H_
#define _VALID_H_
/* SMB User verification function */

#define NTV_NO_ERROR 0
#define NTV_SERVER_ERROR 1
#define NTV_PROTOCOL_ERROR 2
#define NTV_LOGON_ERROR 3

int Valid_User(char *username,char *password,char *server, char *backup, char *domain);
void *Valid_User_Connect(char *server,char *backup, char *domain, char *nonce) ;
int Valid_User_Auth(void *handle, char *username,char *password,int precrypt, char * domain) ;
void Valid_User_Disconnect(void *handle) ;

#endif



( run in 1.154 second using v1.01-cache-2.11-cpan-49f99fa48dc )