From owner-svn-src-head@freebsd.org Fri Mar 4 02:14:34 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5252BA9461A; Fri, 4 Mar 2016 02:14:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 215BC1F9; Fri, 4 Mar 2016 02:14:34 +0000 (UTC) (envelope-from araujo@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u242EXjt075304; Fri, 4 Mar 2016 02:14:33 GMT (envelope-from araujo@FreeBSD.org) Received: (from araujo@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u242EXwu075303; Fri, 4 Mar 2016 02:14:33 GMT (envelope-from araujo@FreeBSD.org) Message-Id: <201603040214.u242EXwu075303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: araujo set sender to araujo@FreeBSD.org using -f From: Marcelo Araujo Date: Fri, 4 Mar 2016 02:14:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r296376 - head/usr.sbin/ypldap X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Mar 2016 02:14:34 -0000 Author: araujo Date: Fri Mar 4 02:14:32 2016 New Revision: 296376 URL: https://svnweb.freebsd.org/changeset/base/296376 Log: Implement the 'master' request. Obtained from: OpenBSD (r1.15) Modified: head/usr.sbin/ypldap/yp.c Modified: head/usr.sbin/ypldap/yp.c ============================================================================== --- head/usr.sbin/ypldap/yp.c Fri Mar 4 01:31:13 2016 (r296375) +++ head/usr.sbin/ypldap/yp.c Fri Mar 4 02:14:32 2016 (r296376) @@ -222,6 +222,8 @@ yp_dispatch(struct svc_req *req, SVCXPRT break; case YPPROC_MASTER: log_debug("ypproc_master"); + xdr_argument = (xdrproc_t) xdr_ypreq_nokey; + xdr_result = (xdrproc_t) xdr_ypresp_master; if (yp_check(req) == -1) return; cb = (void *)ypproc_master_2_svc; @@ -559,11 +561,18 @@ ypresp_master * ypproc_master_2_svc(ypreq_nokey *arg, struct svc_req *req) { static struct ypresp_master res; + static char master[YPMAXPEER + 1]; + bzero(&res, sizeof(res)); if (yp_valid_domain(arg->domain, (struct ypresp_val *)&res) == -1) return (&res); + + if (gethostname(master, sizeof(master)) == 0) { + res.peer = (peername)master; + res.stat = YP_TRUE; + } else + res.stat = YP_NOKEY; - res.stat = YP_YPERR; return (&res); }