lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1301 - nss-pam-ldapd/nslcd

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

nss-pam-ldapd commit: r1301 - nss-pam-ldapd/nslcd



Author: arthur
Date: Sun Nov  7 14:13:57 2010
New Revision: 1301
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?view=rev&revision=1301

Log:
log the request with any logged messages

Modified:
   nss-pam-ldapd/nslcd/alias.c
   nss-pam-ldapd/nslcd/common.h
   nss-pam-ldapd/nslcd/ether.c
   nss-pam-ldapd/nslcd/group.c
   nss-pam-ldapd/nslcd/host.c
   nss-pam-ldapd/nslcd/log.c
   nss-pam-ldapd/nslcd/log.h
   nss-pam-ldapd/nslcd/netgroup.c
   nss-pam-ldapd/nslcd/network.c
   nss-pam-ldapd/nslcd/pam.c
   nss-pam-ldapd/nslcd/passwd.c
   nss-pam-ldapd/nslcd/protocol.c
   nss-pam-ldapd/nslcd/rpc.c
   nss-pam-ldapd/nslcd/service.c
   nss-pam-ldapd/nslcd/shadow.c

Modified: nss-pam-ldapd/nslcd/alias.c
==============================================================================
--- nss-pam-ldapd/nslcd/alias.c Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/alias.c Sun Nov  7 14:13:57 2010        (r1301)
@@ -123,8 +123,8 @@
   alias,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_alias_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("alias=\"%s\"",name);,
   NSLCD_ACTION_ALIAS_BYNAME,
   mkfilter_alias_byname(name,filter,sizeof(filter)),
   write_alias(fp,entry,name)
@@ -133,8 +133,7 @@
 NSLCD_HANDLE(
   alias,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_alias_all()");,
+  log_setrequest("alias(all)");,
   NSLCD_ACTION_ALIAS_ALL,
   (filter=alias_filter,0),
   write_alias(fp,entry,NULL)

Modified: nss-pam-ldapd/nslcd/common.h
==============================================================================
--- nss-pam-ldapd/nslcd/common.h        Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/common.h        Sun Nov  7 14:13:57 2010        (r1301)
@@ -147,13 +147,13 @@
 int nslcd_pam_pwmod(TFILE *fp,MYLDAP_SESSION *session,uid_t calleruid);
 
 /* macros for generating service handling code */
-#define NSLCD_HANDLE(db,fn,readfn,logcall,action,mkfilter,writefn) \
+#define NSLCD_HANDLE(db,fn,readfn,action,mkfilter,writefn) \
   int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session) \
-  NSLCD_HANDLE_BODY(db,fn,readfn,logcall,action,mkfilter,writefn)
-#define NSLCD_HANDLE_UID(db,fn,readfn,logcall,action,mkfilter,writefn) \
+  NSLCD_HANDLE_BODY(db,fn,readfn,action,mkfilter,writefn)
+#define NSLCD_HANDLE_UID(db,fn,readfn,action,mkfilter,writefn) \
   int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session,uid_t calleruid) \
-  NSLCD_HANDLE_BODY(db,fn,readfn,logcall,action,mkfilter,writefn)
-#define NSLCD_HANDLE_BODY(db,fn,readfn,logcall,action,mkfilter,writefn) \
+  NSLCD_HANDLE_BODY(db,fn,readfn,action,mkfilter,writefn)
+#define NSLCD_HANDLE_BODY(db,fn,readfn,action,mkfilter,writefn) \
   { \
     /* define common variables */ \
     int32_t tmpint32; \
@@ -163,8 +163,6 @@
     int rc,i; \
     /* read request parameters */ \
     readfn; \
-    /* log call */ \
-    logcall; \
     /* write the response header */ \
     WRITE_INT32(fp,NSLCD_VERSION); \
     WRITE_INT32(fp,action); \

Modified: nss-pam-ldapd/nslcd/ether.c
==============================================================================
--- nss-pam-ldapd/nslcd/ether.c Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/ether.c Sun Nov  7 14:13:57 2010        (r1301)
@@ -165,8 +165,8 @@
   ether,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_ether_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("ether=\"%s\"",name);,
   NSLCD_ACTION_ETHER_BYNAME,
   mkfilter_ether_byname(name,filter,sizeof(filter)),
   write_ether(fp,entry,name,NULL)
@@ -179,8 +179,8 @@
   char filter[1024];
   READ_TYPE(fp,addr,uint8_t[6]);
   if (ether_ntoa_r(&addr,ether)==NULL)
-    return -1;,
-  log_log(LOG_DEBUG,"nslcd_ether_byether(%s)",ether);,
+    return -1;
+  log_setrequest("ether=%s",ether);,
   NSLCD_ACTION_ETHER_BYETHER,
   mkfilter_ether_byether(&addr,filter,sizeof(filter)),
   write_ether(fp,entry,NULL,ether)
@@ -189,8 +189,7 @@
 NSLCD_HANDLE(
   ether,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_ether_all()");,
+  log_setrequest("ether(all)");,
   NSLCD_ACTION_ETHER_ALL,
   (filter=ether_filter,0),
   write_ether(fp,entry,NULL,NULL)

Modified: nss-pam-ldapd/nslcd/group.c
==============================================================================
--- nss-pam-ldapd/nslcd/group.c Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/group.c Sun Nov  7 14:13:57 2010        (r1301)
@@ -282,11 +282,11 @@
   char name[256];
   char filter[1024];
   READ_STRING(fp,name);
+  log_setrequest("group=\"%s\"",name);
   if (!isvalidname(name)) {
-    log_log(LOG_WARNING,"nslcd_group_byname(%s): invalid group name",name);
+    log_log(LOG_WARNING,"\"%s\": invalid group name",name);
     return -1;
   },
-  log_log(LOG_DEBUG,"nslcd_group_byname(%s)",name);,
   NSLCD_ACTION_GROUP_BYNAME,
   mkfilter_group_byname(name,filter,sizeof(filter)),
   write_group(fp,entry,name,NULL,1,session)
@@ -296,8 +296,8 @@
   group,bygid,
   gid_t gid;
   char filter[1024];
-  READ_TYPE(fp,gid,gid_t);,
-  log_log(LOG_DEBUG,"nslcd_group_bygid(%d)",(int)gid);,
+  READ_TYPE(fp,gid,gid_t);
+  log_setrequest("group=%d",(int)gid);,
   NSLCD_ACTION_GROUP_BYGID,
   mkfilter_group_bygid(gid,filter,sizeof(filter)),
   write_group(fp,entry,NULL,&gid,1,session)
@@ -308,20 +308,22 @@
   char name[256];
   char filter[1024];
   READ_STRING(fp,name);
-  if (!isvalidname(name)) {
-    log_log(LOG_WARNING,"nslcd_group_bymember(%s): invalid user name",name);
+  log_setrequest("group/member=\"%s\"",name);
+  if (!isvalidname(name))
+  {
+    log_log(LOG_WARNING,"\"%s\": invalid user name",name);
     return -1;
   }
   if ((nslcd_cfg->ldc_nss_initgroups_ignoreusers!=NULL)&&
       set_contains(nslcd_cfg->ldc_nss_initgroups_ignoreusers,name))
   {
+    log_log(LOG_DEBUG,"ignored group member");
     /* just end the request, returning no results */
     WRITE_INT32(fp,NSLCD_VERSION);
     WRITE_INT32(fp,NSLCD_ACTION_GROUP_BYMEMBER);
     WRITE_INT32(fp,NSLCD_RESULT_END);
     return 0;
   },
-  log_log(LOG_DEBUG,"nslcd_group_bymember(%s)",name);,
   NSLCD_ACTION_GROUP_BYMEMBER,
   mkfilter_group_bymember(session,name,filter,sizeof(filter)),
   write_group(fp,entry,NULL,NULL,0,session)
@@ -330,8 +332,7 @@
 NSLCD_HANDLE(
   group,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_group_all()");,
+  log_setrequest("group(all)");,
   NSLCD_ACTION_GROUP_ALL,
   (filter=group_filter,0),
   write_group(fp,entry,NULL,NULL,1,session)

Modified: nss-pam-ldapd/nslcd/host.c
==============================================================================
--- nss-pam-ldapd/nslcd/host.c  Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/host.c  Sun Nov  7 14:13:57 2010        (r1301)
@@ -155,8 +155,8 @@
   host,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_host_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("host=\"%s\"",name);,
   NSLCD_ACTION_HOST_BYNAME,
   mkfilter_host_byname(name,filter,sizeof(filter)),
   write_host(fp,entry)
@@ -175,8 +175,8 @@
   {
     log_log(LOG_WARNING,"unable to convert address to string");
     return -1;
-  },
-  log_log(LOG_DEBUG,"nslcd_host_byaddr(%s)",name);,
+  }
+  log_setrequest("host=%s",name);,
   NSLCD_ACTION_HOST_BYADDR,
   mkfilter_host_byaddr(name,filter,sizeof(filter)),
   write_host(fp,entry)
@@ -185,8 +185,7 @@
 NSLCD_HANDLE(
   host,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_host_all()");,
+  log_setrequest("host(all)");,
   NSLCD_ACTION_HOST_ALL,
   (filter=host_filter,0),
   write_host(fp,entry)

Modified: nss-pam-ldapd/nslcd/log.c
==============================================================================
--- nss-pam-ldapd/nslcd/log.c   Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/log.c   Sun Nov  7 14:13:57 2010        (r1301)
@@ -1,7 +1,7 @@
 /*
    log.c - logging funtions
 
-   Copyright (C) 2002, 2003, 2008 Arthur de Jong
+   Copyright (C) 2002, 2003, 2008, 2010 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -56,6 +56,11 @@
 static __thread char *sessionid=NULL;
 
 
+/* the request identifier that is set for this thread */
+static __thread char *requestid=NULL;
+#define MAX_REQUESTID_LENGTH 40
+
+
 /* set loglevel when no logging is configured */
 void log_setdefaultloglevel(int loglevel)
 {
@@ -144,6 +149,32 @@
     }
   }
   sprintf(sessionid,"%06x",(int)(rand()&0xffffff));
+  /* set the request id to empty */
+  if (requestid!=NULL)
+    requestid[0]='\0';
+}
+
+
+/* indicate that a request identifier should be included in the output
+   from this point on, until log_newsession() is called */
+void log_setrequest(const char *format, ...)
+{
+  va_list ap;
+  /* ensure that requestid can hold a string */
+  if (requestid==NULL)
+  {
+    requestid=(char *)malloc(MAX_REQUESTID_LENGTH);
+    if (requestid==NULL)
+    {
+      fprintf(stderr,"malloc() failed: %s",strerror(errno));
+      return; /* silently fail */
+    }
+  }
+  /* make the message */
+  va_start(ap,format);
+  vsnprintf(requestid,MAX_REQUESTID_LENGTH,format,ap);
+  requestid[MAX_REQUESTID_LENGTH-1]='\0';
+  va_end(ap);
 }
 
 
@@ -174,7 +205,9 @@
     /* if logging is not yet defined, log to stderr */
     if (pri<=prelogging_loglevel)
     {
-      if (sessionid)
+      if ((requestid!=NULL)&&(requestid[0]!='\0'))
+        fprintf(stderr,"%s: [%s] <%s> 
%s%s\n",PACKAGE,sessionid,requestid,pri==LOG_DEBUG?"DEBUG: ":"",buffer);
+      else if (sessionid)
         fprintf(stderr,"%s: [%s] 
%s%s\n",PACKAGE,sessionid,pri==LOG_DEBUG?"DEBUG: ":"",buffer);
       else
         fprintf(stderr,"%s: %s%s\n",PACKAGE,pri==LOG_DEBUG?"DEBUG: 
":"",buffer);
@@ -188,14 +221,18 @@
       {
         if (lst->fp==NULL) /* syslog */
         {
-          if (sessionid)
+          if ((requestid!=NULL)&&(requestid[0]!='\0'))
+            syslog(pri,"[%s] <%s> %s",sessionid,requestid,buffer);
+          else if (sessionid)
             syslog(pri,"[%s] %s",sessionid,buffer);
           else
             syslog(pri,"%s",buffer);
         }
         else /* file */
         {
-          if (sessionid)
+          if ((requestid!=NULL)&&(requestid[0]!='\0'))
+            fprintf(lst->fp,"%s: [%s] <%s> 
%s\n",sessionid,requestid,PACKAGE,buffer);
+          else if (sessionid)
             fprintf(lst->fp,"%s: [%s] %s\n",sessionid,PACKAGE,buffer);
           else
             fprintf(lst->fp,"%s: %s\n",PACKAGE,buffer);

Modified: nss-pam-ldapd/nslcd/log.h
==============================================================================
--- nss-pam-ldapd/nslcd/log.h   Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/log.h   Sun Nov  7 14:13:57 2010        (r1301)
@@ -1,7 +1,7 @@
 /*
    log.h - definitions of logging funtions
 
-   Copyright (C) 2002, 2003, 2007, 2008 Arthur de Jong
+   Copyright (C) 2002, 2003, 2007, 2008, 2010 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -54,6 +54,12 @@
 void log_newsession(void);
 
 
+/* indicate that a request identifier should be included in the output
+   from this point on, until log_newsession() is called */
+void log_setrequest(const char *format, ...)
+  LIKE_PRINTF(1,2);
+
+
 /* log the given message using the configured logging method */
 void log_log(int pri,const char *format, ...)
   LIKE_PRINTF(2,3);

Modified: nss-pam-ldapd/nslcd/netgroup.c
==============================================================================
--- nss-pam-ldapd/nslcd/netgroup.c      Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/netgroup.c      Sun Nov  7 14:13:57 2010        (r1301)
@@ -241,8 +241,8 @@
   netgroup,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_netgroup_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("netgroup=\"%s\"",name);,
   NSLCD_ACTION_NETGROUP_BYNAME,
   mkfilter_netgroup_byname(name,filter,sizeof(filter)),
   write_netgroup(fp,entry,name)

Modified: nss-pam-ldapd/nslcd/network.c
==============================================================================
--- nss-pam-ldapd/nslcd/network.c       Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/network.c       Sun Nov  7 14:13:57 2010        (r1301)
@@ -153,8 +153,8 @@
   network,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_network_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("network=\"%s\"",name);,
   NSLCD_ACTION_NETWORK_BYNAME,
   mkfilter_network_byname(name,filter,sizeof(filter)),
   write_network(fp,entry)
@@ -173,8 +173,8 @@
   {
     log_log(LOG_WARNING,"unable to convert address to string");
     return -1;
-  },
-  log_log(LOG_DEBUG,"nslcd_network_byaddr(%s)",name);,
+  }
+  log_setrequest("network=%s",name);,
   NSLCD_ACTION_NETWORK_BYADDR,
   mkfilter_network_byaddr(name,filter,sizeof(filter)),
   write_network(fp,entry)
@@ -183,8 +183,7 @@
 NSLCD_HANDLE(
   network,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_network_all()");,
+  log_setrequest("network(all)");,
   NSLCD_ACTION_NETWORK_ALL,
   (filter=network_filter,0),
   write_network(fp,entry)

Modified: nss-pam-ldapd/nslcd/pam.c
==============================================================================
--- nss-pam-ldapd/nslcd/pam.c   Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/pam.c   Sun Nov  7 14:13:57 2010        (r1301)
@@ -142,6 +142,7 @@
   READ_STRING(fp,servicename);
   READ_STRING(fp,password);
   /* log call */
+  log_setrequest("pam_authc=\"%s\"",username);
   log_log(LOG_DEBUG,"nslcd_pam_authc(\"%s\",\"%s\",\"%s\",\"%s\")",
                     username,userdn,servicename,*password?"***":"");
   /* write the response header */
@@ -294,6 +295,7 @@
   READ_STRING(fp,rhost);
   READ_STRING(fp,tty);
   /* log call */
+  log_setrequest("pam_authz=\"%s\"",username);
   
log_log(LOG_DEBUG,"nslcd_pam_authz(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")",
             username,userdn,servicename,ruser,rhost,tty);
   /* write the response header */
@@ -358,6 +360,7 @@
   READ_STRING(fp,ruser);
   READ_INT32(fp,sessionid);
   /* log call */
+  log_setrequest("pam_sess_o=\"%s\"",username);
   
log_log(LOG_DEBUG,"nslcd_pam_sess_o(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")",
                     username,userdn,servicename,tty,rhost,ruser);
   /* write the response header */
@@ -387,6 +390,7 @@
   READ_STRING(fp,ruser);
   READ_INT32(fp,sessionid);
   /* log call */
+  log_setrequest("pam_sess_c=\"%s\"",username);
   log_log(LOG_DEBUG,"nslcd_pam_sess_c(\"%s\",\"%s\",\"%s\",%d)",
                     username,userdn,servicename,(int)sessionid);
   /* write the response header */
@@ -443,6 +447,7 @@
   READ_STRING(fp,oldpassword);
   READ_STRING(fp,newpassword);
   /* log call */
+  log_setrequest("pam_pwmod=\"%s\"",username);
   log_log(LOG_DEBUG,"nslcd_pam_pwmod(\"%s\",\"%s\",\"%s\",\"%s\",\"%s\")",
                     username,userdn,servicename,*oldpassword?"***":"",
                     *newpassword?"***":"");

Modified: nss-pam-ldapd/nslcd/passwd.c
==============================================================================
--- nss-pam-ldapd/nslcd/passwd.c        Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/passwd.c        Sun Nov  7 14:13:57 2010        (r1301)
@@ -412,11 +412,11 @@
   char name[256];
   char filter[1024];
   READ_STRING(fp,name);
+  log_setrequest("passwd=\"%s\"",name);
   if (!isvalidname(name)) {
-    log_log(LOG_WARNING,"nslcd_passwd_byname(%s): invalid user name",name);
+    log_log(LOG_WARNING,"\"%s\": invalid user name",name);
     return -1;
   },
-  log_log(LOG_DEBUG,"nslcd_passwd_byname(%s)",name);,
   NSLCD_ACTION_PASSWD_BYNAME,
   mkfilter_passwd_byname(name,filter,sizeof(filter)),
   write_passwd(fp,entry,name,NULL,calleruid)
@@ -426,8 +426,8 @@
   passwd,byuid,
   uid_t uid;
   char filter[1024];
-  READ_TYPE(fp,uid,uid_t);,
-  log_log(LOG_DEBUG,"nslcd_passwd_byuid(%d)",(int)uid);,
+  READ_TYPE(fp,uid,uid_t);
+  log_setrequest("passwd=%d",(int)uid);,
   NSLCD_ACTION_PASSWD_BYUID,
   mkfilter_passwd_byuid(uid,filter,sizeof(filter)),
   write_passwd(fp,entry,NULL,&uid,calleruid)
@@ -436,8 +436,7 @@
 NSLCD_HANDLE_UID(
   passwd,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_passwd_all()");,
+  log_setrequest("passwd(all)");,
   NSLCD_ACTION_PASSWD_ALL,
   (filter=passwd_filter,0),
   write_passwd(fp,entry,NULL,NULL,calleruid)

Modified: nss-pam-ldapd/nslcd/protocol.c
==============================================================================
--- nss-pam-ldapd/nslcd/protocol.c      Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/protocol.c      Sun Nov  7 14:13:57 2010        (r1301)
@@ -162,8 +162,8 @@
   protocol,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_protocol_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("protocol=\"%s\"",name);,
   NSLCD_ACTION_PROTOCOL_BYNAME,
   mkfilter_protocol_byname(name,filter,sizeof(filter)),
   write_protocol(fp,entry,name)
@@ -173,8 +173,8 @@
   protocol,bynumber,
   int protocol;
   char filter[1024];
-  READ_INT32(fp,protocol);,
-  log_log(LOG_DEBUG,"nslcd_protocol_bynumber(%d)",protocol);,
+  READ_INT32(fp,protocol);
+  log_setrequest("protocol=%d",protocol);,
   NSLCD_ACTION_PROTOCOL_BYNUMBER,
   mkfilter_protocol_bynumber(protocol,filter,sizeof(filter)),
   write_protocol(fp,entry,NULL)
@@ -183,8 +183,7 @@
 NSLCD_HANDLE(
   protocol,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_protocol_all()");,
+  log_setrequest("protocol(all)");,
   NSLCD_ACTION_PROTOCOL_ALL,
   (filter=protocol_filter,0),
   write_protocol(fp,entry,NULL)

Modified: nss-pam-ldapd/nslcd/rpc.c
==============================================================================
--- nss-pam-ldapd/nslcd/rpc.c   Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/rpc.c   Sun Nov  7 14:13:57 2010        (r1301)
@@ -163,8 +163,8 @@
   rpc,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_rpc_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("rpc=\"%s\"",name);,
   NSLCD_ACTION_RPC_BYNAME,
   mkfilter_rpc_byname(name,filter,sizeof(filter)),
   write_rpc(fp,entry,name)
@@ -174,8 +174,8 @@
   rpc,bynumber,
   int number;
   char filter[1024];
-  READ_INT32(fp,number);,
-  log_log(LOG_DEBUG,"nslcd_rpc_bynumber(%d)",number);,
+  READ_INT32(fp,number);
+  log_setrequest("rpc=%d",number);,
   NSLCD_ACTION_RPC_BYNUMBER,
   mkfilter_rpc_bynumber(number,filter,sizeof(filter)),
   write_rpc(fp,entry,NULL)
@@ -184,8 +184,7 @@
 NSLCD_HANDLE(
   rpc,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_rpc_all()");,
+  log_setrequest("rpc(all)");,
   NSLCD_ACTION_RPC_ALL,
   (filter=rpc_filter,0),
   write_rpc(fp,entry,NULL)

Modified: nss-pam-ldapd/nslcd/service.c
==============================================================================
--- nss-pam-ldapd/nslcd/service.c       Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/service.c       Sun Nov  7 14:13:57 2010        (r1301)
@@ -206,8 +206,8 @@
   char protocol[256];
   char filter[1024];
   READ_STRING(fp,name);
-  READ_STRING(fp,protocol);,
-  log_log(LOG_DEBUG,"nslcd_service_byname(%s,%s)",name,protocol);,
+  READ_STRING(fp,protocol);
+  log_setrequest("service=\"%s\"/%s",name,protocol);,
   NSLCD_ACTION_SERVICE_BYNAME,
   mkfilter_service_byname(name,protocol,filter,sizeof(filter)),
   write_service(fp,entry,name,protocol)
@@ -219,8 +219,8 @@
   char protocol[256];
   char filter[1024];
   READ_INT32(fp,number);
-  READ_STRING(fp,protocol);,
-  log_log(LOG_DEBUG,"nslcd_service_bynumber(%d,%s)",number,protocol);,
+  READ_STRING(fp,protocol);
+  log_setrequest("service=%d/%s",number,protocol);,
   NSLCD_ACTION_SERVICE_BYNUMBER,
   mkfilter_service_bynumber(number,protocol,filter,sizeof(filter)),
   write_service(fp,entry,NULL,protocol)
@@ -229,8 +229,7 @@
 NSLCD_HANDLE(
   service,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_service_all()");,
+  log_setrequest("service(all)");,
   NSLCD_ACTION_SERVICE_ALL,
   (filter=service_filter,0),
   write_service(fp,entry,NULL,NULL)

Modified: nss-pam-ldapd/nslcd/shadow.c
==============================================================================
--- nss-pam-ldapd/nslcd/shadow.c        Sun Nov  7 14:08:18 2010        (r1300)
+++ nss-pam-ldapd/nslcd/shadow.c        Sun Nov  7 14:13:57 2010        (r1301)
@@ -240,8 +240,8 @@
   shadow,byname,
   char name[256];
   char filter[1024];
-  READ_STRING(fp,name);,
-  log_log(LOG_DEBUG,"nslcd_shadow_byname(%s)",name);,
+  READ_STRING(fp,name);
+  log_setrequest("shadow=\"%s\"",name);,
   NSLCD_ACTION_SHADOW_BYNAME,
   mkfilter_shadow_byname(name,filter,sizeof(filter)),
   write_shadow(fp,entry,name)
@@ -250,8 +250,7 @@
 NSLCD_HANDLE(
   shadow,all,
   const char *filter;
-  /* no parameters to read */,
-  log_log(LOG_DEBUG,"nslcd_shadow_all()");,
+  log_setrequest("shadow(all)");,
   NSLCD_ACTION_SHADOW_ALL,
   (filter=shadow_filter,0),
   write_shadow(fp,entry,NULL)
--
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits