From: Laurent Vivier <laurent@vivier.eu>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: lucas.kaldstrom@hotmail.co.uk, Riku Voipio <riku.voipio@iki.fi>,
Petros Angelatos <petrosagg@resin.io>,
QEMU Developers <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] linux-user: add option to intercept execve() syscalls
Date: Fri, 22 Jan 2016 12:00:43 +0100 [thread overview]
Message-ID: <56A20BDB.5080209@vivier.eu> (raw)
In-Reply-To: <CAFEAcA-u4CPXVqKJx_BDKSToaBmU9tPRyo63Mzaiio+2dmxyjg@mail.gmail.com>
Le 22/01/2016 11:47, Peter Maydell a écrit :
> On 22 January 2016 at 10:33, Laurent Vivier <laurent@vivier.eu> wrote:
>> Le 22/01/2016 11:01, Petros Angelatos a écrit :
>>> This was my initial approach too, but argv[0] can be just the filename
>>> like "qemu-arm-static". And while I could add extra logic to look this
>>> up in the PATH, someone could run it from a completely different
>>> location. Then I looked for a way to get the path of the current
>>> executable but every platform has its own way of doing that and I
>>> didn't want to add all these cases.
>>>
>>> https://stackoverflow.com/questions/1023306/finding-current-executables-path-without-proc-self-exe
>>
>> linux-user works only on linux.
>> qemu uses glib-2.0, so you can use g_find_program_in_path().
>
> If QEMU was started via execle() to set the environment of the
> executed process and that specified environment has a different
> PATH, then g_find_program_in_path() will give the wrong answer.
> Using AT_EXECFN (perhaps with a fallback to /proc/self/exe) seems
> like a better approach to me.
I agree, you can use getauxval(AT_EXECFN).
>>> questions. Is it ok that I deleted part of the patch for my reply to
>>> code review, or should I have replied inline without deleting
>>
>> Generally, it's better to not delete parts. So, someone tacking the mail
>> thread at a moment can read the whole history in the last mail.
>
> I tend to happily delete parts and assume that readers have
> access to the thread (via the archive or in their mail readers).
> Not deleting bits makes it hard to read replies if there's
> a conversation about a small part of a large patch.
Yes, I do that also... :)
Laurent
next prev parent reply other threads:[~2016-01-22 11:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-18 4:33 [Qemu-devel] [PATCH] linux-user: add option to intercept execve() syscalls Petros Angelatos
2016-01-20 23:34 ` Laurent Vivier
2016-01-21 1:49 ` Petros Angelatos
2016-01-21 10:12 ` Laurent Vivier
2016-01-22 10:01 ` Petros Angelatos
2016-01-22 10:33 ` Laurent Vivier
2016-01-22 10:47 ` Peter Maydell
2016-01-22 11:00 ` Laurent Vivier [this message]
2016-01-27 8:50 ` Petros Angelatos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56A20BDB.5080209@vivier.eu \
--to=laurent@vivier.eu \
--cc=lucas.kaldstrom@hotmail.co.uk \
--cc=peter.maydell@linaro.org \
--cc=petrosagg@resin.io \
--cc=qemu-devel@nongnu.org \
--cc=riku.voipio@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).