Apache2-AuthenNTLM

 view release on metacpan or  search on metacpan

smb/Smb.pm  view on Meta::CPAN

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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

82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  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

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#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 )