From owner-freebsd-hackers Sat Aug 1 22:18:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id WAA02687 for freebsd-hackers-outgoing; Sat, 1 Aug 1998 22:18:35 -0700 (PDT) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from antipodes.cdrom.com (castles250.castles.com [208.214.165.250]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id WAA02680 for ; Sat, 1 Aug 1998 22:18:32 -0700 (PDT) (envelope-from mike@antipodes.cdrom.com) Received: from antipodes.cdrom.com (localhost [127.0.0.1]) by antipodes.cdrom.com (8.8.8/8.8.5) with ESMTP id WAA06146; Sat, 1 Aug 1998 22:17:44 -0700 (PDT) Message-Id: <199808020517.WAA06146@antipodes.cdrom.com> X-Mailer: exmh version 2.0zeta 7/24/97 To: Jacques Vidrine cc: hackers@FreeBSD.ORG Subject: Re: Another sysctl question In-reply-to: Your message of "Sun, 02 Aug 1998 00:09:21 CDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sat, 01 Aug 1998 22:17:43 -0700 From: Mike Smith Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > 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