aboutsummaryrefslogtreecommitdiff
path: root/nscd
diff options
context:
space:
mode:
Diffstat (limited to 'nscd')
-rw-r--r--nscd/grpcache.c9
-rw-r--r--nscd/hstcache.c8
-rw-r--r--nscd/nscd-client.h46
-rw-r--r--nscd/nscd_getgr_r.c8
-rw-r--r--nscd/nscd_gethst_r.c8
5 files changed, 40 insertions, 39 deletions
diff --git a/nscd/grpcache.c b/nscd/grpcache.c
index 983b297..b1634a1 100644
--- a/nscd/grpcache.c
+++ b/nscd/grpcache.c
@@ -23,6 +23,7 @@
#include <grp.h>
#include <stddef.h>
#include <stdio.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -117,7 +118,7 @@ cache_addgr (struct database *db, int fd, request_header *req, void *key,
size_t gr_name_len = strlen (grp->gr_name) + 1;
size_t gr_passwd_len = strlen (grp->gr_passwd) + 1;
size_t gr_mem_cnt = 0;
- size_t *gr_mem_len;
+ uint32_t *gr_mem_len;
size_t gr_mem_len_total = 0;
char *gr_name;
char *cp;
@@ -131,7 +132,7 @@ cache_addgr (struct database *db, int fd, request_header *req, void *key,
/* Determine the length of all members. */
while (grp->gr_mem[gr_mem_cnt])
++gr_mem_cnt;
- gr_mem_len = (size_t *) alloca (gr_mem_cnt * sizeof (size_t));
+ gr_mem_len = (uint32_t *) alloca (gr_mem_cnt * sizeof (uint32_t));
for (gr_mem_cnt = 0; grp->gr_mem[gr_mem_cnt]; ++gr_mem_cnt)
{
gr_mem_len[gr_mem_cnt] = strlen (grp->gr_mem[gr_mem_cnt]) + 1;
@@ -141,7 +142,7 @@ cache_addgr (struct database *db, int fd, request_header *req, void *key,
/* We allocate all data in one memory block: the iov vector,
the response header and the dataset itself. */
total = (sizeof (struct groupdata)
- + gr_mem_cnt * sizeof (size_t)
+ + gr_mem_cnt * sizeof (uint32_t)
+ gr_name_len + gr_passwd_len + gr_mem_len_total);
data = (struct groupdata *) malloc (total + n);
if (data == NULL)
@@ -157,7 +158,7 @@ cache_addgr (struct database *db, int fd, request_header *req, void *key,
cp = data->strdata;
/* This is the member string length array. */
- cp = mempcpy (cp, gr_mem_len, gr_mem_cnt * sizeof (size_t));
+ cp = mempcpy (cp, gr_mem_len, gr_mem_cnt * sizeof (uint32_t));
gr_name = cp;
cp = mempcpy (cp, grp->gr_name, gr_name_len);
cp = mempcpy (cp, grp->gr_passwd, gr_passwd_len);
diff --git a/nscd/hstcache.c b/nscd/hstcache.c
index 31afbdd..e8444d8 100644
--- a/nscd/hstcache.c
+++ b/nscd/hstcache.c
@@ -125,7 +125,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
struct hostdata *data;
size_t h_name_len = strlen (hst->h_name) + 1;
size_t h_aliases_cnt;
- size_t *h_aliases_len;
+ uint32_t *h_aliases_len;
size_t h_addr_list_cnt;
int addr_list_type;
char *addresses;
@@ -139,7 +139,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
for (cnt = 0; hst->h_aliases[cnt] != NULL; ++cnt)
++h_aliases_cnt;
/* Determine the length of all aliases. */
- h_aliases_len = alloca (h_aliases_cnt * sizeof (size_t));
+ h_aliases_len = (uint32_t *) alloca (h_aliases_cnt * sizeof (uint32_t));
total = 0;
for (cnt = 0; cnt < h_aliases_cnt; ++cnt)
{
@@ -156,7 +156,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
the response header and the dataset itself. */
total += (sizeof (struct hostdata)
+ h_name_len
- + h_aliases_cnt * sizeof (size_t)
+ + h_aliases_cnt * sizeof (uint32_t)
+ h_addr_list_cnt * hst->h_length);
data = (struct hostdata *) malloc (total + req->key_len);
@@ -175,7 +175,7 @@ cache_addhst (struct database *db, int fd, request_header *req, void *key,
cp = data->strdata;
cp = mempcpy (cp, hst->h_name, h_name_len);
- cp = mempcpy (cp, h_aliases_len, h_aliases_cnt * sizeof (size_t));
+ cp = mempcpy (cp, h_aliases_len, h_aliases_cnt * sizeof (uint32_t));
/* The normal addresses first. */
addresses = cp;
diff --git a/nscd/nscd-client.h b/nscd/nscd-client.h
index 33c4845..97b0baf 100644
--- a/nscd/nscd-client.h
+++ b/nscd/nscd-client.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (c) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@suse.de>, 1998.
@@ -24,7 +24,7 @@
#define _NSCD_CLIENT_H 1
/* Version number of the daemon interface */
-#define NSCD_VERSION 2
+#define NSCD_VERSION 3
/* Path of the file where the PID of the running system is stored. */
#define _PATH_NSCDPID "/var/run/nscd.pid"
@@ -60,7 +60,7 @@ typedef struct
{
int version; /* Version number of the daemon interface. */
request_type type; /* Service requested. */
- ssize_t key_len; /* Key length. */
+ int32_t key_len; /* Key length. */
} request_header;
@@ -68,15 +68,15 @@ typedef struct
sent also if the service is disabled or there is no record found. */
typedef struct
{
- int version;
- int found;
- ssize_t pw_name_len;
- ssize_t pw_passwd_len;
+ int32_t version;
+ int32_t found;
+ int32_t pw_name_len;
+ int32_t pw_passwd_len;
uid_t pw_uid;
gid_t pw_gid;
- ssize_t pw_gecos_len;
- ssize_t pw_dir_len;
- ssize_t pw_shell_len;
+ int32_t pw_gecos_len;
+ int32_t pw_dir_len;
+ int32_t pw_shell_len;
} pw_response_header;
@@ -84,12 +84,12 @@ typedef struct
sent also if the service is disabled or there is no record found. */
typedef struct
{
- int version;
- int found;
- ssize_t gr_name_len;
- ssize_t gr_passwd_len;
+ int32_t version;
+ int32_t found;
+ int32_t gr_name_len;
+ int32_t gr_passwd_len;
gid_t gr_gid;
- ssize_t gr_mem_cnt;
+ int32_t gr_mem_cnt;
} gr_response_header;
@@ -97,14 +97,14 @@ typedef struct
sent also if the service is disabled or there is no record found. */
typedef struct
{
- int version;
- int found;
- ssize_t h_name_len;
- ssize_t h_aliases_cnt;
- int h_addrtype;
- int h_length;
- ssize_t h_addr_list_cnt;
- int error;
+ int32_t version;
+ int32_t found;
+ int32_t h_name_len;
+ int32_t h_aliases_cnt;
+ int32_t h_addrtype;
+ int32_t h_length;
+ int32_t h_addr_list_cnt;
+ int32_t error;
} hst_response_header;
diff --git a/nscd/nscd_getgr_r.c b/nscd/nscd_getgr_r.c
index aa9c3fd..97f7f71 100644
--- a/nscd/nscd_getgr_r.c
+++ b/nscd/nscd_getgr_r.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Thorsten Kukuk <kukuk@uni-paderborn.de>, 1998.
@@ -137,7 +137,7 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
if (gr_resp.found == 1)
{
- size_t *len;
+ uint32_t *len;
char *p = buffer;
size_t total_len;
uintptr_t align;
@@ -172,9 +172,9 @@ nscd_getgr_r (const char *key, size_t keylen, request_type type,
resultbuf->gr_gid = gr_resp.gr_gid;
/* Allocate array to store lengths. */
- len = alloca (gr_resp.gr_mem_cnt * sizeof (size_t));
+ len = (uint32_t *) alloca (gr_resp.gr_mem_cnt * sizeof (uint32_t));
- total_len = gr_resp.gr_mem_cnt * sizeof (size_t);
+ total_len = gr_resp.gr_mem_cnt * sizeof (uint32_t);
vec[0].iov_base = len;
vec[0].iov_len = total_len;
vec[1].iov_base = resultbuf->gr_name;
diff --git a/nscd/nscd_gethst_r.c b/nscd/nscd_gethst_r.c
index cf6a569..13a1da8 100644
--- a/nscd/nscd_gethst_r.c
+++ b/nscd/nscd_gethst_r.c
@@ -165,7 +165,7 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
if (hst_resp.found == 1)
{
struct iovec vec[4];
- size_t *aliases_len;
+ uint32_t *aliases_len;
char *cp = buffer;
uintptr_t align1;
uintptr_t align2;
@@ -206,12 +206,12 @@ nscd_gethst_r (const char *key, size_t keylen, request_type type,
vec[0].iov_base = resultbuf->h_name;
vec[0].iov_len = hst_resp.h_name_len;
- aliases_len = alloca (hst_resp.h_aliases_cnt * sizeof (size_t));
+ aliases_len = alloca (hst_resp.h_aliases_cnt * sizeof (uint32_t));
vec[1].iov_base = aliases_len;
- vec[1].iov_len = hst_resp.h_aliases_cnt * sizeof (size_t);
+ vec[1].iov_len = hst_resp.h_aliases_cnt * sizeof (uint32_t);
total_len = (hst_resp.h_name_len
- + hst_resp.h_aliases_cnt * sizeof (size_t));
+ + hst_resp.h_aliases_cnt * sizeof (uint32_t));
n = 2;
if (type == GETHOSTBYADDR || type == GETHOSTBYNAME)