From owner-freebsd-bugs Thu Oct 15 13:40:10 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id NAA26772 for freebsd-bugs-outgoing; Thu, 15 Oct 1998 13:40:10 -0700 (PDT) (envelope-from owner-freebsd-bugs@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 NAA26761 for ; Thu, 15 Oct 1998 13:40:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.8.8/8.8.5) id NAA20691; Thu, 15 Oct 1998 13:40:02 -0700 (PDT) Received: from eubie.lbl.gov (eubie.lbl.gov [131.243.2.36]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id NAA25834 for ; Thu, 15 Oct 1998 13:31:35 -0700 (PDT) (envelope-from jin@eubie.lbl.gov) Received: (from jin@localhost) by eubie.lbl.gov (8.9.1/8.9.1) id UAA25779; Thu, 15 Oct 1998 20:31:17 GMT (envelope-from jin) Message-Id: <199810152031.UAA25779@eubie.lbl.gov> Date: Thu, 15 Oct 1998 20:31:17 GMT From: Jin Guojun (FTG staff) Reply-To: jin@eubie.lbl.gov To: FreeBSD-gnats-submit@FreeBSD.ORG X-Send-Pr-Version: 3.2 Subject: bin/8338: ypserv fails to get master name for ypxfr Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 8338 >Category: bin >Synopsis: ypserv fails to get master name for ypxfr >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Oct 15 13:40:01 PDT 1998 >Last-Modified: >Originator: Jin Guojun (FTG staff) >Organization: >Release: FreeBSD 3.0-19981006-BETA i386 >Environment: All FreeBSD releases If use FreeBSD as YP slave server and Solaris as YP master server (not test other platform as master server yet) >Description: ypserv surpose to get master name 131.243.2.200 (rather than localhost name 131.243.2.36 as eubie itself) The problem seems to be in /usr/src/usr.sbin/ypserv/yp_serv.c marked "wrong name ??????" ypresp_master * ypproc_master_2_svc(ypreq_nokey *argp, struct svc_req *rqstp) { static ypresp_master result; static char ypvalbuf[YPMAXRECORD]; keydat key = { master_sz, master_string }; valdat val; result.peer = ""; #ifdef DB_CACHE if (yp_access(argp->map, argp->domain, (struct svc_req *)rqstp)) { #else if (yp_access(argp->map, (struct svc_req *)rqstp)) { #endif result.stat = YP_YPERR; return(&result); } if (argp->domain == NULL) { result.stat = YP_BADARGS; return (&result); } if (yp_select_map(argp->map, argp->domain, &key, 1) != YP_TRUE) { result.stat = yp_errno; return(&result); } /* * Note that we copy the data retrieved from the database to * a private buffer and NUL terminate the buffer rather than * terminating the data in place. We do this because by stuffing * a '\0' into data.data, we will actually be corrupting memory * allocated by the DB package. This is a bad thing now that we * cache DB handles rather than closing the database immediately. */ result.stat = yp_getbykey(&key, &val); /* wrong name ?????? */ if (result.stat == YP_TRUE) { bcopy((char *)val.valdat_val, (char *)&ypvalbuf, val.valdat_len); ypvalbuf[val.valdat_len] = '\0'; result.peer = (char *)&ypvalbuf; } else result.peer = ""; return (&result); } eubie# ypserv -d -n ypserv: procedure ypproc_xfr called from 131.243.2.200:755 ypserv: client is referencing map "passwd.byname". ypserv: procedure ypproc_xfr called from 131.243.2.200:755 ypserv: client is referencing map "passwd.byname". ypserv: looking up key [YP_MASTER_NAME] ypserv: result of lookup: key: [YP_MASTER_NAME] data: [eubie.lbl.gov] ypserv: procedure ypproc_master called from 131.243.2.36:761 ypserv: client is referencing map "passwd.byname". ypserv: looking up key [YP_MASTER_NAME] ypserv: result of lookup: key: [YP_MASTER_NAME] data: [eubie.lbl.gov] ypserv: procedure ypproc_order called from 131.243.2.36:758 ypserv: client is referencing map "passwd.byname". ypserv: looking up key [YP_LAST_MODIFIED] ypserv: result of lookup: key: [YP_LAST_MODIFIED] data: [908463640] ypserv: procedure ypproc_match called from 131.243.2.36:756 ypserv: client is referencing map "passwd.byname". ypserv: looking up key [YP_INTERDOMAIN] ypserv: procedure ypproc_match called from 131.243.2.36:754 ypserv: client is referencing map "passwd.byname". ypserv: looking up key [YP_SECURE] ypserv: procedure ypproc_xfr called from 131.243.2.12:761 ypserv: client is referencing map "passwd.byuid". ypserv: procedure ypproc_xfr called from 131.243.2.12:761 ypserv: client is referencing map "passwd.byuid". ypserv: looking up key [YP_MASTER_NAME] ypserv: result of lookup: key: [YP_MASTER_NAME] data: [eubie.lbl.gov] ypserv: procedure ypproc_master called from 131.243.2.36:749 ypserv: client is referencing map "passwd.byuid". ypserv: looking up key [YP_MASTER_NAME] ypserv: result of lookup: key: [YP_MASTER_NAME] data: [eubie.lbl.gov] ypserv: procedure ypproc_order called from 131.243.2.36:746 ypserv: client is referencing map "passwd.byuid". ypserv: looking up key [YP_LAST_MODIFIED] ypserv: result of lookup: key: [YP_LAST_MODIFIED] data: [908463640] ypserv: procedure ypproc_match called from 131.243.2.36:744 ypserv: client is referencing map "passwd.byuid". ypserv: looking up key [YP_INTERDOMAIN] ypserv: procedure ypproc_match called from 131.243.2.36:742 ypserv: client is referencing map "passwd.byuid". ypserv: looking up key [YP_SECURE] >How-To-Repeat: Just configure a FreeBSD host as YP slave server and use any other platform (Maybe FreeBSD too) as a master YP server. Try to yppush from master to slave (in master side, cd /var/yp enable YPPUSH, and make). >Fix: Not clear what is the correct fixing. I am currently write a wrapper for ypxfr to get a correct master name just for a temp solution. >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message