[libvirt] [PATCH 03/11] Include process start time when doing polkit checks
Daniel P. Berrange
berrange at redhat.com
Wed May 8 09:25:04 UTC 2013
On Fri, May 03, 2013 at 01:38:47PM -0600, Eric Blake wrote:
> On 05/02/2013 06:07 AM, Daniel P. Berrange wrote:
> > On Thu, May 02, 2013 at 01:03:41PM +0100, Daniel P. Berrange wrote:
> >> From: "Daniel P. Berrange" <berrange at redhat.com>
> >>
> >> Since PIDs can be reused, polkit prefers to be given
> >> a (PID,start time) pair. If given a PID on its own,
> >> it will attempt to lookup the start time in /proc/pid/stat,
> >> though this is subject to races.
> >>
> >> It is safer if the client app resolves the PID start
> >> time itself, because as long as the app has the client
> >> socket open, the client PID won't be reused.
> >>
> >> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> >
> >
> >> +#elif defined(__FreeBSD__)
> >> +int virProcessGetStartTime(pid_t pid,
> >> + unsigned long long *timestamp)
>
> >
> > Note this BSD specific code block has not even been compile tested.
> > It is just copied from the polkit codebase with minimal conversion
> > to libvirt standards.
>
> I've compile-tested it on FreeBSD (well, I had to do some conflict
> resolution in virstring to get this patch to apply, so I hope that when
> you rebase, that you end up doing the same resolution - but the
> conflicts didn't affect the BSD section of virprocess.c). It didn't
> quite work:
>
> util/virprocess.c: In function 'virProcessGetStartTime':
> util/virprocess.c:850: error: incompatible type for argument 3 of 'sysctl'
>
> I think you want to pass &p, not p, as the third argument (at least,
> doing that cleared up compilation for me, although I don't know how to
> test that the compiled result actually worked).
Yes, you are corrrect - I mis-copied that
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the libvir-list
mailing list