From owner-freebsd-hackers Sun Jan 18 05:33:21 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id CAA04716 for hackers-outgoing; Sun, 18 Jan 1998 02:48:21 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp01.primenet.com (smtp01.primenet.com [206.165.6.131]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id CAA04508 for ; Sun, 18 Jan 1998 02:44:49 -0800 (PST) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp01.primenet.com (8.8.8/8.8.8) id XAA24464; Sat, 17 Jan 1998 23:55:13 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp01.primenet.com, id smtpd024452; Sat Jan 17 23:55:11 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id XAA07872; Sat, 17 Jan 1998 23:55:09 -0700 (MST) From: Terry Lambert Message-Id: <199801180655.XAA07872@usr04.primenet.com> Subject: Re: dladdr hax To: jb@freebsd1.cimlogic.com.au (John Birrell) Date: Sun, 18 Jan 1998 06:55:08 +0000 (GMT) Cc: jdp@polstra.com, hasty@rah.star-gate.com, hackers@FreeBSD.ORG In-Reply-To: <199801172114.IAA15682@freebsd1.cimlogic.com.au> from "John Birrell" at Jan 18, 98 08:14:22 am X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk > > If you will come up with (or suggest) a solution to finding the > > pathname of the main program, then I will add that into my version and > > commit it. And puhleeeze, don't suggest the hack of searching each of > > the directories in $PATH for argv[0]. > > What about adding some code to the namei() interface and set aside a > copy of the path in execve() (in kern_exec.c)? Symlinks are handled with a buffer rewrite and a return; this is sort of a kludge on mutual recursion. Symlinks rooted to root instead of relatively rooted would work for this. Really, you would need better namei() code for this; probably a recursive lookup instead of the kludged buffer/stack mutual recursion currently in the code. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.