Apache2-AuthenNTLM
view release on metacpan or search on metacpan
2223242526272829303132333435363738394041424344sub
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
;
828384858687888990919293949596979899100101102
if
(
$authResult
== Authen::Smb::NO_ERROR ) {
"User successfully authenticated.\n"
;
}
else
{
"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.
118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159MODULE = 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
123456789101112131415#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 0.336 second using v1.01-cache-2.11-cpan-95122f20152 )