From owner-freebsd-hackers Sun Jan 18 05:33:35 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id FAA02127 for hackers-outgoing; Sun, 18 Jan 1998 05:23:11 -0800 (PST) (envelope-from owner-freebsd-hackers@FreeBSD.ORG) Received: from smtp03.primenet.com (smtp03.primenet.com [206.165.6.133]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id FAA01953 for ; Sun, 18 Jan 1998 05:21:36 -0800 (PST) (envelope-from tlambert@usr04.primenet.com) Received: (from daemon@localhost) by smtp03.primenet.com (8.8.8/8.8.8) id XAA24121; Sat, 17 Jan 1998 23:58:31 -0700 (MST) Received: from usr04.primenet.com(206.165.6.204) via SMTP by smtp03.primenet.com, id smtpd024104; Sat Jan 17 23:58:30 1998 Received: (from tlambert@localhost) by usr04.primenet.com (8.8.5/8.8.5) id XAA07919; Sat, 17 Jan 1998 23:58:28 -0700 (MST) From: Terry Lambert Message-Id: <199801180658.XAA07919@usr04.primenet.com> Subject: Re: dladdr hax To: hasty@rah.star-gate.com (Amancio Hasty) Date: Sun, 18 Jan 1998 06:58:28 +0000 (GMT) Cc: jb@freebsd1.cimlogic.com.au, jdp@polstra.com, hackers@FreeBSD.ORG In-Reply-To: <199801172227.OAA06497@rah.star-gate.com> from "Amancio Hasty" at Jan 17, 98 02:27:17 pm 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 > Not sure that I understand whats going on . when the kernel loads > an image it has the full path so the question now is where do > we save the path -- the most intuitive place is the proc > structure. In the case of a symlink, where the link points to a relative path and the relative path is not the terminal component, the kernel does *not* ever have the full path all at once. The question you have to ask is "is it relative to the link path or relative to the real path from the root that I want to return?". This is relevent because you may be obscuring the location of the binary, and you don't want a user to be able to discern this from running the thing. I think argv[ 0] is the best bet. It also is compatible with Solaris, and it's what we'll need for a Solaris execution class in any case. Might as well not have two implementations. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.