lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1249 - nss-pam-ldapd-solaris/nss

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

nss-pam-ldapd commit: r1249 - nss-pam-ldapd-solaris/nss



Author: arthur
Date: Sat Oct  9 22:10:27 2010
New Revision: 1249
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1249

Log:
have one shared file handle per flavour instead of one global one (for now) and 
re-introduce some other minor changes that got lost in r1247

Modified:
   nss-pam-ldapd-solaris/nss/ethers.c
   nss-pam-ldapd-solaris/nss/group.c
   nss-pam-ldapd-solaris/nss/netgroup.c
   nss-pam-ldapd-solaris/nss/networks.c
   nss-pam-ldapd-solaris/nss/passwd.c
   nss-pam-ldapd-solaris/nss/protocols.c
   nss-pam-ldapd-solaris/nss/rpc.c
   nss-pam-ldapd-solaris/nss/services.c
   nss-pam-ldapd-solaris/nss/shadow.c

Modified: nss-pam-ldapd-solaris/nss/ethers.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/ethers.c  Sat Oct  9 20:15:40 2010        (r1248)
+++ nss-pam-ldapd-solaris/nss/ethers.c  Sat Oct  9 22:10:27 2010        (r1249)
@@ -42,8 +42,6 @@
   return NSS_STATUS_SUCCESS;
 }
 
-static __thread TFILE *etherentfp;
-
 #ifdef NSS_FLAVOUR_GLIBC
 
 /* map a hostname to the corresponding ethernet address */
@@ -69,7 +67,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *etherentfp; */
+static __thread TFILE *etherentfp;
 
 /* open a connection to read all ether entries */
 nss_status_t _nss_ldap_setetherent(int UNUSED(stayopen))
@@ -161,6 +159,9 @@
   return retv;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *etherentfp;
+
 static nss_status_t _xnss_ldap_setetherent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(etherentfp);

Modified: nss-pam-ldapd-solaris/nss/group.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/group.c   Sat Oct  9 20:15:40 2010        (r1248)
+++ nss-pam-ldapd-solaris/nss/group.c   Sat Oct  9 22:10:27 2010        (r1249)
@@ -31,8 +31,6 @@
 #include "common.h"
 #include "compat/attrs.h"
 
-static __thread TFILE *grentfp;
-
 /* read a single group entry from the stream */
 static nss_status_t read_group(
         TFILE *fp,struct group *result,
@@ -56,8 +54,10 @@
   int32_t res=(int32_t)NSLCD_RESULT_BEGIN;
   int32_t tmpint32,tmp2int32,tmp3int32;
   gid_t gid;
+#ifdef NSS_FLAVOUR_GLIBC
   gid_t *newgroups;
   long int newsize;
+#endif /* NSS_FLAVOUR_GLIBC */
   /* loop over results */
   while (res==(int32_t)NSLCD_RESULT_BEGIN)
   {
@@ -130,7 +130,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *grentfp; */
+static __thread TFILE *grentfp;
 
 /* start a request to read all groups */
 nss_status_t _nss_ldap_setgrent(int UNUSED(stayopen))
@@ -277,6 +277,9 @@
   return status;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *grentfp;
+
 static nss_status_t _xnss_ldap_setgrent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(grentfp);

Modified: nss-pam-ldapd-solaris/nss/netgroup.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/netgroup.c        Sat Oct  9 20:15:40 2010        
(r1248)
+++ nss-pam-ldapd-solaris/nss/netgroup.c        Sat Oct  9 22:10:27 2010        
(r1249)
@@ -39,8 +39,6 @@
   fp=NULL; \
   return NSS_STATUS_RETURN;
 
-static __thread TFILE *netgrentfp;
-
 /* function for reading a single result entry */
 static nss_status_t read_netgrent(
         TFILE *fp,struct __netgrent *result,
@@ -92,7 +90,7 @@
 #ifdef NSS_FLAVOUR_GLIBC
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *netgrentfp; */
+static __thread TFILE *netgrentfp;
 
 /* start a request to get a netgroup by name */
 nss_status_t _nss_ldap_setnetgrent(
@@ -125,7 +123,7 @@
 }
 
 /* close the stream opened with setnetgrent() above */
-nss_status_t _nss_ldap_endnetgrent(struct __netgrent UNUSED(* result))
+nss_status_t _nss_ldap_endnetgrent(struct __netgrent UNUSED(*result))
 {
   NSS_ENDENT(netgrentfp);
 }
@@ -191,6 +189,9 @@
   return group;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *netgrentfp;
+
 static nss_status_t _nss_nslcd_getnetgrent_r(struct __netgrent *result,char 
*buffer,size_t buflen,int *errnop)
 {
   NSS_GETENT(netgrentfp,NSLCD_ACTION_NETGROUP_BYNAME,buffer,buflen,
@@ -198,7 +199,7 @@
   return retv;
 }
 
-static nss_status_t _nss_nslcd_setnetgrent(const char *group,struct __netgrent 
UNUSED(* result))
+static nss_status_t _nss_nslcd_setnetgrent(const char *group,struct __netgrent 
UNUSED(*result))
 {
   /* we cannot use NSS_SETENT() here because we have a parameter that is only
      available in this function */

Modified: nss-pam-ldapd-solaris/nss/networks.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/networks.c        Sat Oct  9 20:15:40 2010        
(r1248)
+++ nss-pam-ldapd-solaris/nss/networks.c        Sat Oct  9 22:10:27 2010        
(r1249)
@@ -61,9 +61,6 @@
 #define ERROR_OUT_WRITEERROR(fp) \
   ERROR_OUT_READERROR(fp)
 
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *netentfp;
-
 /* read a single network entry from the stream, ignoring entries
    that are not AF_INET (IPv4), result is stored in result */
 static nss_status_t read_netent(
@@ -140,7 +137,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *netentfp; */
+static __thread TFILE *netentfp;
 
 /* start a request to read all networks */
 nss_status_t _nss_ldap_setnetent(int UNUSED(stayopen))
@@ -296,6 +293,9 @@
   return status;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *netentfp;
+
 static nss_status_t _xnss_ldap_setnetent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(netentfp);
@@ -319,7 +319,6 @@
   int h_errno;
   char *data_ptr;
   nss_status_t status;
-
   if (NSS_ARGS(args)->buf.buflen<0)
   {
     NSS_ARGS(args)->erange=1;

Modified: nss-pam-ldapd-solaris/nss/passwd.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/passwd.c  Sat Oct  9 20:15:40 2010        (r1248)
+++ nss-pam-ldapd-solaris/nss/passwd.c  Sat Oct  9 22:10:27 2010        (r1249)
@@ -30,9 +30,6 @@
 #include "common.h"
 #include "compat/attrs.h"
 
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *pwentfp;
-
 /* read a passwd entry from the stream */
 static nss_status_t read_passwd(
         TFILE *fp,struct passwd *result,
@@ -75,7 +72,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *pwentfp; */
+static __thread TFILE *pwentfp;
 
 /* open a connection to read all passwd entries */
 nss_status_t _nss_ldap_setpwent(int UNUSED(stayopen))
@@ -161,6 +158,9 @@
   return retv;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *pwentfp;
+
 /* open a connection to the nslcd and write the request */
 static nss_status_t _xnss_ldap_setpwent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {

Modified: nss-pam-ldapd-solaris/nss/protocols.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/protocols.c       Sat Oct  9 20:15:40 2010        
(r1248)
+++ nss-pam-ldapd-solaris/nss/protocols.c       Sat Oct  9 22:10:27 2010        
(r1249)
@@ -30,9 +30,6 @@
 #include "common.h"
 #include "compat/attrs.h"
 
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *protoentfp;
-
 /* read a single protocol entry from the stream */
 static nss_status_t read_protoent(
         TFILE *fp,struct protoent *result,
@@ -71,7 +68,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *protoentfp; */
+static __thread TFILE *protoentfp;
 
 /* start a request to read all protocol entries */
 nss_status_t _nss_ldap_setprotoent(int UNUSED(stayopen))
@@ -206,6 +203,9 @@
   return status;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *protoentfp;
+
 static nss_status_t _xnss_ldap_setprotoent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(protoentfp);

Modified: nss-pam-ldapd-solaris/nss/rpc.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/rpc.c     Sat Oct  9 20:15:40 2010        (r1248)
+++ nss-pam-ldapd-solaris/nss/rpc.c     Sat Oct  9 22:10:27 2010        (r1249)
@@ -30,9 +30,6 @@
 #include "common.h"
 #include "compat/attrs.h"
 
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *protoentfp;
-
 /* read a sinlge rpc entry from the stream */
 static nss_status_t read_rpcent(
         TFILE *fp,struct rpcent *result,
@@ -71,7 +68,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *protoentfp; */
+static __thread TFILE *protoentfp;
 
 /* request a stream to list all rpc entries */
 nss_status_t _nss_ldap_setrpcent(int UNUSED(stayopen))
@@ -119,6 +116,9 @@
   return retv;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *protoentfp;
+
 static nss_status_t _xnss_ldap_setrpcent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(protoentfp);

Modified: nss-pam-ldapd-solaris/nss/services.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/services.c        Sat Oct  9 20:15:40 2010        
(r1248)
+++ nss-pam-ldapd-solaris/nss/services.c        Sat Oct  9 22:10:27 2010        
(r1249)
@@ -30,9 +30,6 @@
 #include "common.h"
 #include "compat/attrs.h"
 
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *serventfp;
-
 /* read a single services result entry from the stream */
 static nss_status_t read_servent(
         TFILE *fp,struct servent *result,
@@ -75,7 +72,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *protoentfp; */
+static __thread TFILE *serventfp;
 
 /* open request to get all services */
 nss_status_t _nss_ldap_setservent(int UNUSED(stayopen))
@@ -123,6 +120,9 @@
   return retv;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *serventfp;
+
 static nss_status_t _xnss_ldap_setservent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(serventfp);

Modified: nss-pam-ldapd-solaris/nss/shadow.c
==============================================================================
--- nss-pam-ldapd-solaris/nss/shadow.c  Sat Oct  9 20:15:40 2010        (r1248)
+++ nss-pam-ldapd-solaris/nss/shadow.c  Sat Oct  9 22:10:27 2010        (r1249)
@@ -30,9 +30,6 @@
 #include "common.h"
 #include "compat/attrs.h"
 
-/* thread-local file pointer to an ongoing request */
-static __thread TFILE *spentfp; 
-
 /* read a single shadow entry from the stream */
 static nss_status_t read_spwd(
         TFILE *fp,struct spwd *result,
@@ -66,7 +63,7 @@
 }
 
 /* thread-local file pointer to an ongoing request */
-/* static __thread TFILE *spentfp; */
+static __thread TFILE *spentfp;
 
 /* start listing all shadow users */
 nss_status_t _nss_ldap_setspent(int UNUSED(stayopen))
@@ -111,6 +108,7 @@
   char *buffer=NSS_ARGS(args)->buf.buffer;
   size_t buflen=NSS_ARGS(args)->buf.buflen;
   char *data_ptr;
+  char field_buf[128];
   nss_status_t status;
   if (NSS_ARGS(args)->buf.buflen<0)
   {
@@ -124,7 +122,6 @@
   {
     /* result==NULL, return file format */
     data_ptr=(char *)malloc(buflen);
-    char field_buf[128];
     sprintf(data_ptr,"%s:%s:",sp->sp_namp,sp->sp_pwdp);
     if (sp->sp_lstchg >= 0)
       sprintf(field_buf,"%d:",sp->sp_lstchg);
@@ -173,6 +170,9 @@
   return status;
 }
 
+/* thread-local file pointer to an ongoing request */
+static __thread TFILE *spentfp;
+
 static nss_status_t _xnss_ldap_setspent(nss_backend_t UNUSED(*be),void 
UNUSED(*args))
 {
   NSS_SETENT(spentfp);
@@ -193,6 +193,7 @@
   char *buffer=NSS_ARGS(args)->buf.buffer;
   size_t buflen=NSS_ARGS(args)->buf.buflen;
   char *data_ptr;
+  char field_buf[128];
   nss_status_t status;
   if (NSS_ARGS(args)->buf.buflen<0)
   {
@@ -206,7 +207,6 @@
   {
     /* result==NULL, return file format */
     data_ptr=(char *)malloc(buflen);
-    char field_buf[128];
     sprintf(data_ptr,"%s:%s:",sp->sp_namp,sp->sp_pwdp);
     if (sp->sp_lstchg >= 0)
       sprintf(field_buf,"%d:",sp->sp_lstchg);
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits