Bug-Debian: http://bugs.debian.org/622230
--- a/nscd.c
+++ b/nscd.c
-@@ -2437,7 +2437,7 @@
+@@ -2442,7 +2442,7 @@
if (!arg) { /* shutdown */
xfull_write(sock, &ureq, sizeof(ureq));
+ fprintf(stderr,"sent shutdown request, exiting\n");
} else { /* invalidate */
size_t arg_len = strlen(arg) + 1;
- struct {
-@@ -2449,7 +2449,9 @@
- reqdata.req.key_len = arg_len;
- memcpy(reqdata.arg, arg, arg_len);
- xfull_write(sock, &reqdata, arg_len + sizeof(ureq));
+ char buf[sizeof(user_req_header) + arg_len];
+@@ -2453,7 +2453,9 @@
+ req->key_len = arg_len;
+ memcpy(req + 1, arg, arg_len);
+ xfull_write(sock, req, sizeof(*req) + arg_len);
- printf("sent invalidate(%s) request, exiting\n", arg);
+ if (debug) {
+ fprintf(stderr,"sent invalidate(%s) request, exiting\n", arg);
--- a/nscd.c
+++ b/nscd.c
-@@ -2518,6 +2518,9 @@
+@@ -2522,6 +2522,9 @@
conffile = optarg;
break;
case 'i':
nscd.c | 4 ++++
1 file changed, 4 insertions(+)
-diff --git a/nscd.c b/nscd.c
-index 828eb17..4cbd7b1 100644
--- a/nscd.c
+++ b/nscd.c
-@@ -99,6 +99,8 @@ vda.linux@googlemail.com
+@@ -99,6 +99,8 @@
/* For inet_ntoa (for debug build only) */
#include <arpa/inet.h>
/*
* 0.21 add SEGV reporting to worker
* 0.22 don't do freeaddrinfo() in GETAI worker, it's crashy
-@@ -2661,6 +2663,8 @@ int main(int argc, char **argv)
+@@ -2663,6 +2665,8 @@
config.nttl[n] *= 1000;
}
Bug-Debian: http://bugs.debian.org/676689
--- a/nscd.c
+++ b/nscd.c
-@@ -439,7 +439,8 @@
+@@ -443,7 +443,8 @@
char *p;
unsigned long l = strtoul(str, &p, 10);
/* must not overflow int even after x1000 */
return l;
}
error_and_die("malformed or too big number '%s'", str);
-@@ -511,8 +512,8 @@
+@@ -515,8 +516,8 @@
const char *user;
smallint srv_enable[3];
smallint check_files[3];
unsigned size[3];
} config = {
/* We try to closely mimic glibc nscd */
-@@ -747,11 +748,11 @@
+@@ -751,11 +752,11 @@
return sizeof(user_req_header) + ureq->key_len;
}
}
static void set_cache_timestamp(user_req *ureq)
-@@ -1276,9 +1277,9 @@
+@@ -1280,9 +1281,9 @@
}
unsigned oldest_idx = 0;
if (age > oldest_age) {
oldest_age = age;
oldest_idx = i;
-@@ -1295,7 +1296,7 @@
+@@ -1299,7 +1300,7 @@
return NULL;
}
i = oldest_idx;
free_refcounted_ureq(&cacheline[i]);
ret:
-@@ -1322,11 +1323,11 @@
+@@ -1326,11 +1327,11 @@
cached_cnt--;
free_refcounted_ureq(cp);
} else {
cached_cnt--;
free_refcounted_ureq(cp);
} else if (srv == -1) {
-@@ -2646,7 +2647,7 @@
+@@ -2650,7 +2651,7 @@
}
for (n = 0; n < 3; n++) {