Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-6]: src/usr.sbin/ypserv/ypserv Pull up following revision(s) (req...
details: https://anonhg.NetBSD.org/src/rev/e875fda4f7a6
branches: netbsd-6
changeset: 777320:e875fda4f7a6
user: snj <snj%NetBSD.org@localhost>
date: Tue Apr 10 17:44:18 2018 +0000
description:
Pull up following revision(s) (requested by christos in ticket #1528):
usr.sbin/ypserv/ypserv/ypserv_proc.c: 1.18 via patch
PR/47615: Dr. W. Stukenbrock: Always zero out the result structs in the
svc procs to avoid returning stale request data to the client.
diffstat:
usr.sbin/ypserv/ypserv/ypserv_proc.c | 38 +++++++++++++++++++++--------------
1 files changed, 23 insertions(+), 15 deletions(-)
diffs (108 lines):
diff -r f29bba5a9bde -r e875fda4f7a6 usr.sbin/ypserv/ypserv/ypserv_proc.c
--- a/usr.sbin/ypserv/ypserv/ypserv_proc.c Tue Apr 10 11:28:34 2018 +0000
+++ b/usr.sbin/ypserv/ypserv/ypserv_proc.c Tue Apr 10 17:44:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $ */
+/* $NetBSD: ypserv_proc.c,v 1.16.4.1 2018/04/10 17:44:18 snj Exp $ */
/*
* Copyright (c) 1994 Mats O Jansson <moj%stacken.kth.se@localhost>
@@ -28,7 +28,7 @@
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: ypserv_proc.c,v 1.16 2011/08/30 17:06:22 plunky Exp $");
+__RCSID("$NetBSD: ypserv_proc.c,v 1.16.4.1 2018/04/10 17:44:18 snj Exp $");
#endif
#include <sys/stat.h>
@@ -163,10 +163,11 @@
"key %.*s", clientstr, TORF(secure), k->domain, k->map,
k->keydat.dsize, k->keydat.dptr));
- if (secure && securecheck(caller))
+ if (secure && securecheck(caller)) {
+ memset(&res, 0, sizeof(res));
res.status = YP_YPERR;
- else
- res = ypdb_get_record(k->domain, k->map, k->keydat, FALSE);
+ } else
+ res = ypdb_get_record(k->domain, k->map, k->keydat, secure);
return ((void *)&res);
}
@@ -190,9 +191,10 @@
"first_2: request from %.500s, secure %s, domain %s, map %s",
clientstr, TORF(secure), k->domain, k->map));
- if (secure && securecheck(caller))
+ if (secure && securecheck(caller)) {
+ memset(&res, 0, sizeof(res));
res.status = YP_YPERR;
- else
+ } else
res = ypdb_get_first(k->domain, k->map, FALSE);
return ((void *)&res);
@@ -218,9 +220,10 @@
"key %.*s", clientstr, TORF(secure), k->domain, k->map,
k->keydat.dsize, k->keydat.dptr));
- if (secure && securecheck(caller))
+ if (secure && securecheck(caller)) {
+ memset(&res, 0, sizeof(res));
res.status = YP_YPERR;
- else
+ } else
res = ypdb_get_next(k->domain, k->map, k->keydat, FALSE);
return ((void *)&res);
@@ -326,6 +329,7 @@
(void)memset(&res, 0, sizeof(res));
if (secure && securecheck(caller)) {
+ memset(&res, 0, sizeof(res));
res.ypresp_all_u.val.status = YP_YPERR;
return (&res);
}
@@ -368,9 +372,10 @@
"master_2: request from %.500s, secure %s, domain %s, map %s",
clientstr, TORF(secure), k->domain, k->map));
- if (secure && securecheck(caller))
+ if (secure && securecheck(caller)) {
+ memset(&res, 0, sizeof(res));
res.status = YP_YPERR;
- else
+ } else
res = ypdb_get_master(k->domain, k->map);
/*
@@ -409,12 +414,15 @@
"order_2: request from %.500s, secure %s, domain %s, map %s",
clientstr, TORF(secure), k->domain, k->map));
- if (secure && securecheck(caller))
+ if (secure && securecheck(caller)) {
+ memset(&res, 0, sizeof(res));
res.status = YP_YPERR;
- else if (_yp_invalid_map(k->map))
+ } else if (_yp_invalid_map(k->map)) {
+ memset(&res, 0, sizeof(res));
res.status = YP_NOMAP;
- else
+ } else {
res = ypdb_get_order(k->domain, k->map);
+ }
return ((void *)&res);
}
@@ -446,7 +454,7 @@
(void)snprintf(domain_path, sizeof(domain_path), "%s/%s", YP_DB_PATH,
domain);
- res.list = NULL;
+ memset(&res, 0, sizeof(res));
status = YP_TRUE;
if ((stat(domain_path, &finfo) != 0) || !S_ISDIR(finfo.st_mode)) {
Home |
Main Index |
Thread Index |
Old Index