diff options
author | 1997-04-12 16:53:06 +0000 | |
---|---|---|
committer | 1997-04-12 16:53:06 +0000 | |
commit | 8a72a498fc1a5d9a519d414a57dbcd5e9aacca21 (patch) | |
tree | 9b19c16da01e5c0388d91cc7aebae904e816d1e8 | |
parent | bit more careful with mapnames; adam@math.tau.ac.il (diff) | |
download | wireguard-openbsd-8a72a498fc1a5d9a519d414a57dbcd5e9aacca21.tar.xz wireguard-openbsd-8a72a498fc1a5d9a519d414a57dbcd5e9aacca21.zip |
careful about bad domain/mapnames
-rw-r--r-- | usr.sbin/ypserv/ypserv/ypserv_db.c | 13 |
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. */ |