Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Feb 1998 11:15:33 -0800 (PST)
From:      Bill Paul <wpaul@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
Message-ID:  <199802111915.LAA24357@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199802111915.LAA24357>