This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] fix wrong comparison in yp_order


Jeff Moyer wrote:
yp_order always returns 0 for the map order.  The reason is pretty
simple:

Jeff,


Could you file a bug for this in the bugzilla, and attach a patch with a ChangeLog? A description of how you tested this would also be great e.g. Setup NIS server etc etc.

int
yp_order (const char *indomain, const char *inmap, unsigned int *outorder)
{
...
  result = do_ypcall_tr (indomain, YPPROC_ORDER, (xdrproc_t) xdr_ypreq_nokey,
			 (caddr_t) &req, (xdrproc_t) xdr_ypresp_order,
			 (caddr_t) &resp);

  if (result == YPERR_SUCCESS)  <=============
    return result;

  *outorder = resp.ordernum;
  xdr_free ((xdrproc_t) xdr_ypresp_order, (char *) &resp);

  return result;
}

That check should actually be !=.  The attached patch addresses this.
Note: I have a build running currently, but have not yet tested it.

I agree that that looks incorrect.


Cheers,
Carlos.
--
Carlos O'Donell
CodeSourcery
carlos@codesourcery.com
(650) 331-3385 x716


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]