From owner-freebsd-hackers Thu Jan 10 7:34:40 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from bugz.infotecs.ru (bugz.infotecs.ru [195.210.139.22]) by hub.freebsd.org (Postfix) with ESMTP id 526A237B41D for ; Thu, 10 Jan 2002 07:34:35 -0800 (PST) Received: (from root@localhost) by bugz.infotecs.ru (8.11.6/8.11.4) id g0AFYHU99684; Thu, 10 Jan 2002 18:34:17 +0300 (MSK) (envelope-from vel) From: "Eugene L. Vorokov" Message-Id: <200201101534.g0AFYHU99684@bugz.infotecs.ru> Subject: Re: kld question To: coolvibe@hackerheaven.org (Emiel Kollof) Date: Thu, 10 Jan 2002 18:34:16 +0300 (MSK) Cc: freebsd-hackers@freebsd.org In-Reply-To: <20020110150538.GA26886@laptop.hackerheaven.org> from "Emiel Kollof" at Jan 10, 2002 04:05:38 PM X-Mailer: ELM [version 2.5 PL5] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > > I made a kernel module that logs execve system calls by intercepting the > execve syscall, log it and then execute the original syscall. This was > pretty straightforward to do, and it works beautifully on STABLE, but on > CURRENT it bombs on this line: > > uid = p->p_cred->pc_ucred->cr_uid; > > So, my question: how does one obtain the UID from the proc struct in > CURRENT? Preferably in a way that will both work on CURRENT and STABLE. > Before KSE changes went in, it was p->p_ucred->cr_uid, that's what I use in very similar module with kernel from about August 2001. Now it's probably changed again, but I don't cvsup for now, so I don't know exactly. Regards, Eugene To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message