Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2012 19:39:50 +0300
From:      Konstantin Belousov <kostikbel@gmail.com>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Sam Varshavchik <mrsam@courier-mta.com>, freebsd-hackers@freebsd.org
Subject:   Re: What happened to my /proc/curproc/file?
Message-ID:  <20120907163950.GA33100@deviant.kiev.zoral.com.ua>
In-Reply-To: <201209071223.54931.jhb@freebsd.org>
References:  <cone.1346723177.448775.23058.1000@monster.email-scan.com> <201209071033.52864.jhb@freebsd.org> <20120907155936.GY33100@deviant.kiev.zoral.com.ua> <201209071223.54931.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--tZWhWDbreVb/2R9E
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Sep 07, 2012 at 12:23:54PM -0400, John Baldwin wrote:
> On Friday, September 07, 2012 11:59:36 am Konstantin Belousov wrote:
> > On Fri, Sep 07, 2012 at 10:33:52AM -0400, John Baldwin wrote:
> > > On Tuesday, September 04, 2012 7:46:23 pm Sam Varshavchik wrote:
> > > > Is the dev+ino of what was exec()ed known, for another process? I m=
ight be =20
> > > > able to get the client voluntarily submit its argv[0], then indepen=
dently =20
> > > > have the server validate it by stat()ing that, and comparing the re=
sult =20
> > > > against what the kernel says the process's inode is.
> > >=20
> > > It's known in the kernel certainly.  I don't think we currently have =
any way
> > > of exporting that info to userland however.
> >=20
> > It is, as  KF_FD_TYPE_TEXT by sysctl kern.proc.filedesc.
>=20
> That doesn't include stat info though IIRC.  You can get a pathname that =
is
> the same you would get from /proc/curproc/file (so it may fail and be emp=
ty),
> but you don't get st_dev or st_ino.
>=20
> I have thought that it might be useful for kinfo_file to include a full
> 'struct stat' and use the fo_stat() method of each file to fill it in, but
> that is not present currently.

ino is in kf_file_fileid, and rdev in kf_file_rdev. Also there is
fsid in kf_file_fsid.

--tZWhWDbreVb/2R9E
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (FreeBSD)

iEYEARECAAYFAlBKI1UACgkQC3+MBN1Mb4gVYwCg85GSN+HVDaCjdL+tBXtz6asT
0MYAoOaPV25M2OJg85GZ166GygWqNT0+
=7yrR
-----END PGP SIGNATURE-----

--tZWhWDbreVb/2R9E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120907163950.GA33100>