lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1275 - in nss-pam-ldapd-solaris: . compat nslcd nss

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

nss-pam-ldapd commit: r1275 - in nss-pam-ldapd-solaris: . compat nslcd nss



Author: arthur
Date: Thu Oct 14 21:11:49 2010
New Revision: 1275
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1275

Log:
merge changes from trunk

Modified:
   nss-pam-ldapd-solaris/   (props changed)
   nss-pam-ldapd-solaris/compat/ldap_passwd_s.c
   nss-pam-ldapd-solaris/configure.ac
   nss-pam-ldapd-solaris/nslcd/myldap.c
   nss-pam-ldapd-solaris/nslcd/pam.c
   nss-pam-ldapd-solaris/nss/Makefile.am

Modified: nss-pam-ldapd-solaris/compat/ldap_passwd_s.c
==============================================================================
--- nss-pam-ldapd-solaris/compat/ldap_passwd_s.c        Thu Oct 14 21:05:57 
2010        (r1274)
+++ nss-pam-ldapd-solaris/compat/ldap_passwd_s.c        Thu Oct 14 21:11:49 
2010        (r1275)
@@ -29,7 +29,7 @@
 #include <ldap.h>
 
 #include "compat/ldap_compat.h"
-#include "nslcd/log.h"
+#include "compat/attrs.h"
 
 #ifndef LDAP_EXOP_MODIFY_PASSWD
 #ifdef LDAP_EXOP_X_MODIFY_PASSWD
@@ -66,7 +66,7 @@
    the new password to set and newpasswd is sometimes returned (though not
    by us). See RFC 3062 for details.*/
 int ldap_passwd_s(LDAP *ld,struct berval *user,struct berval *oldpw,
-                  struct berval *newpw,struct berval *newpasswd,
+                  struct berval *newpw,struct berval UNUSED(*newpasswd),
                   LDAPControl **sctrls,LDAPControl **cctrls)
 {
 #ifndef HAVE_LDAP_EXTENDED_OPERATION_S

Modified: nss-pam-ldapd-solaris/configure.ac
==============================================================================
--- nss-pam-ldapd-solaris/configure.ac  Thu Oct 14 21:05:57 2010        (r1274)
+++ nss-pam-ldapd-solaris/configure.ac  Thu Oct 14 21:11:49 2010        (r1275)
@@ -252,10 +252,10 @@
 AC_SUBST(PAM_LDAP_SONAME)
 
 # check which modules should be build
-AC_ARG_WITH(nss-ldap-maps,
-            AS_HELP_STRING([--with-nss-ldap-maps=MAP LIST],
+AC_ARG_WITH(nss-maps,
+            AS_HELP_STRING([--with-nss-maps=MAP LIST],
                            [comma separated list of NSS maps to build 
@<:@all@:>@]),
-            ,[ with_nss_ldap_maps="all" ])
+            ,[ with_nss_maps="all" ])
 
 # checks for availability of header files
 AC_CHECK_HEADERS([ctype.h strings.h pthread.h fcntl.h limits.h])
@@ -309,6 +309,18 @@
     #include <netinet/ether.h>
     #endif])
 
+# check for ether_aton and ether_ntoa functions
+AC_CHECK_FUNCS(ether_aton ether_ntoa ether_aton_r ether_ntoa_r)
+AC_CHECK_DECLS([ether_aton,ether_ntoa],,,[
+    #include <sys/types.h>
+    #include <sys/socket.h>
+    #include <net/if.h>
+    #include <netinet/in.h>
+    #include <netinet/if_ether.h>
+    #ifdef HAVE_NETINET_ETHER_H
+    #include <netinet/ether.h>
+    #endif])
+
 # check to see if socklen_t is defined
 AC_CHECK_TYPE(socklen_t,,
     AC_DEFINE(socklen_t,size_t,[Define to `size_t' if not defined elswhere.]),[
@@ -403,15 +415,15 @@
 
   # check which module source files to use
   AC_MSG_CHECKING([which NSS maps to build])
-  if test "x$with_nss_ldap_maps" = "xall"
+  if test "x$with_nss_maps" = "xall"
   then
     case "$with_nss_flavour" in
-      glibc)   
with_nss_ldap_maps="aliases,ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow"
 ;;
-      solaris) 
with_nss_ldap_maps="ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow"
 ;;
+      glibc)   
with_nss_maps="aliases,ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow"
 ;;
+      solaris) 
with_nss_maps="ethers,group,hosts,netgroup,networks,passwd,protocols,rpc,services,shadow"
 ;;
     esac
   fi
-  AC_MSG_RESULT($with_nss_ldap_maps)
-  NSS_MODULE_OBJS="`echo "$with_nss_ldap_maps " | sed 's/,/ /g;s/  
*/.$(OBJEXT) /g'`"
+  AC_MSG_RESULT($with_nss_maps)
+  NSS_MODULE_OBJS="`echo "$with_nss_maps " | sed 's/,/ /g;s/  */.$(OBJEXT) 
/g'`"
   AC_SUBST(NSS_MODULE_OBJS)
 
   # find out how to link the library
@@ -538,21 +550,9 @@
   AC_SEARCH_LIBS(daemon,bsd)
   AC_REPLACE_FUNCS(daemon)
 
-  # replace ether_ntoa_r() and ether_aton_r() if they are not found
+  # replace ether_aton_r() and ether_ntoa_r() if they are not found
   AC_CHECK_FUNCS(ether_aton_r ether_ntoa_r,,[AC_LIBOBJ(ether)])
 
-  # check requirements for our replacement functions
-  AC_CHECK_FUNCS(ether_ntoa ether_aton)
-  AC_CHECK_DECLS([ether_ntoa,ether_aton],,,[
-      #include <sys/types.h>
-      #include <sys/socket.h>
-      #include <net/if.h>
-      #include <netinet/in.h>
-      #include <netinet/if_ether.h>
-      #ifdef HAVE_NETINET_ETHER_H
-      #include <netinet/ether.h>
-      #endif])
-
   # check to see if struct sockaddr_storage is defined
   AC_CHECK_TYPE(struct sockaddr_storage,,
       AC_DEFINE(sockaddr_storage,sockaddr_in,[Define to `sockaddr_in' if not 
defined elsewhere.]),[

Modified: nss-pam-ldapd-solaris/nslcd/myldap.c
==============================================================================
--- nss-pam-ldapd-solaris/nslcd/myldap.c        Thu Oct 14 21:05:57 2010        
(r1274)
+++ nss-pam-ldapd-solaris/nslcd/myldap.c        Thu Oct 14 21:11:49 2010        
(r1275)
@@ -62,10 +62,10 @@
 #ifdef HAVE_GSSSASL_H
 #include <gsssasl.h>
 #endif
-/* Try to handle systems with both SASL libraries installed */
-#if defined(HAVE_SASL_SASL_H) && defined(HAVE_SASL_AUXPROP_REQUEST)
+#ifdef HAVE_SASL_SASL_H
 #include <sasl/sasl.h>
-#elif defined(HAVE_SASL_H)
+#endif
+#ifdef HAVE_SASL_H
 #include <sasl.h>
 #endif
 #include <ctype.h>
@@ -622,6 +622,8 @@
 static int do_open(MYLDAP_SESSION *session)
 {
   int rc,rc2;
+  int sd=-1;
+  struct timeval tv;
   /* check if the idle time for the connection has expired */
   myldap_session_check(session);
   /* if the connection is still there (ie. ldap_unbind() wasn't
@@ -683,6 +685,15 @@
       log_log(LOG_WARNING,"ldap_unbind() failed: %s",ldap_err2string(rc2));
     return rc;
   }
+  /* set timeout options on socket to avoid hang in some cases */
+  if (ldap_get_option(session->ld,LDAP_OPT_DESC,&sd)==LDAP_SUCCESS)
+  {
+    /* ignore errors */
+    tv.tv_sec=nslcd_cfg->ldc_timelimit;
+    tv.tv_usec=500;
+    (void)setsockopt(sd,SOL_SOCKET,SO_RCVTIMEO,(void *)&tv,sizeof(tv));
+    (void)setsockopt(sd,SOL_SOCKET,SO_SNDTIMEO,(void *)&tv,sizeof(tv));
+  }
   /* update last activity and finish off state */
   time(&(session->lastactivity));
   return LDAP_SUCCESS;

Modified: nss-pam-ldapd-solaris/nslcd/pam.c
==============================================================================
--- nss-pam-ldapd-solaris/nslcd/pam.c   Thu Oct 14 21:05:57 2010        (r1274)
+++ nss-pam-ldapd-solaris/nslcd/pam.c   Thu Oct 14 21:11:49 2010        (r1275)
@@ -284,9 +284,7 @@
   char username[256];
   char userdn[256];
   char servicename[64];
-  char ruser[32];
-  char rhost[256];
-  char tty[256];
+  char ruser[256],rhost[HOST_NAME_MAX+1],tty[64];
   char hostname[HOST_NAME_MAX+1];
   DICT *dict;
   /* read request parameters */
@@ -350,7 +348,7 @@
   char username[256];
   char userdn[256];
   char servicename[64];
-  char tty[64],rhost[64],ruser[256];
+  char tty[64],rhost[HOST_NAME_MAX+1],ruser[256];
   int32_t sessionid;
   /* read request parameters */
   READ_STRING(fp,username);
@@ -379,7 +377,7 @@
   char username[256];
   char userdn[256];
   char servicename[64];
-  char tty[64],rhost[64],ruser[256];
+  char tty[64],rhost[HOST_NAME_MAX+1],ruser[256];
   int32_t sessionid;
   /* read request parameters */
   READ_STRING(fp,username);

Modified: nss-pam-ldapd-solaris/nss/Makefile.am
==============================================================================
--- nss-pam-ldapd-solaris/nss/Makefile.am       Thu Oct 14 21:05:57 2010        
(r1274)
+++ nss-pam-ldapd-solaris/nss/Makefile.am       Thu Oct 14 21:11:49 2010        
(r1275)
@@ -32,7 +32,7 @@
                             networks.c passwd.c protocols.c rpc.c services.c \
                             shadow.c
 nss_ldap_so_DEPENDENCIES = $(NSS_MODULE_OBJS)
-nss_ldap_so_LDADD = ../common/libtio.a ../common/libprot.a $(NSS_MODULE_OBJS)
+nss_ldap_so_LDADD = $(NSS_MODULE_OBJS) ../common/libtio.a ../common/libprot.a
 
 EXTRA_DIST = exports.glibc exports.solaris
 
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits