From owner-freebsd-hackers Mon Apr 21 19:48:11 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id TAA07502 for hackers-outgoing; Mon, 21 Apr 1997 19:48:11 -0700 (PDT) Received: from skynet.ctr.columbia.edu (skynet.ctr.columbia.edu [128.59.64.70]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id TAA07493 for ; Mon, 21 Apr 1997 19:48:03 -0700 (PDT) Received: (from wpaul@localhost) by skynet.ctr.columbia.edu (8.6.12/8.6.9) id WAA27667; Mon, 21 Apr 1997 22:47:50 -0400 From: Bill Paul Message-Id: <199704220247.WAA27667@skynet.ctr.columbia.edu> Subject: Re: NIS bug? To: yves@CC.McGill.CA Date: Mon, 21 Apr 1997 22:47:47 -0400 (EDT) Cc: hackers@freebsd.org In-Reply-To: <199704211831.OAA10693@maelstrom.cc.mcgill.ca> from "Yves Lepage" at Apr 21, 97 02:31:26 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Of all the gin joints in all the towns in all the world, Yves Lepage had to walk into mine and say: > > Hi all, > > khamsin# ypcat passwd.byname | wc -l > 33680 > khamsin# yp_mkdb -u mydomain/passwd.byname | wc -l > 34472 > > Is it possible that there are remaining bug in ypcat (namely yp_getnext)? > > Thanks, > Yves There is no such function as yp_getnext. I can't duplicate this behavior on my home box so it's up to you to provide more details. (Note that my sample passwd maps have about 31,000 entries, so I don't think it's a problem with the databases overflowing (Berkeley DB is supposed to be able to handle much more than 32K entries.) There's always a slight discrepancy in the totals due to the extra YP_* keys that yp_mkdb adds to the maps (i.e. YP_MASTER_NAME, YP_DOMAIN_NAME, etc...); you can request these entries specifically with yp_match(), but yp_first(), yp_next() and yp_all() will skip over them (ypcat(1) uses yp_all()). But it's usually no more than a difference of 4 or 5 lines. What I would suggest you do is: # ypcat passwd.byname > file1 # yp_mkdb -u /var/yp/yourdomain/passwd.byname > file2 # diff -c file1 file2 Then see if you can spot some pattern in the diff that would explain the discrepancy. Also check the passwd.byuid map for the same problem. It would also help if you mentioned what version of FreeBSD this is (server and client). My guess is that this is 2.1.x; I would be very surprised (not to mention disappointed) if this was happening with the ypserv from 2.2.x. -Bill -- ============================================================================= -Bill Paul (212) 854-6020 | System Manager, Master of Unix-Fu Work: wpaul@ctr.columbia.edu | Center for Telecommunications Research Home: wpaul@skynet.ctr.columbia.edu | Columbia University, New York City ============================================================================= "It is not I who am crazy; it is I who am mad!" - Ren Hoek, "Space Madness" =============================================================================