Re: Jails that keep hanging around

From: Melvyn Sopacua <freebsd-current_at_webteckies.org>
Date: Sun, 15 Feb 2004 21:09:47 +0100
On Sunday 15 February 2004 20:56, Maxim Konovalov wrote:
> On Sun, 15 Feb 2004, 20:49+0100, Melvyn Sopacua wrote:
> > On Sunday 15 February 2004 19:44, Melvyn Sopacua wrote:
> > > (poking around sys/kern/kern_jail.c to try and get the value
> > > p->pr_ref).
> >
> > Ok, I'm stuck. How does one get a struct prison (read-only for all I
> > care), when only having a jail id, in userland?
>
> As I already wrote sysctl -o security.jail.list.

No, a 'struct prison' in C. All you get with sysctlbyname is xprison, which 
doesn't expose the prison structure (which holds the refcount). Seems I'll 
have to go through kvm_open -> proc -> td_ucred -> cr_prison and some 
forking.
-- 
Melvyn

=======================================================
FreeBSD sarevok.webteckies.org 5.2-CURRENT FreeBSD 5.2-CURRENT #1: Sat Feb 14 
02:48:30 CET 2004     
root_at_sarevok.webteckies.org:/usr/obj/usr/src/sys/SAREVOK_NOAPM_NODEBUG  i386
=======================================================

Received on Sun Feb 15 2004 - 11:09:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:43 UTC