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