From owner-cvs-all Wed Feb 11 11:15:38 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id LAA26345 for cvs-all-outgoing; Wed, 11 Feb 1998 11:15:38 -0800 (PST) (envelope-from owner-cvs-all@FreeBSD.ORG) Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id LAA26336; Wed, 11 Feb 1998 11:15:36 -0800 (PST) (envelope-from wpaul@FreeBSD.org) From: Bill Paul Received: (from wpaul@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id LAA24357; Wed, 11 Feb 1998 11:15:33 -0800 (PST) Date: Wed, 11 Feb 1998 11:15:33 -0800 (PST) Message-Id: <199802111915.LAA24357@freefall.freebsd.org> To: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG, cvs-usrsbin@FreeBSD.ORG Subject: cvs commit: src/usr.sbin/ypserv Makefile yp_dblookup.c yp_main.c yp_server.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk wpaul 1998/02/11 11:15:33 PST Modified files: usr.sbin/ypserv Makefile yp_dblookup.c yp_main.c yp_server.c Log: Fix a bug in the database handle caching. This has to do with the way the underlying database code works. When dealing with first/next queries, you have the notion of a database 'cursor,' which is essentially a file pointer for the database. To select the first entry, you do a fetch with the R_FIRST flag set, then you can use the R_NEXT flag to enumerate the other entries in the database. Unfortunately, doing a direct fetch with no flag does _not_ set the 'cursor,' so you can't do a direct fetch and then enumerate the table from there. The bug is that cached handles generated as the result of a YPPROC_MATCH were being treated as though they were the same as handles generated by a YPPROC_FIRST, which is not the case. The manifestation is that if you do a 'ypmatch first-key-in-map map' followed by a yp_first()/yp_next() pair, the yp_first() and yp_next() both return the first key in the table, which makes the entry appear to be duplicated. A couple smaller things since I'm here: - yp_main.c and yp_error.c both have a global 'int debug' in them. For some reason, our cc/ld doesn't flag this as a multiply defined symbol even though it should. Removed the declaration from yp_main.c; we want the one in yp_error.c. - The Makefile wasn't installing ypinit in the right place. Revision Changes Path 1.13 +2 -2 src/usr.sbin/ypserv/Makefile 1.15 +9 -5 src/usr.sbin/ypserv/yp_dblookup.c 1.17 +2 -2 src/usr.sbin/ypserv/yp_main.c 1.26 +3 -3 src/usr.sbin/ypserv/yp_server.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message