qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Zach Riggle <zachriggle@gmail.com>
Cc: QEMU Trivial <qemu-trivial@nongnu.org>,
	Riku Voipio <riku.voipio@iki.fi>,
	"open list:All patches CC here" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH v2] linux-user: fix is_proc_myself to check the paths via realpath
Date: Tue, 14 Nov 2017 20:44:58 +0100	[thread overview]
Message-ID: <b4ed3fcb-48a1-4304-9dab-1694e63eef3f@vivier.eu> (raw)
In-Reply-To: <CAMP9c5kG9m-swMJBtdQPzPkjLy7zq9sEdRA-PGcdeFDAT-DH9w@mail.gmail.com>

Le 11/11/2017 à 02:48, Zach Riggle a écrit :
> I wrote up a quick example to show that this should work specifically for
> /proc/self/exe:
> 
> #define _GNU_SOURCE
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> #include <unistd.h>
> int main(int argc, char** argv) {
>     int fd = open("/proc/self/exe", O_NOFOLLOW | O_PATH);
>     system("ls -la /proc/$PPID/fd/");
> }
> 

And what about a readlink() in a loop until we cross "/proc/<pid>" (or not)?

Thanks,
Laurent

      reply	other threads:[~2017-11-14 19:45 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-24 23:07 [Qemu-devel] [PATCH] linux-user: fix is_proc_myself to check the paths via realpath Zach Riggle
2017-10-25  2:55 ` no-reply
2017-10-25  3:34 ` [Qemu-devel] [PATCH v2] " Zach Riggle
2017-10-26 21:06   ` Zach Riggle
2017-10-27  9:36     ` Riku Voipio
2017-10-27 17:05       ` Zach Riggle
2017-10-27 19:07         ` Zach Riggle
2017-10-28  5:14           ` Eric Blake
2017-11-02 18:26             ` Zach Riggle
2017-11-02 19:35             ` Peter Maydell
2017-11-06 20:17               ` Zach Riggle
2017-11-07 20:06                 ` Riku Voipio
2017-11-10 21:44                   ` Zach Riggle
2017-11-10 23:44   ` Laurent Vivier
2017-11-11  1:47     ` Zach Riggle
2017-11-11  1:48       ` Zach Riggle
2017-11-14 19:44         ` Laurent Vivier [this message]

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=b4ed3fcb-48a1-4304-9dab-1694e63eef3f@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=riku.voipio@iki.fi \
    --cc=zachriggle@gmail.com \
    /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).