From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11345 Path: news.gmane.org!.POSTED!not-for-mail From: John Regan Newsgroups: gmane.linux.lib.musl.general Subject: Re: Question about setting argv[0] when manually using dynamic linker Date: Wed, 17 May 2017 16:22:45 -0500 Message-ID: References: <20170517070115.GL6320@example.net> <20170517162428.GH17319@brightrain.aerifal.cx> <20170517190705.GM6320@example.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1148b478ac6512054fbee3e1" X-Trace: blaine.gmane.org 1495056212 27697 195.159.176.226 (17 May 2017 21:23:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 17 May 2017 21:23:32 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-11360-gllmg-musl=m.gmane.org@lists.openwall.com Wed May 17 23:23:28 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 1dB6Pn-00077J-PS for gllmg-musl@m.gmane.org; Wed, 17 May 2017 23:23:27 +0200 Original-Received: (qmail 11552 invoked by uid 550); 17 May 2017 21:22: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 11488 invoked from network); 17 May 2017 21:22:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=E/8MkyN9gbHjn5JAYLhK38LZvKyR5iuto2TkiaFZMYY=; b=vddgiC6ro4pQqk+GmGTxI3sdt0aueI0AvSHT/tEETOmHybr+OV6yUq4cwBxgE6LvCU x9sXXBISwQVfnAaRXTLOLyJBnmm8gIr75WRf0Mg8Fqwb3sK9pJNU5vRbm8z4y+0qtLfa dvwkXNuLX2krmd6HIHRKllPpJHNkJmYiXuKYncKdTxAxEYRhtCg35Nsgex5nbXt2WumZ 4wyKkm7JmI0WpE0SQ7SNduS3btKIRjrA8jaNUDt91W5Tkni+f/lV62U+wkuEWF3CNq21 DYUkpT/xk0TXqZeE5H1g/dvD9UoriEq4BMF1mry3zptfeoVFXJdERJsPw46mFRKUgurM qE5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=E/8MkyN9gbHjn5JAYLhK38LZvKyR5iuto2TkiaFZMYY=; b=n0YAIyNlcjyh3sacA7+Rf2YgTQrQj/E3X+FO4jr7p/iJxy+VKcbEsb7sl82yoge+iB 6t98jFAqAv8Mx65rIKug/O7W5etz4PoZcyenzr2bkRNVD3PsCH0YrhoDK3PrIioKM6e3 IK54Yl7zxyC1VhiBNZRv4dswYKlsF4TEE0cfyyOIFVQXSe0NMWujYj/jWrd/8JfV3vs4 f+vIodamYekkrwibOjnM21PhSX4ncY8r3+1Nvt3Z+NYfnOHLckbsVYkJqSqs2PEyL56X A8yyA285ByfTHbOC2IT44teRkfE+/Ha50fYJCD6+dEUPqlpO/USNjxd4H3DyX3waPFXT xj9g== X-Gm-Message-State: AODbwcDB4O3oUPKYX4UnyuaUjlA0CsA95UtDy+/vBMeISy+sda5TO+S+ SYXbt5bucmlK0rA07txsw1MP0JUFZUrZ X-Received: by 10.55.14.85 with SMTP id 82mr827757qko.7.1495056165656; Wed, 17 May 2017 14:22:45 -0700 (PDT) In-Reply-To: Xref: news.gmane.org gmane.linux.lib.musl.general:11345 Archived-At: --001a1148b478ac6512054fbee3e1 Content-Type: text/plain; charset="UTF-8" On Wed, May 17, 2017 at 4:15 PM, mzpqnxow wrote: > Does the shell built-in "exec" -a app1 /bah/dynamic-loader.so > /path/to/app1" work or it has the same problem with argv[0] getting reset? > > It looks like argv[0] gets reset. Plus I don't think every shell's built-in "exec" supports that -a flag. I don't see it mentioned in the POSIX man page for exec - http://pubs.opengroup.org/onlinepubs/009604599/utilities/exec.html - nor do I see anything about it on the dash man page - https://linux.die.net/man/1/dash, I suspect that's specific to bash. --001a1148b478ac6512054fbee3e1 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

On Wed, May 17, 2017 at 4:15 PM, mzpqnxow <musl@mzpqnxow.com> wrote:
=
Does the shell built-in "exec&quo= t; -a app1 /bah/dynamic-loader.so /path/to/app1" work or it has the sa= me problem with argv[0] getting reset?


It looks like argv[0] gets reset. Plus I don'= t think every shell's built-in "exec" supports that -a flag. = I don't see it mentioned in the POSIX man page for exec - http://pu= bs.opengroup.org/onlinepubs/009604599/utilities/exec.html - nor do I se= e anything about it on the dash man page - https://linux.die.net/man/1/dash, I suspect that's spe= cific to bash.

--001a1148b478ac6512054fbee3e1--