From owner-freebsd-ports@FreeBSD.ORG Tue Oct 21 23:37:11 2008 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E614D106566C for ; Tue, 21 Oct 2008 23:37:11 +0000 (UTC) (envelope-from mike@jellydonut.org) Received: from fk-out-0910.google.com (fk-out-0910.google.com [209.85.128.186]) by mx1.freebsd.org (Postfix) with ESMTP id 68F3C8FC16 for ; Tue, 21 Oct 2008 23:37:11 +0000 (UTC) (envelope-from mike@jellydonut.org) Received: by fk-out-0910.google.com with SMTP id k31so2997854fkk.11 for ; Tue, 21 Oct 2008 16:37:09 -0700 (PDT) Received: by 10.181.146.11 with SMTP id y11mr3109297bkn.5.1224632229697; Tue, 21 Oct 2008 16:37:09 -0700 (PDT) Received: by 10.181.17.8 with HTTP; Tue, 21 Oct 2008 16:37:09 -0700 (PDT) Message-ID: <1de79840810211637s65523c40if67a9fb385dc2651@mail.gmail.com> Date: Tue, 21 Oct 2008 19:37:09 -0400 From: "Michael Proto" To: "Alexey Shuvaev" In-Reply-To: <20081021093608.GA28266@wep4035.physik.uni-wuerzburg.de> MIME-Version: 1.0 References: <1de79840810141617y27fb7779xfd8f334f8b7ff2e1@mail.gmail.com> <20081021093608.GA28266@wep4035.physik.uni-wuerzburg.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: mbr@freebsd.org, freebsd-ports@freebsd.org Subject: Re: open-vm-tools fails on a recent sup to CURRENT X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2008 23:37:12 -0000 On Tue, Oct 21, 2008 at 5:36 AM, Alexey Shuvaev < shuvaev@physik.uni-wuerzburg.de> wrote: > On Tue, Oct 14, 2008 at 07:17:29PM -0400, Michael Proto wrote: > > Has anyone started seeing failures of ports/emulators/open-vm-tools > builds > > with a recent current? I csup-ed my source recently (as of 20080926), > > rebuilt world and my kernel, and open-vm-tools builds fail in the vmhgfs > > module with the following: > > > > > > ... > > cc1: warnings being treated as errors > > vfsops.c: In function 'HgfsVfsMount': > > vfsops.c:142: warning: implicit declaration of function 'suser' > > vfsops.c:142: warning: nested extern declaration of 'suser' > > *** Error code 1 > > ... > > > > I've tried setting CFLAGS optimizations to -Os (my default), -O, -O2 and > no > > optimizations and it fails with the same error every time. Has anyone > else > > using CURRENT in VMware seen this error recently? Any ideas? > > > This is due to API change suser() -> priv_check(). > Have a look at > http://www.freebsd.org/cgi/cvsweb.cgi/ports/x11/nvidia-driver/Makefile > (revision 1.81) for example. > I am not sure about "PRIV_DRIVER" argument, but you can try to replace > "suser(CURTHREAD)" to "priv_check(CURTHREAD, PRIV_DRIVER)" > in the open-vm-tools sources. > > Alexey. > Thanks for that bit of information! With the following patch I was able to get open-vm-tools to successfully compile: --- modules/freebsd/vmhgfs/vfsops.c.old 2008-07-01 18:31:11.000000000 -0400 +++ modules/freebsd/vmhgfs/vfsops.c 2008-10-21 16:50:23.000000000 -0400 @@ -139,7 +139,7 @@ * Since Hgfs requires the caller to be root, only allow mount attempts made * by the superuser. */ - if ((ret = suser(td)) != 0) { + if ((ret = priv_check(td, PRIV_DRIVER)) != 0) { return ret; } --- modules/freebsd/vmblock/vnops.c.old 2008-07-01 18:31:09.000000000 -0400 +++ modules/freebsd/vmblock/vnops.c 2008-10-21 19:32:27.000000000 -0400 @@ -723,7 +723,7 @@ * NB: Allowing only the superuser to open this directory breaks * readdir() of the filesystem root for non-privileged users. */ - if ((retval = suser(ap->a_td)) == 0) { + if ((retval = priv_check(ap->a_td, PRIV_DRIVER)) == 0) { #if __FreeBSD_version >= 700000 fp = ap->a_fp; #else I cannot say if makes these modules work or not, as I don't use them (my main reason for having open-vm-tools is for vmware-guestd and its ability to sync the VM's clock to the host), but the port compiles cleanly with this. Thanks very much! -Proto