summaryrefslogtreecommitdiffstats
path: root/usr.sbin/yp_mkdb
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>1997-02-09 19:34:53 +0000
committerwpaul <wpaul@FreeBSD.org>1997-02-09 19:34:53 +0000
commit02eec2322c7227ac106a04c07e951822be106301 (patch)
tree95bb6b87fdfe652436eaf61d07f12f00af4accbc /usr.sbin/yp_mkdb
parent8f656b769ac8e8a1df21eaa548ac6fb883bbd878 (diff)
downloadFreeBSD-src-02eec2322c7227ac106a04c07e951822be106301.zip
FreeBSD-src-02eec2322c7227ac106a04c07e951822be106301.tar.gz
Check for, warn about and reject lines with empty keys. You can't have
a database entry with a null key. These are often caused by spurious blank lines in the map source file.
Diffstat (limited to 'usr.sbin/yp_mkdb')
-rw-r--r--usr.sbin/yp_mkdb/yp_mkdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/yp_mkdb/yp_mkdb.c b/usr.sbin/yp_mkdb/yp_mkdb.c
index 8d8eb89..f5164ea 100644
--- a/usr.sbin/yp_mkdb/yp_mkdb.c
+++ b/usr.sbin/yp_mkdb/yp_mkdb.c
@@ -293,6 +293,11 @@ main (argc, argv)
continue;
}
+ if (!strlen(keybuf)) {
+ warnx("no key -- check source file for blank lines");
+ continue;
+ }
+
if (strlen(datbuf) > YPMAXRECORD) {
warnx("data too long: %s", datbuf);
continue;
OpenPOWER on IntegriCloud