From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11704 Path: news.gmane.org!.POSTED!not-for-mail From: u-uy74@aetey.se Newsgroups: gmane.linux.lib.musl.general Subject: Re: Question about setting argv[0] when manually using dynamic linker Date: Sun, 9 Jul 2017 16:04:26 +0200 Message-ID: <20170709140426.GB27260@example.net> References: <20170517070115.GL6320@example.net> <20170517162428.GH17319@brightrain.aerifal.cx> <20170702173618.GL27260@example.net> <20170704205811.GN1627@brightrain.aerifal.cx> <20170709092322.GA27260@example.net> <20170709122325.GK1627@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1499609102 4299 195.159.176.226 (9 Jul 2017 14:05:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 9 Jul 2017 14:05:02 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11717-gllmg-musl=m.gmane.org@lists.openwall.com Sun Jul 09 16:04:58 2017 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1dUCpS-0000k7-P3 for gllmg-musl@m.gmane.org; Sun, 09 Jul 2017 16:04:54 +0200 Original-Received: (qmail 18360 invoked by uid 550); 9 Jul 2017 14:04:58 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 18342 invoked from network); 9 Jul 2017 14:04:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fripost.org; h= in-reply-to:content-disposition:content-type:content-type :mime-version:references:message-id:subject:subject:from:from :date:date; s=20140703; t=1499609086; x=1501423487; bh=AInHkb+al F6hwZXiZfw6f+EvFmmtFOJCOVNenFiyf0k=; b=OS2vk2d7MQ+Nup5ZX0KlSmcSN l5zW01MIm6xxUy7zeLAghnBRtq5md9Hp/zJ46djH/08+wVcRYUTP2dwp/dttnmLR 223nyByK/a9skhK89JzoEnoHw2lnasbzIb2UG+dkt7u9pe1EjvjqwHvFjakfwq45 afsyla677MQJNL6hf0= X-Virus-Scanned: Debian amavisd-new at fripost.org Content-Disposition: inline In-Reply-To: <20170709122325.GK1627@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:11704 Archived-At: On Sun, Jul 09, 2017 at 08:23:25AM -0400, Rich Felker wrote: > On Sun, Jul 09, 2017 at 11:23:23AM +0200, u-uy74@aetey.se wrote: > > What about always passing on the loader argv[0] unless --argv0 is present? > > This will not matter for programs which do not analyze argv[0] > > and will not make it worse for programs which do. > > This would be a regression in existing behavior and basically breaks > any scripts where the program run wants argv[0] to be its own name. Indeed, this _can_ make it worse for programs run from existing scripts. This makes my suggestion moot. > Otherwise I agree it would be a nicer interface. But I don't see any > reason your invoking program can't just pass the same string it passes > as argv[0] at exec time also as the argument to --argv0. Certainly it can, this just happens to be practically inconvenient. Such a change needs some new config syntax, some coding, testing, documentation and then modification and testing of a noticeable number of configuration instances. Sigh. Given that the "existing scripts depending on the old behaviour" are irrelevant here, it does not feel right. :) Of course this is not an argument for upstream. Never mind, we can either bite the bullet and use --argv0 as it is meant to, or make the "pass-on" change to our copy of the dynloader. Thanks (for musl and for --argv0) ! Rune