lists.arthurdejong.org
RSS feed

nss-pam-ldapd branch master updated. 0.9.4-6-g78627c9

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

nss-pam-ldapd branch master updated. 0.9.4-6-g78627c9



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "nss-pam-ldapd".

The branch, master has been updated
       via  78627c97f9ff4a15e6b54f45877cf4459ac6db17 (commit)
      from  a726d291b0f6794abec0a0192cf2b2a742648e4a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://arthurdejong.org/git/nss-pam-ldapd/commit/?id=78627c97f9ff4a15e6b54f45877cf4459ac6db17

commit 78627c97f9ff4a15e6b54f45877cf4459ac6db17
Author: Jason Luan <jianhai.luan@oracle.com>
Date:   Wed Aug 27 15:58:37 2014 +0800

    uid_t/gid_t should be formatted as unsigned long
    
    mmkfilter_passwd_byuid()/mkfilter_group_bygid() get wrong filter string
    because "%d" will return negative when uid/gid larger than 2^31, and
    result to "Authentiction failure".
    
    This also changes the other places where uid_t or gid_t values are
    formatted.

diff --git a/nslcd/cfg.c b/nslcd/cfg.c
index 1d99962..4928244 100644
--- a/nslcd/cfg.c
+++ b/nslcd/cfg.c
@@ -1626,11 +1626,11 @@ static void cfg_dump(void)
   if (nslcd_cfg->uidname != NULL)
     log_log(LOG_DEBUG, "CFG: uid %s", nslcd_cfg->uidname);
   else if (nslcd_cfg->uid != NOUID)
-    log_log(LOG_DEBUG, "CFG: uid %d", (int)nslcd_cfg->uid);
+    log_log(LOG_DEBUG, "CFG: uid %lu", (unsigned long int)nslcd_cfg->uid);
   else
     log_log(LOG_DEBUG, "CFG: # uid not set");
   if (nslcd_cfg->gid != NOGID)
-    log_log(LOG_DEBUG, "CFG: gid %d", (int)nslcd_cfg->gid);
+    log_log(LOG_DEBUG, "CFG: gid %lu", (unsigned long int)nslcd_cfg->gid);
   else
     log_log(LOG_DEBUG, "CFG: # gid not set");
   log_log_config();
@@ -1783,7 +1783,7 @@ static void cfg_dump(void)
       strcpy(buffer + sizeof(buffer) - 4, "...");
     log_log(LOG_DEBUG, "CFG: nss_initgroups_ignoreusers %s", buffer);
   }
-  log_log(LOG_DEBUG, "CFG: nss_min_uid %d", (int)nslcd_cfg->nss_min_uid);
+  log_log(LOG_DEBUG, "CFG: nss_min_uid %lu", (unsigned long 
int)nslcd_cfg->nss_min_uid);
   log_log(LOG_DEBUG, "CFG: nss_nested_groups %s", 
print_boolean(nslcd_cfg->nss_nested_groups));
   log_log(LOG_DEBUG, "CFG: validnames %s", nslcd_cfg->validnames_str);
   log_log(LOG_DEBUG, "CFG: ignorecase %s", 
print_boolean(nslcd_cfg->ignorecase));
diff --git a/nslcd/group.c b/nslcd/group.c
index d7dfe42..95349ad 100644
--- a/nslcd/group.c
+++ b/nslcd/group.c
@@ -123,8 +123,8 @@ static int mkfilter_group_bygid(gid_t gid, char *buffer, 
size_t buflen)
   }
   else
   {
-    return mysnprintf(buffer, buflen, "(&%s(%s=%d))",
-                      group_filter, attmap_group_gidNumber, (int)gid);
+    return mysnprintf(buffer, buflen, "(&%s(%s=%lu))",
+                      group_filter, attmap_group_gidNumber, (unsigned long 
int)gid);
   }
 }
 
diff --git a/nslcd/nslcd.c b/nslcd/nslcd.c
index ea9e4e3..e7dbb65 100644
--- a/nslcd/nslcd.c
+++ b/nslcd/nslcd.c
@@ -356,8 +356,8 @@ static void handleconnection(int sock, MYLDAP_SESSION 
*session)
   if (getpeercred(sock, &uid, &gid, &pid))
     log_log(LOG_DEBUG, "connection from unknown client: %s", strerror(errno));
   else
-    log_log(LOG_DEBUG, "connection from pid=%d uid=%d gid=%d",
-            (int)pid, (int)uid, (int)gid);
+    log_log(LOG_DEBUG, "connection from pid=%lu uid=%lu gid=%lu",
+            (unsigned long int)pid, (unsigned long int)uid, (unsigned long 
int)gid);
   /* create a stream object */
   if ((fp = tio_fdopen(sock, READ_TIMEOUT, WRITE_TIMEOUT,
                        READBUFFER_MINSIZE, READBUFFER_MAXSIZE,
@@ -477,7 +477,7 @@ static void create_pidfile(const char *filename)
               filename, strerror(errno));
       exit(EXIT_FAILURE);
     }
-    mysnprintf(buffer, sizeof(buffer), "%d\n", (int)getpid());
+    mysnprintf(buffer, sizeof(buffer), "%lu\n", (unsigned long int)getpid());
     if (write(fd, buffer, strlen(buffer)) != (int)strlen(buffer))
     {
       log_log(LOG_ERR, "error writing pid file (%s): %s",
@@ -743,11 +743,11 @@ int main(int argc, char *argv[])
 #ifdef HAVE_INITGROUPS
     /* load supplementary groups */
     if (initgroups(nslcd_cfg->uidname, nslcd_cfg->gid) < 0)
-      log_log(LOG_WARNING, "cannot initgroups(\"%s\",%d) (ignored): %s",
-              nslcd_cfg->uidname, (int)nslcd_cfg->gid, strerror(errno));
+      log_log(LOG_WARNING, "cannot initgroups(\"%s\",%lu) (ignored): %s",
+              nslcd_cfg->uidname, (unsigned long int)nslcd_cfg->gid, 
strerror(errno));
     else
-      log_log(LOG_DEBUG, "initgroups(\"%s\",%d) done",
-              nslcd_cfg->uidname, (int)nslcd_cfg->gid);
+      log_log(LOG_DEBUG, "initgroups(\"%s\",%lu) done",
+              nslcd_cfg->uidname, (unsigned long int)nslcd_cfg->gid);
 #else /* not HAVE_INITGROUPS */
 #ifdef HAVE_SETGROUPS
     /* just drop all supplemental groups */
@@ -766,24 +766,24 @@ int main(int argc, char *argv[])
   {
     if (setgid(nslcd_cfg->gid) != 0)
     {
-      log_log(LOG_ERR, "cannot setgid(%d): %s",
-              (int)nslcd_cfg->gid, strerror(errno));
+      log_log(LOG_ERR, "cannot setgid(%lu): %s",
+              (unsigned long int)nslcd_cfg->gid, strerror(errno));
       daemonize_ready(EXIT_FAILURE, "cannot setgid()\n");
       exit(EXIT_FAILURE);
     }
-    log_log(LOG_DEBUG, "setgid(%d) done", (int)nslcd_cfg->gid);
+    log_log(LOG_DEBUG, "setgid(%ul) done", (unsigned long int)nslcd_cfg->gid);
   }
   /* change to nslcd uid */
   if (nslcd_cfg->uid != NOUID)
   {
     if (setuid(nslcd_cfg->uid) != 0)
     {
-      log_log(LOG_ERR, "cannot setuid(%d): %s",
-              (int)nslcd_cfg->uid, strerror(errno));
+      log_log(LOG_ERR, "cannot setuid(%ul): %s",
+              (unsigned long int)nslcd_cfg->uid, strerror(errno));
       daemonize_ready(EXIT_FAILURE, "cannot setuid()\n");
       exit(EXIT_FAILURE);
     }
-    log_log(LOG_DEBUG, "setuid(%d) done", (int)nslcd_cfg->uid);
+    log_log(LOG_DEBUG, "setuid(%ul) done", (unsigned long int)nslcd_cfg->uid);
   }
   /* block all these signals so our worker threads won't handle them */
   sigemptyset(&signalmask);
diff --git a/nslcd/passwd.c b/nslcd/passwd.c
index 198fd45..d5a143d 100644
--- a/nslcd/passwd.c
+++ b/nslcd/passwd.c
@@ -112,8 +112,8 @@ static int mkfilter_passwd_byuid(uid_t uid, char *buffer, 
size_t buflen)
   }
   else
   {
-    return mysnprintf(buffer, buflen, "(&%s(%s=%d))",
-                      passwd_filter, attmap_passwd_uidNumber, (int)uid);
+    return mysnprintf(buffer, buflen, "(&%s(%s=%lu))",
+                      passwd_filter, attmap_passwd_uidNumber, (unsigned long 
int)uid);
   }
 }
 

-----------------------------------------------------------------------

Summary of changes:
 nslcd/cfg.c    |    6 +++---
 nslcd/group.c  |    4 ++--
 nslcd/nslcd.c  |   26 +++++++++++++-------------
 nslcd/passwd.c |    4 ++--
 4 files changed, 20 insertions(+), 20 deletions(-)


hooks/post-receive
-- 
nss-pam-ldapd
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/