Date: Thu, 15 Oct 1998 20:31:17 GMT From: Jin Guojun (FTG staff) <jin@eubie.lbl.gov> To: FreeBSD-gnats-submit@FreeBSD.ORG Subject: bin/8338: ypserv fails to get master name for ypxfr Message-ID: <199810152031.UAA25779@eubie.lbl.gov>
next in thread | raw e-mail | index | archive | help
>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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199810152031.UAA25779>