From f4926098e93159b048942a79d88bcde3ea111391 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 12 Apr 1997 16:53:07 +0000 Subject: careful about bad domain/mapnames --- usr.sbin/ypserv/ypserv/ypserv_db.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'usr.sbin/ypserv') 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. */ -- cgit v1.2.3