From 8a72a498fc1a5d9a519d414a57dbcd5e9aacca21 Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 12 Apr 1997 16:53:06 +0000 Subject: [PATCH] careful about bad domain/mapnames --- usr.sbin/ypserv/ypserv/ypserv_db.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/usr.sbin/ypserv/ypserv/ypserv_db.c b/usr.sbin/ypserv/ypserv/ypserv_db.c index 66700cf82c8..562d4b4a2e9 100644 --- a/usr.sbin/ypserv/ypserv/ypserv_db.c +++ b/usr.sbin/ypserv/ypserv/ypserv_db.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ypserv_db.c,v 1.10 1997/03/11 09:12:25 maja Exp $ */ +/* $OpenBSD: ypserv_db.c,v 1.11 1997/04/12 16:53:06 deraadt Exp $ */ /* * Copyright (c) 1994 Mats O Jansson @@ -34,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.10 1997/03/11 09:12:25 maja Exp $"; +static char rcsid[] = "$OpenBSD: ypserv_db.c,v 1.11 1997/04/12 16:53:06 deraadt Exp $"; #endif /* @@ -274,6 +274,15 @@ ypdb_open_db(domain, map, status, map_info) else close(fd); + if (strchr(domain, '/')) { + *status = YP_NODOM; + return (NULL); + } + if (strchr(domain, '/')) { + *status = YP_NOMAP; + return (NULL); + } + /* * check for domain, file. */ -- 2.20.1