Re: issetugid() for other procs
--wIc/V6YLA2QdyfT4
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Sun, Oct 07, 2007 at 12:28:05PM -0500, Zane C.B. wrote:
> On Sun, 07 Oct 2007 18:25:57 +0200
> Jan M?nther <jan.muenther@nruns.com> wrote:
>=20
> > man getuid, man geteuid.
>=20
> This does work for other procs, only the one that is calling it.
>=20
> Like I said initially I am looking to check if another proc has run
> setuid, seteuid, or been executed or forked by one that has.
Note that what you trying to do is racy by definition.
To get the value of issetugid() for some other process, as it _could_
be returned at some moment in a time, you shall check the P_SUGID bit
of the p_flag from the corresponding struct proc. This is available by
the kvm_getprocs(3) interface in the ki_flag field of the kinfo_proc
structure, see corresponding man page.
--wIc/V6YLA2QdyfT4
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)
iD8DBQFHCR+RC3+MBN1Mb4gRAu8yAKDXBQ2KBIDxA7ocXQ4ARCE/mI3E+ACdHKo7
Wz6mPiqcvH1dgd1tRg2WNKw=
=9a+s
-----END PGP SIGNATURE-----
--wIc/V6YLA2QdyfT4--
討論串 (同標題文章)
完整討論串 (本文為第 7 之 7 篇):