lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1596 - in nss-pam-ldapd: common nslcd

[Date Prev][Date Next] [Thread Prev][Thread Next]

nss-pam-ldapd commit: r1596 - in nss-pam-ldapd: common nslcd



Author: arthur
Date: Tue Jan 17 20:38:19 2012
New Revision: 1596
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1596&view=revision

Log:
pass the correct size of named socket address (fixes FreeBSD issue, fixes r1295)

Modified:
   nss-pam-ldapd/common/nslcd-prot.c
   nss-pam-ldapd/nslcd/nslcd.c

Modified: nss-pam-ldapd/common/nslcd-prot.c
==============================================================================
--- nss-pam-ldapd/common/nslcd-prot.c   Mon Jan 16 22:17:29 2012        (r1595)
+++ nss-pam-ldapd/common/nslcd-prot.c   Tue Jan 17 20:38:19 2012        (r1596)
@@ -66,7 +66,7 @@
   strncpy(addr.sun_path,NSLCD_SOCKET,sizeof(addr.sun_path));
   addr.sun_path[sizeof(addr.sun_path)-1]='\0';
   /* connect to the socket */
-  if (connect(sock,(struct sockaddr 
*)&addr,(socklen_t)(sizeof(addr.sun_family)+strlen(addr.sun_path)))<0)
+  if (connect(sock,(struct sockaddr *)&addr,SUN_LEN(&addr))<0)
   {
     (void)close(sock);
     return NULL;

Modified: nss-pam-ldapd/nslcd/nslcd.c
==============================================================================
--- nss-pam-ldapd/nslcd/nslcd.c Mon Jan 16 22:17:29 2012        (r1595)
+++ nss-pam-ldapd/nslcd/nslcd.c Tue Jan 17 20:38:19 2012        (r1596)
@@ -314,7 +314,7 @@
   strncpy(addr.sun_path,filename,sizeof(addr.sun_path));
   addr.sun_path[sizeof(addr.sun_path)-1]='\0';
   /* bind to the named socket */
-  if (bind(sock,(struct sockaddr 
*)&addr,(sizeof(addr.sun_family)+strlen(addr.sun_path))))
+  if (bind(sock,(struct sockaddr *)&addr,SUN_LEN(&addr)))
   {
     log_log(LOG_ERR,"bind() to %s failed: %s",filename,strerror(errno));
     if (close(sock))
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/