Date: Sat, 01 Aug 1998 22:17:43 -0700 From: Mike Smith <mike@smith.net.au> To: Jacques Vidrine <n@nectar.com> Cc: hackers@FreeBSD.ORG Subject: Re: Another sysctl question Message-ID: <199808020517.WAA06146@antipodes.cdrom.com> In-Reply-To: Your message of "Sun, 02 Aug 1998 00:09:21 CDT." <E0z2qOX-0000GC-00@spawn.nectar.com>
next in thread | previous in thread | raw e-mail | index | archive | help
> > kern_sysctl.c is not easy to follow for me ... > > How can I tell inside a sysctl handler whether or not I've > been invoked from userland via a system call or from some other > part of the kernel? As a general rule, you shouldn't. If you think you should, it's likely that you're going about things the wrong way. > I want to muck about with what sysctl_kern_proc does when called > ultimately from a user process, based on some info in the proc > structure. This sounds like you want to add some form of access control for your sysctl. That's not something you should be doing inside your handler, IMHO. You might want to consider using curproc rather than the proc handed to you by the sysctl syscall, as you can check this for validity and then use it without having to pass it around. -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199808020517.WAA06146>