From: Eli Zaretskii <eliz@gnu.org>
To: Daniel Colascione <dancol@dancol.org>
Cc: 34180@debbugs.gnu.org, monnier@IRO.UMontreal.CA
Subject: bug#34180: 27.0.50; argv[0] used incorrectly to find the .pdmp
Date: Sun, 27 Jan 2019 17:23:46 +0200 [thread overview]
Message-ID: <83va2a3z0d.fsf@gnu.org> (raw)
In-Reply-To: <5d5d6da7-d0d4-82ae-8034-78d47a6b12c8@dancol.org> (message from Daniel Colascione on Sat, 26 Jan 2019 19:54:29 -0800)
> From: Daniel Colascione <dancol@dancol.org>
> Date: Sat, 26 Jan 2019 19:54:29 -0800
>
> > 1- It fails miserably if argv[0] is a name relative to $PATH since it
> > performs the lookup relative to $PWD instead, which is additionally
> > a security issue.
> >
> > 2- If the executable named by argv[0] is a symlink, it does not try to
> > follow the symlink in case the .pdmp is stored next to the
> > destination rather than next to the source.
>
> Yep. We should definitely fix that. realpath on argv[0] seems like the
> right thing.
Wouldn't it be better to have a method of finding the absolute file
name of the executable from which the process was started, regardless
of what argv[0] says? The way to do that is system-dependent (on
GNU/Linux, I believe you need to readlink ("/proc/self/exe") or
somesuch, for example), but AFAIK this can be done on all platforms we
support.
next prev parent reply other threads:[~2019-01-27 15:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-23 16:07 bug#34180: 27.0.50; argv[0] used incorrectly to find the .pdmp Stefan Monnier
2019-01-27 3:54 ` Daniel Colascione
2019-01-27 15:23 ` Eli Zaretskii [this message]
2021-10-11 14:02 ` Lars Ingebrigtsen
2021-10-11 14:04 ` Lars Ingebrigtsen
2021-10-11 15:10 ` Paul Eggert
2021-10-11 16:05 ` Eli Zaretskii
2021-10-11 20:13 ` Daniel Colascione
2021-10-12 0:51 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-10-12 10:51 ` Lars Ingebrigtsen
2021-10-12 11:54 ` Philipp Stephani
2021-10-12 11:59 ` Lars Ingebrigtsen
2021-10-12 14:10 ` Eli Zaretskii
2021-10-11 15:54 ` Eli Zaretskii
2021-10-12 10:48 ` Lars Ingebrigtsen
2021-10-11 21:16 ` Richard Stallman
2021-10-12 12:27 ` Mattias Engdegård
2021-10-12 16:24 ` Daniel Colascione
2021-10-12 16:46 ` Eli Zaretskii
2021-10-12 16:59 ` Mattias Engdegård
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83va2a3z0d.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=34180@debbugs.gnu.org \
--cc=dancol@dancol.org \
--cc=monnier@IRO.UMontreal.CA \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).