[Samba] [tik@talicom.de: [PATCH] pam_winbind bug]

Timo Benk tik at talicom.de
Wed Aug 7 01:44:02 GMT 2002


Sorry, 
i forgot the patch:-)

-timo

----- Forwarded message from Timo Benk <tik at talicom.de> -----

Date: Wed, 7 Aug 2002 10:35:57 +0200
From: Timo Benk <tik at talicom.de>
Reply-To: Timo Benk <tik at talicom.de>
To: samba at samba.org
Cc: Timo Benk <tik at talicom.de>
Subject: [PATCH] pam_winbind bug

Hi,

The socket which is opened in write_sock() from
wb_common.c is never closed in pam_winbind.c.

The attached patch fixes the problem for me in the 
pam winbind module.

-timo

----- End forwarded message -----
-------------- next part --------------
diff -r -c2 samba-2.2.5/source/nsswitch/pam_winbind.c samba-2.2.5.winbind_patch/source/nsswitch/pam_winbind.c
*** samba-2.2.5/source/nsswitch/pam_winbind.c	Fri May  3 03:03:19 2002
--- samba-2.2.5.winbind_patch/source/nsswitch/pam_winbind.c	Wed Aug  7 10:22:58 2002
***************
*** 16,19 ****
--- 16,20 ----
  int write_sock(void *buffer, int count);
  int read_reply(struct winbindd_response *response);
+ void close_sock(void);
  
  /* data tokens */
***************
*** 109,112 ****
--- 110,116 ----
  	if (write_sock(request, sizeof(*request)) == -1) {
  		_pam_log(LOG_ERR, "write to socket failed!");
+ 
+ 		// close the socket to the winbind daemon
+ 		close_sock();
  		return PAM_SERVICE_ERR;
  	}
***************
*** 115,120 ****
--- 119,130 ----
  	if (read_reply(response) == -1) {
  		_pam_log(LOG_ERR, "read from socket failed!");
+ 
+ 		// close the socket to the winbind daemon
+ 		close_sock();
  		return PAM_SERVICE_ERR;
  	}
+ 
+ 	// close the socket to the winbind daemon
+ 	close_sock();
  
  	/* Copy reply data from socket */


More information about the samba mailing list