Blame SOURCES/nss-pam-ldapd-0.8.13-uid_formatting.patch

df3ee2
diff -up nss-pam-ldapd-0.8.13/nslcd/group.c.uid_formatting nss-pam-ldapd-0.8.13/nslcd/group.c
df3ee2
--- nss-pam-ldapd-0.8.13/nslcd/group.c.uid_formatting	2013-02-23 22:24:00.000000000 +0100
df3ee2
+++ nss-pam-ldapd-0.8.13/nslcd/group.c	2017-10-24 14:17:27.489696761 +0200
df3ee2
@@ -109,10 +109,8 @@ static int mkfilter_group_bygid(gid_t gi
df3ee2
   }
df3ee2
   else
df3ee2
   {
df3ee2
-    return mysnprintf(buffer,buflen,
df3ee2
-                      "(&%s(%s=%d))",
df3ee2
-                      group_filter,
df3ee2
-                      attmap_group_gidNumber,(int)gid);
df3ee2
+    return mysnprintf(buffer,buflen,"(&%s(%s=%lu))",
df3ee2
+                      group_filter,attmap_group_gidNumber,(unsigned long int)gid);
df3ee2
   }
df3ee2
 }
df3ee2
 
df3ee2
diff -up nss-pam-ldapd-0.8.13/nslcd/nslcd.c.uid_formatting nss-pam-ldapd-0.8.13/nslcd/nslcd.c
df3ee2
--- nss-pam-ldapd-0.8.13/nslcd/nslcd.c.uid_formatting	2017-10-24 14:17:05.117590857 +0200
df3ee2
+++ nss-pam-ldapd-0.8.13/nslcd/nslcd.c	2017-10-24 14:17:27.490696766 +0200
df3ee2
@@ -402,8 +402,8 @@ static void handleconnection(int sock,MY
df3ee2
   if (getpeercred(sock,&uid,&gid,&pid))
df3ee2
     log_log(LOG_DEBUG,"connection from unknown client: %s",strerror(errno));
df3ee2
   else
df3ee2
-    log_log(LOG_DEBUG,"connection from pid=%d uid=%d gid=%d",
df3ee2
-                      (int)pid,(int)uid,(int)gid);
df3ee2
+    log_log(LOG_DEBUG,"connection from pid=%lu uid=%lu gid=%lu",
df3ee2
+            (unsigned long int)pid,(unsigned long int)uid,(unsigned long int)gid);
df3ee2
   /* create a stream object */
df3ee2
   if ((fp=tio_fdopen(sock,READ_TIMEOUT,WRITE_TIMEOUT,
df3ee2
                      READBUFFER_MINSIZE,READBUFFER_MAXSIZE,
df3ee2
@@ -519,7 +519,7 @@ static void create_pidfile(const char *f
df3ee2
       log_log(LOG_ERR,"cannot truncate pid file (%s): %s",filename,strerror(errno));
df3ee2
       exit(EXIT_FAILURE);
df3ee2
     }
df3ee2
-    mysnprintf(buffer,sizeof(buffer),"%d\n",(int)getpid());
df3ee2
+    mysnprintf(buffer,sizeof(buffer),"%lu\n",(unsigned long int)getpid());
df3ee2
     if (write(fd,buffer,strlen(buffer))!=(int)strlen(buffer))
df3ee2
     {
df3ee2
       log_log(LOG_ERR,"error writing pid file (%s): %s",filename,strerror(errno));
df3ee2
@@ -755,11 +755,11 @@ int main(int argc,char *argv[])
df3ee2
 #ifdef HAVE_INITGROUPS
df3ee2
     /* load supplementary groups */
df3ee2
     if (initgroups(nslcd_cfg->ldc_uidname,nslcd_cfg->ldc_gid)<0)
df3ee2
-      log_log(LOG_WARNING,"cannot initgroups(\"%s\",%d) (ignored): %s",
df3ee2
-              nslcd_cfg->ldc_uidname,(int)nslcd_cfg->ldc_gid,strerror(errno));
df3ee2
+      log_log(LOG_WARNING,"cannot initgroups(\"%s\",%lu) (ignored): %s",
df3ee2
+              nslcd_cfg->ldc_uidname,(unsigned long int)nslcd_cfg->ldc_gid,strerror(errno));
df3ee2
     else
df3ee2
-      log_log(LOG_DEBUG,"initgroups(\"%s\",%d) done",
df3ee2
-              nslcd_cfg->ldc_uidname,(int)nslcd_cfg->ldc_gid);
df3ee2
+      log_log(LOG_DEBUG,"initgroups(\"%s\",%lu) done",
df3ee2
+              nslcd_cfg->ldc_uidname,(unsigned long int)nslcd_cfg->ldc_gid);
df3ee2
 #else /* not HAVE_INITGROUPS */
df3ee2
 #ifdef HAVE_SETGROUPS
df3ee2
     /* just drop all supplemental groups */
df3ee2
@@ -777,20 +777,22 @@ int main(int argc,char *argv[])
df3ee2
   {
df3ee2
     if (setgid(nslcd_cfg->ldc_gid)!=0)
df3ee2
     {
df3ee2
-      log_log(LOG_ERR,"cannot setgid(%d): %s",(int)nslcd_cfg->ldc_gid,strerror(errno));
df3ee2
+      log_log(LOG_ERR,"cannot setgid(%lu): %s",
df3ee2
+			  (unsigned long int)nslcd_cfg->ldc_gid,strerror(errno));
df3ee2
       exit(EXIT_FAILURE);
df3ee2
     }
df3ee2
-    log_log(LOG_DEBUG,"setgid(%d) done",(int)nslcd_cfg->ldc_gid);
df3ee2
+    log_log(LOG_DEBUG,"setgid(%lu) done",(unsigned long int)nslcd_cfg->ldc_gid);
df3ee2
   }
df3ee2
   /* change to nslcd uid */
df3ee2
   if (nslcd_cfg->ldc_uid!=NOUID)
df3ee2
   {
df3ee2
     if (setuid(nslcd_cfg->ldc_uid)!=0)
df3ee2
     {
df3ee2
-      log_log(LOG_ERR,"cannot setuid(%d): %s",(int)nslcd_cfg->ldc_uid,strerror(errno));
df3ee2
+      log_log(LOG_ERR,"cannot setuid(%lu): %s",
df3ee2
+			  (unsigned long int)nslcd_cfg->ldc_uid,strerror(errno));
df3ee2
       exit(EXIT_FAILURE);
df3ee2
     }
df3ee2
-    log_log(LOG_DEBUG,"setuid(%d) done",(int)nslcd_cfg->ldc_uid);
df3ee2
+    log_log(LOG_DEBUG,"setuid(%lu) done",(unsigned long int)nslcd_cfg->ldc_uid);
df3ee2
   }
df3ee2
   /* block all these signals so our worker threads won't handle them */
df3ee2
   sigemptyset(&signalmask);
df3ee2
diff -up nss-pam-ldapd-0.8.13/nslcd/passwd.c.uid_formatting nss-pam-ldapd-0.8.13/nslcd/passwd.c
df3ee2
--- nss-pam-ldapd-0.8.13/nslcd/passwd.c.uid_formatting	2013-02-23 22:24:00.000000000 +0100
df3ee2
+++ nss-pam-ldapd-0.8.13/nslcd/passwd.c	2017-10-24 14:17:27.490696766 +0200
df3ee2
@@ -115,10 +115,8 @@ static int mkfilter_passwd_byuid(uid_t u
df3ee2
   }
df3ee2
   else
df3ee2
   {
df3ee2
-    return mysnprintf(buffer,buflen,
df3ee2
-                      "(&%s(%s=%d))",
df3ee2
-                      passwd_filter,
df3ee2
-                      attmap_passwd_uidNumber,(int)uid);
df3ee2
+    return mysnprintf(buffer,buflen, "(&%s(%s=%lu))",
df3ee2
+                      passwd_filter,attmap_passwd_uidNumber,(unsigned long int)uid);
df3ee2
   }
df3ee2
 }
df3ee2