From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 21:34:35 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C93ED106564A for ; Wed, 13 Apr 2011 21:34:35 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 56CD28FC18 for ; Wed, 13 Apr 2011 21:34:35 +0000 (UTC) Received: by wwc33 with SMTP id 33so1175422wwc.31 for ; Wed, 13 Apr 2011 14:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oQW7Gh1i1VcmjZMgrNmklpZf+NBigAW9uu590sFEvqM=; b=Ojl9lW/TThQn2qtp3G00VzHdHEaF6palStAKunh3o6JS+S01uO4AHpRrYZzQm9sb/I N7WPSYLr4qiBr40+EQmmrcwzKpjqQc/840ojSF2kJCepMSusJwvcrIP70/Rth2jrWsxU CCioecea+DHoa2oi7g2TBMHRNriez3vkF6PnQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bf+QhHz855HhKjxiUOBtrkhf6kTq7fNy/DHlubLX1TzZDZ9hhiCR6lhudWKjKBghVx J8Hu2iTiK6+oWmcqmsoCifr8EKDh7TRC1YAqoMtvJzx6WbIy0lREAe3P43dMn+DGIcl0 NypCaEq1eJGE1Z4LPmEC0lhWnHVubr2LXRuN8= MIME-Version: 1.0 Received: by 10.216.136.91 with SMTP id v69mr5771688wei.16.1302730474287; Wed, 13 Apr 2011 14:34:34 -0700 (PDT) Received: by 10.216.123.15 with HTTP; Wed, 13 Apr 2011 14:34:34 -0700 (PDT) In-Reply-To: <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> Date: Wed, 13 Apr 2011 14:34:34 -0700 Message-ID: From: Matthew Fleming To: Jonathan Stuart Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: "freebsd-hackers@freebsd.org" Subject: Re: Getting vnode + credentials of a file from a struct mount and UFS inode # X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2011 21:34:35 -0000 On Wed, Apr 13, 2011 at 2:18 PM, Jonathan Stuart wro= te: > Hi Matthew, > > Thanks, I'll give it a shot.. for some reason f_cred off the vnode is ret= urning all zeros for uid/gid, and > pulling the VTOI does the same thing (using getvnode()).. do these not ge= t initialized properly? f_cred is a field in struct file, not struct vnode, so I'm confused as to what you're referring to. Cheers, matthew > -----Original Message----- > From: Matthew Fleming [mailto:mdf356@gmail.com] > Sent: Wednesday, April 13, 2011 1:48 PM > To: Jonathan Stuart > Cc: freebsd-hackers@freebsd.org > Subject: Re: Getting vnode + credentials of a file from a struct mount an= d UFS inode # > > On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart = wrote: >> Hi, >> >> I'd like to pull the owner/group ownership from a file (the information = I have about the file is it's UFS inode # and it's struct mount *). =A0I'm = sure there's got to be a function that would return a vnode and I could VTO= I() to get this information from the inode.. but I'm having a brainfreeze. >> > > VFS_VGET(mp, ino, flags, &vp) is probably what you want. > > Cheers, > matthew >