Date: Wed, 13 Apr 2011 14:37:54 -0700 From: Jonathan Stuart <jstuart@adaranet.com> To: Matthew Fleming <mdf356@gmail.com> Cc: "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org> Subject: RE: Getting vnode + credentials of a file from a struct mount and UFS inode # Message-ID: <32AB5C9615CC494997D9ABB1DB12783C024E929FDC@SJ-EXCH-1.adaranet.com> In-Reply-To: <BANLkTimZagyfkPBQOr4FjsL_oAHhx6F%2B1Q@mail.gmail.com> References: <32AB5C9615CC494997D9ABB1DB12783C024E929F93@SJ-EXCH-1.adaranet.com> <BANLkTi=hDuVxLSaC5Y4LTwV_Hqv8nT9JDw@mail.gmail.com> <32AB5C9615CC494997D9ABB1DB12783C024E929FD0@SJ-EXCH-1.adaranet.com> <BANLkTimZagyfkPBQOr4FjsL_oAHhx6F%2B1Q@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Yes, however getvnode() does initialize a struct file *.. but f_cred seems = to not contain valid/correct entries. In my last post I probably should have pointed out that I have the inode st= ored from another operation. Jon -----Original Message----- From: Matthew Fleming [mailto:mdf356@gmail.com] Sent: Wednesday, April 13, 2011 2:35 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 2:18 PM, Jonathan Stuart <jstuart@adaranet.com> 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 <jstuart@adaranet.com> = 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 *). I'm su= re 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 >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?32AB5C9615CC494997D9ABB1DB12783C024E929FDC>