I’ve made top with jail id support. I start to think adding similar functions to other programs.

fstat is the victim. I decide to let fstat can accept jid and then display active files according to the specified jid.

Here comes the patch.

To apply this patch, you must rebuild your kernel.

% cd /usr/src; patch < patch_fstat_jid
% make kernel
...reboot with new kernel
% cd /usr/src/lib/libkvm; make clean install clean
% cd /usr/src/usr.bin/fstat; make clean install clean
... to make other program sync
% cp -f /usr/src/sys/sys/sysctl.h /usr/include/sys/

If you see any error appear, please inform me :)

How to use?

% fstat -j

NOTE, this patch will be send-pr-ed sooner or later. But I need your test first. :)

UPDATE 2006/06/12: Thanks to Roberto Lima for ‘cp -f /usr/src/sys/sys/sysctl.h /usr/include/sys/’ :)
UPDATE 2006/06/30: pr is here.

Add to del.icio.us - Digg this article

3 Responses to “[patch][jail] fstat according to specified jid”  

  1. 1 gogo

    You rock! :)

  2. 2 Smux (roberto lima)

    its great! but dont forget to do ‘cp -f /usr/src/sys/sys/sysctl.h /usr/include/sys/’
    :-)

  3. 3 clsung

    Thank you :)

Leave a Reply