From 36b2e7c2388ed9f58ab81721138f81c5ceacc28e Mon Sep 17 00:00:00 2001 From: Bill Paul Date: Wed, 11 Oct 1995 14:30:51 +0000 Subject: [PATCH] A one-liner: We already check for (and reject entries with) '+' or '-' as the first character of the key side of the key/data pair; we should check the data side too. (Letting spurious +/- entries into the NIS maps is bad karma.) --- gnu/usr.sbin/yp_mkdb/yp_mkdb.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/usr.sbin/yp_mkdb/yp_mkdb.c b/gnu/usr.sbin/yp_mkdb/yp_mkdb.c index bf648a07836b..932f32340893 100644 --- a/gnu/usr.sbin/yp_mkdb/yp_mkdb.c +++ b/gnu/usr.sbin/yp_mkdb/yp_mkdb.c @@ -20,7 +20,7 @@ */ /* - * $Id: yp_mkdb.c,v 1.2 1995/03/31 19:45:13 wpaul Exp $ + * $Id: yp_mkdb.c,v 1.3 1995/05/30 05:05:26 rgrimes Exp $ */ #define BUFFERSIZE 4096 @@ -169,6 +169,8 @@ load( char *FileName, char *DbName) for (; Buffer[r]; r++) if (Buffer[r]!=' ' && Buffer[r]!='\t') break; + if (Buffer[r] == '+' || Buffer[r] == '-') break; + key.data=Buffer; key.size=strlen(Buffer); data.data=Buffer+r; data.size=strlen(Buffer+r); (dp->put)(dp,&key,&data,0);