pkcheck: Support --process=pid,start-time,uid syntax too
authorColin Walters <walters@verbum.org>
Mon, 19 Aug 2013 16:16:11 +0000 (12:16 -0400)
committerMiloslav Trmač <mitr@redhat.com>
Wed, 18 Sep 2013 16:29:25 +0000 (18:29 +0200)
commit3968411b0c7ba193f9b9276ec911692aec248608
treede9a4f0b3ad64a2f518220f8b5966f2939d7a1bd
parent08291789a1f99d4ab29c74c39344304bcca43023
pkcheck: Support --process=pid,start-time,uid syntax too

The uid is a new addition; this allows callers such as libvirt to
close a race condition in reading the uid of the process talking to
them.  They can read it via getsockopt(SO_PEERCRED) or equivalent,
rather than having pkcheck look at /proc later after the fact.

Programs which invoke pkcheck but need to know beforehand (i.e.  at
compile time) whether or not it supports passing the uid can
use:

pkcheck_supports_uid=$($PKG_CONFIG --variable pkcheck_supports_uid polkit-gobject-1)
test x$pkcheck_supports_uid = xyes
data/polkit-gobject-1.pc.in
docs/man/pkcheck.xml
src/programs/pkcheck.c