From owner-freebsd-hackers@FreeBSD.ORG Wed Apr 13 21:33:51 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 6C44D106564A for ; Wed, 13 Apr 2011 21:33:51 +0000 (UTC) (envelope-from jstuart@adaranet.com) Received: from barracuda.adaranet.com (smtp.adaranet.com [72.5.229.2]) by mx1.freebsd.org (Postfix) with ESMTP id 4D9298FC0C for ; Wed, 13 Apr 2011 21:33:51 +0000 (UTC) X-ASG-Debug-ID: 1302729464-522b08790001-P5m3U7 Received: from SJ-EXCH-1.adaranet.com ([10.10.1.29]) by barracuda.adaranet.com with ESMTP id H4sIx6t2P8IGiyEr; Wed, 13 Apr 2011 14:17:44 -0700 (PDT) X-Barracuda-Envelope-From: jstuart@adaranet.com Received: from SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523]) by SJ-EXCH-1.adaranet.com ([fe80::7042:d8c2:5973:c523%14]) with mapi; Wed, 13 Apr 2011 14:17:44 -0700 From: Jonathan Stuart X-Barracuda-BBL-IP: fe80::7042:d8c2:5973:c523 X-Barracuda-RBL-IP: fe80::7042:d8c2:5973:c523 To: Matthew Fleming Date: Wed, 13 Apr 2011 14:18:03 -0700 X-ASG-Orig-Subj: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Topic: Getting vnode + credentials of a file from a struct mount and UFS inode # Thread-Index: Acv6HBFnUn38yypBQAiS9lnN9vc15wAA/xsw Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Barracuda-Connect: UNKNOWN[10.10.1.29] X-Barracuda-Start-Time: 1302729464 X-Barracuda-URL: http://172.16.10.203:8000/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at adaranet.com X-Mailman-Approved-At: Wed, 13 Apr 2011 23:07:08 +0000 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:33:51 -0000 Hi Matthew, Thanks, I'll give it a shot.. for some reason f_cred off the vnode is retur= ning all zeros for uid/gid, and pulling the VTOI does the same thing (using getvnode()).. do these not get = initialized properly? Ciao, Jonathan -----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 and = UFS inode # On Wed, Apr 13, 2011 at 12:31 PM, Jonathan Stuart wr= ote: > 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 *). I'm sur= e there's got to be a function that would return a vnode and I could VTOI()= 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