View | Details | Raw Unified | Return to bug 51628
Collapse All | Expand All

(-)ypmatch.c (-1 / +13 lines)
Lines 29-35 Link Here
29
29
30
#ifndef lint
30
#ifndef lint
31
static const char rcsid[] =
31
static const char rcsid[] =
32
  "$FreeBSD: src/usr.bin/ypmatch/ypmatch.c,v 1.7.2.2 2002/02/15 00:46:56 des Exp $";
32
  "$FreeBSD: src/usr.bin/ypmatch/ypmatch.c,v 1.7.2.X 2002/02/15 00:46:56 des Exp $";
33
#endif /* not lint */
33
#endif /* not lint */
34
34
35
#include <sys/param.h>
35
#include <sys/param.h>
Lines 117-122 Link Here
117
117
118
		r = yp_match(domainname, inmap, inkey,
118
		r = yp_match(domainname, inmap, inkey,
119
			strlen(inkey), &outbuf, &outbuflen);
119
			strlen(inkey), &outbuf, &outbuflen);
120
/*
121
	If we failed, try again including the terminating NULL in the key.
122
	Some NIS servers include the NULL, notably SunOS 4.X.
123
*/
124
		if (r != 0 && r != YPERR_YPBIND) {
125
			r = yp_match(domainname, inmap, inkey,
126
				strlen(inkey)+1, &outbuf, &outbuflen);
127
			if (r == 0 && outbuf[outbuflen-1] == '\0')  {
128
/* since we added a NULL, let's remove it from the result */
129
				--outbuflen;
130
			}
131
		}
120
		switch (r) {
132
		switch (r) {
121
		case 0:
133
		case 0:
122
			if (key)
134
			if (key)

Return to bug 51628