From owner-freebsd-current@FreeBSD.ORG Mon Sep 3 06:49:12 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4183F106567E for ; Mon, 3 Sep 2012 06:49:12 +0000 (UTC) (envelope-from bsam@passap.ru) Received: from forward12.mail.yandex.net (forward12.mail.yandex.net [IPv6:2a02:6b8:0:801::2]) by mx1.freebsd.org (Postfix) with ESMTP id 4CE5A8FC15 for ; Mon, 3 Sep 2012 06:49:11 +0000 (UTC) Received: from smtp14.mail.yandex.net (smtp14.mail.yandex.net [95.108.131.192]) by forward12.mail.yandex.net (Yandex) with ESMTP id D0E56C21D91 for ; Mon, 3 Sep 2012 10:49:09 +0400 (MSK) Received: from smtp14.mail.yandex.net (localhost [127.0.0.1]) by smtp14.mail.yandex.net (Yandex) with ESMTP id BAA7D1B60740 for ; Mon, 3 Sep 2012 10:49:09 +0400 (MSK) Received: from 87.249.28.58.tel.ru (87.249.28.58.tel.ru [87.249.28.58]) by smtp14.mail.yandex.net (nwsmtp/Yandex) with ESMTP id n9ZGLxr5-n9ZGADFW; Mon, 3 Sep 2012 10:49:09 +0400 Message-ID: <504452E5.5040508@passap.ru> Date: Mon, 03 Sep 2012 10:49:09 +0400 From: =?UTF-8?B?0JHQvtGA0LjRgSDQodCw0LzQvtGA0L7QtNC+0LI=?= User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:14.0) Gecko/20120728 Thunderbird/14.0 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <50407056.3000606@passap.ru> <50407912.60809@passap.ru> <20120901144213.GF3324@home.opsec.eu> In-Reply-To: <20120901144213.GF3324@home.opsec.eu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: rpcbind does not honor -h flag X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Sep 2012 06:49:12 -0000 01.09.2012 18:42, Kurt Jaeger пишет: > Hi! > >>>>>> Please file a PR against rc ASAP. > >>>> http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/117711 > >> Looks like Matteo Riondato had created a patch for the problem in 2008: >> >> http://people.freebsd.org/~matteo/diff/117711rpcbind.diff >> >> but he never received any feedback from Carlos Eduardo Monti to see if >> the patch fixed the problem. > >> I don't know if the patch will apply to the current FreeBSD rpcbind >> code, give it a try and submit a follow up to the PR. > > In the current form the patch fails in rpcbind.c on 9.1-RC1. > > There are two problems with the current rpcbind.c. > > 1) It seems to be that even if some -h is given, the > rpcbind code uses some SUN-RPC trickery around the /etc/netconfig > file to open sockets for localhost in v4 and v6. > > Is it required to bind to localhost according to the RPC spec ? > > 2) And it opens some dynamic ports for other uses -- anybody has an > idea why this is necessary ? Is there an requirement for this in the spec ? > > Below is an example of both issues. > > root rpcbind 2134 4 udp6 *:* *:* > root rpcbind 2134 5 stream /var/run/rpcbind.sock > root rpcbind 2134 6 udp6 *:111 *:* > root rpcbind 2134 7 udp6 *:924 *:* > root rpcbind 2134 8 tcp6 *:111 *:* > root rpcbind 2134 9 udp4 *:111 *:* > root rpcbind 2134 10 udp4 *:645 *:* > root rpcbind 2134 11 tcp4 *:111 *:* > > Here's rpcbind started with -h : > > root rpcbind 2195 4 udp6 *:* *:* > root rpcbind 2195 5 stream /var/run/rpcbind.sock > root rpcbind 2195 6 udp6 ::1:111 *:* > root rpcbind 2195 7 udp6 *:1013 *:* > root rpcbind 2195 8 tcp6 ::1:111 *:* > root rpcbind 2195 9 udp4 127.0.0.1:111 *:* > root rpcbind 2195 10 udp4 :111 *:* > root rpcbind 2195 11 udp4 *:634 *:* > root rpcbind 2195 12 tcp4 127.0.0.1:111 *:* > root rpcbind 2195 13 tcp4 :111 *:* > > One can see two dynamic udp ports opened (one v4, one v6). > > I might be naive, but from what I understand, it should not open > that many sockets, but only like this: > > root rpcbind 2195 10 udp4 :111 *:* > root rpcbind 2195 13 tcp4 :111 *:* > > If this naive 'spec' is correct, would a patch to do just this and > nothing more be OK ? Patches are always welcome. But please read RPCBIND(8) first. Thanks for your time! -- WBR, Boris Samorodov (bsam) FreeBSD Committer, http://www.FreeBSD.org The Power To Serve