summaryrefslogtreecommitdiff
path: root/usr.sbin/ypserv
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-12 16:53:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-12 16:53:07 +0000
commitf4926098e93159b048942a79d88bcde3ea111391 (patch)
tree368ed54b20781e7cdd9d449a6b64c3c86f0a1630 /usr.sbin/ypserv
parentbda0bb33edd7994102daa6f2e8fd1a8ec982ef1e (diff)
careful about bad domain/mapnames
Diffstat (limited to 'usr.sbin/ypserv')
-rw-r--r--usr.sbin/ypserv/ypserv/ypserv_db.c13
1 files 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 <moj@stacken.kth.se>
@@ -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.
*/