Apache2-AuthenNTLM

 view release on metacpan or  search on metacpan

AuthenNTLM.pm  view on Meta::CPAN

verified the user to the smb (windows) server, the smb server will terminate the first 
request. To avoid this Apache2::AuthenNTLM serializes all requests. It uses a semaphore
for this purpose. The semkey directive set the key which is used (default: 23754).
Set it to zero to turn serialization off.

=head2 PerlSetVar ntlmsemtimeout

This set the timeout value used to wait for the semaphore. The default is two seconds.
It is very small because during the time Apache waits for the semaphore, no other
authentication request can be sent to the windows server. Also Apache2::AuthenNTLM
only asks the windows server once per keep-alive connection, this timeout value
should be as small as possible.

=head2 PerlSetVar splitdomainprefix

If set to 1, $self -> map_user ($r) will return "username" 
else $self -> map_user ($r) will return "domain\username"
 
Default is "domain\username" 

=head2 PerlSetVar ntlmdebug 

Changes  view on Meta::CPAN

   - Fixed all changes to work with mp2 API renaming changes

---- End of Apache::AuthenNTLM

2.10  07. Feb 2005
   - Fixed $VERSION... 

2.09  07. Feb 2005
   - Added notes about KeepAlive Off in httpd.conf file
   - Added patch from Sergey Svishchev that fixes and issue where
     each request after the first request on a keep-alive
     connection used POST data as headers. (Thanks!!)
   - Added patch that fixed "SMB Server connection not open in 
     state 3" error with Apache2/mp2. (Big thanks to Dr. Russell Mosemann!)

2.08  04.  Oct 2004
   - Applied patch from Chris Hughes, which changes the modification
     of $conn -> remote_host(), (which became read-only in 
     mod_perl-1.99_15).

2.07  07.  May 2004

Changes  view on Meta::CPAN


0.16  14. Apr 2002

   - Return DECLINE to pass request to next authentication handler
     in case ntlmauthoritative is not set and a communication error
     with the Domain Controller has occured.
   - Return DECLINE to pass request to next authentication handler
     in case ntlmauthoritative is not set and we have credentials
     for another authorization method given from the browser.
   - Log the connection header in debug mode to see if it's a keep
     alive request.

 0.15  9. Apr 2002

   - Added patch from Brian Paulsen which causes correct handling of
     non unicode charset (needed for some versions of win9x) and
     more verbose debugging output (decoded flags)

 0.14  26. Feb 2002

   - fixed a problem that page content of Perl sometimes goes to the

smb/smbval/rfcnb-io.c  view on Meta::CPAN


*/


int RFCNB_Get_Pkt(struct RFCNB_Con *con, struct RFCNB_Pkt *pkt, int len)

{ int read_len, pkt_len;
  char hdr[RFCNB_Pkt_Hdr_Len];      /* Local space for the header */
  struct RFCNB_Pkt *pkt_frag;
  int more, this_time, offset, frag_len, this_len;
  BOOL seen_keep_alive = TRUE;

  /* Read that header straight into the buffer */

  if (len < RFCNB_Pkt_Hdr_Len) { /* What a bozo */

#ifdef RFCNB_DEBUG
    fprintf(stderr, "Trying to read less than a packet:");
    perror("");
#endif
    RFCNB_errno = RFCNBE_BadParam;
    return(RFCNBE_Bad);

  }

  /* We discard keep alives here ... */

  if (RFCNB_Timeout > 0) 
    alarm(RFCNB_Timeout);

  while (seen_keep_alive) {

    if ((read_len = read(con -> fd, hdr, sizeof(hdr))) < 0) { /* Problems */
#ifdef RFCNB_DEBUG
      fprintf(stderr, "Reading the packet, we got:");
      perror("");
#endif
      if (errno == EINTR)
	RFCNB_errno = RFCNBE_Timeout;
      else
	RFCNB_errno = RFCNBE_BadRead;

smb/smbval/rfcnb-io.c  view on Meta::CPAN

    }

    if (RFCNB_Pkt_Type(hdr) == RFCNB_SESSION_KEEP_ALIVE) {

#ifdef RFCNB_DEBUG
      fprintf(stderr, "RFCNB KEEP ALIVE received\n");
#endif
      
    }
    else {
      seen_keep_alive = FALSE;
    }

  }
 
  /* What if we got less than or equal to a hdr size in bytes? */

  if (read_len < sizeof(hdr)) { /* We got a small packet */

    /* Now we need to copy the hdr portion we got into the supplied packet */

smb/smbval/session.c  view on Meta::CPAN

  if ((ret_len = RFCNB_Get_Pkt(con_Handle, pkt, Length + RFCNB_Pkt_Hdr_Len)) < 0) {

#ifdef RFCNB_DEBUG
    fprintf(stderr, "Bad packet return in RFCNB_Recv... \n");
#endif

    return(RFCNBE_Bad);

  }

  /* We should check that we go a message and not a keep alive */

  pkt -> next = NULL;

  RFCNB_Free_Pkt(pkt);

  return(ret_len);

}

/* We just disconnect from the other end, as there is nothing in the RFCNB */



( run in 0.902 second using v1.01-cache-2.11-cpan-df04353d9ac )