summary refs log tree commit diff
path: root/nis/nss_compat
diff options
context:
space:
mode:
Diffstat (limited to 'nis/nss_compat')
-rw-r--r--nis/nss_compat/compat-grp.c4
-rw-r--r--nis/nss_compat/compat-pwd.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/nis/nss_compat/compat-grp.c b/nis/nss_compat/compat-grp.c
index 961c3b9b4b..cd939eb9e1 100644
--- a/nis/nss_compat/compat-grp.c
+++ b/nis/nss_compat/compat-grp.c
@@ -764,7 +764,7 @@ getgrgid_plusgroup (gid_t gid, struct group *result, char *buffer,
       nis_result *res;
       char buf[24 + grptablelen];
 
-      sprintf(buf, "[gid=%d],%s", gid, grptable);
+      sprintf(buf, "[gid=%lu],%s", (unsigned long int) gid, grptable);
       res = nis_list(buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
       if (niserr2nss (res->status) != NSS_STATUS_SUCCESS)
         {
@@ -794,7 +794,7 @@ getgrgid_plusgroup (gid_t gid, struct group *result, char *buffer,
 	  return NSS_STATUS_NOTFOUND;
 	}
 
-      snprintf (buf, sizeof (buf), "%d", gid);
+      snprintf (buf, sizeof (buf), "%lu", (unsigned long int) gid);
 
       if (yp_match (domain, "group.bygid", buf, strlen (buf),
 		    &outval, &outvallen) != YPERR_SUCCESS)
diff --git a/nis/nss_compat/compat-pwd.c b/nis/nss_compat/compat-pwd.c
index 3579520944..2a55df2908 100644
--- a/nis/nss_compat/compat-pwd.c
+++ b/nis/nss_compat/compat-pwd.c
@@ -1353,8 +1353,9 @@ getpwuid_plususer (uid_t uid, struct passwd *result, char *buffer,
       nis_result *res;
       char buf[1024 + pwdtablelen];
 
-      snprintf(buf, sizeof (buf), "[uid=%d],%s", uid, pwdtable);
-      res = nis_list(buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
+      snprintf (buf, sizeof (buf), "[uid=%lu],%s", (unsigned long int) uid,
+                pwdtable);
+      res = nis_list (buf, FOLLOW_PATH | FOLLOW_LINKS, NULL, NULL);
       if (niserr2nss (res->status) != NSS_STATUS_SUCCESS)
         {
           enum nss_status status =  niserr2nss (res->status);
@@ -1383,7 +1384,7 @@ getpwuid_plususer (uid_t uid, struct passwd *result, char *buffer,
           return NSS_STATUS_NOTFOUND;
         }
 
-      sprintf (buf, "%d", uid);
+      sprintf (buf, "%lu", (unsigned long int) uid);
       if (yp_match (domain, "passwd.byuid", buf, strlen (buf),
                     &outval, &outvallen)
           != YPERR_SUCCESS)