From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCHv10 man-pages 5/5] execveat.2: initial man page for execveat(2) Date: Sun, 11 Jan 2015 03:02:56 -0800 Message-ID: <20150111110256.GA18765@infradead.org> References: <20150109225743.GP22149@ZenIV.linux.org.uk> <20150109231248.GZ4574@brightrain.aerifal.cx> <20150109233644.GR22149@ZenIV.linux.org.uk> <20150110030300.GU22149@ZenIV.linux.org.uk> <20150110034144.GC4574@brightrain.aerifal.cx> <20150110041457.GV22149@ZenIV.linux.org.uk> <20150110055713.GE4574@brightrain.aerifal.cx> <878uhaqnjo.fsf@x220.int.ebiederm.org> <20150111011559.GG4574@brightrain.aerifal.cx> <87oaq6oypl.fsf@x220.int.ebiederm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <87oaq6oypl.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: "Eric W. Biederman" Cc: Rich Felker , Al Viro , David Drysdale , "Michael Kerrisk (man-pages)" , Andy Lutomirski , Meredydd Luff , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Andrew Morton , David Miller , Thomas Gleixner , Stephen Rothwell , Oleg Nesterov , Ingo Molnar , "H. Peter Anvin" , Kees Cook , Arnd Bergmann , Christoph Hellwig , X86 ML , linux-arch , Linux API , sparclinux-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-api@vger.kernel.org On Sat, Jan 10, 2015 at 08:09:10PM -0600, Eric W. Biederman wrote: > In implementation /proc/self/exe is a named rather than a numbered file > descriptor. Essentially when loading an elf executable the file > descriptor is duped to the name /proc/self/exe. The implementation > otherwise is the same as /proc/self/fd/N. > > The downside of course is that I expect if we were actually to change > /proc/self/exe from to point at the script instead of the shell some > piece of software somewhere would come melting down. I am totally not > ready to consider that kind of mine field today. We could add a /proc/self/script that points to the script, and either is not available or still points to the executable if we are not running a script.