From: Erik A. H. <er...@he...> - 2002-05-09 19:14:52
|
On Thu, May 09, 2002 at 08:19:07PM +0200, ha...@no... wrote: > ... > #include <asm/uaccess.h> > > /* Added by VH for bproc: */ > #include <linux/bproc.h> > ... > > static inline int autofs_oz_mode(struct autofs_sb_info *sbi) { > /* return sbi->catatonic || current->pgrp == sbi->oz_pgrp; > * Changed by Vaclav Hanzl to let it work with bproc: > */ > return sbi->catatonic || > bproc_hook_imv(current->pgrp,sys_getpgrp,()) == sbi->oz_pgrp; > } > > I have little idea what it actually means, but it works :) > Any comments welcome, as always. That calls: (kernel/sys.c from Linux source) asmlinkage long sys_getpgrp(void) { /* SMP - assuming writes are word atomic this is fine */ return bproc_hook_imv(current->pgrp,sys_getpgrp,()); } the bproc_hook_imv macro calls: (kernel/hooks.c from BProc source) int bproc_hook_sys_getpgrp(void) { return current->bproc.masq->pgrp; } ... but only if the caller has masqueraded PIDs which is exactly what you want. This patch should perfectly safe. It's small and to the point - I like it. > >This is the easiest way to get around the problem although there are > >some drawbacks. I've been pretty vehement about not providing hooks > >for things like daemons to escape. The rationale there is basically > >that people would use those hooks if they were there. :) > > Good rationale. Keep it. :-)) > > Little side-effect probably is that most people are not able to run > any daemons on bproc node. :-) But things are getting better... I don't like daemons on nodes anyway. I've been trying for years to reduce the bulk of stuff running on the nodes. - Erik |