all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Tino Calancha <tino.calancha@gmail.com>
Cc: 37445-done@debbugs.gnu.org
Subject: bug#37445: 27.0.50; Permission denied after make install
Date: Wed, 18 Sep 2019 23:57:23 -0700	[thread overview]
Message-ID: <f74a7399-8d94-03ee-5e98-760e47a91f5d@cs.ucla.edu> (raw)
In-Reply-To: <alpine.LNX.2.21.99999.362.1909180901110.16029@ip-10-207-252-54.us-west-2.compute.internal>

[-- Attachment #1: Type: text/plain, Size: 124 bytes --]

I installed the attached patch, which should fix the bug even when PICKY_EACCES 
is nonzero. Boldly closing the bug report.

[-- Attachment #2: 0001-Omit-some-overenthusiastic-file-truename-calls.patch --]
[-- Type: text/x-patch, Size: 3662 bytes --]

From dff4f9c759f5cf19047719716ea5ee8ffdc3006e Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 18 Sep 2019 23:53:46 -0700
Subject: [PATCH] Omit some overenthusiastic file-truename calls

Problem reported by Tino Calancha (Bug#37445).
* src/emacs.c (init_cmdargs): Call file-truename only if
needed, i.e., if invocation-directory ends in "/i386/" on
WINDOWSNT.
* src/lread.c (readevalloop): If the sourcename is not
absolute, make it absolute.  There is no need to convert
non-absolute files into truenames, since absolute files are
not converted into truenames.
(init_lread): Do not convert source-directory into a truename
at startup.  There is no need to do so in a dumped Emacs since
an absolute file name suffices.  The source directory might
not even exist any more, or might have been replaced by an
interloper who takes advantage of the truename calculation.
(syms_of_lread): Remove Qfile_truename; no longer needed.
---
 src/emacs.c | 14 +++++++++-----
 src/lread.c | 11 +++--------
 2 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/src/emacs.c b/src/emacs.c
index eb732810db..8a8d8b558e 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -479,9 +479,6 @@ init_cmdargs (int argc, char **argv, int skip_args, char const *original_pwd)
 
   if (!NILP (Vinvocation_directory))
     {
-      if (NILP (Vpurify_flag) && !NILP (Ffboundp (Qfile_truename)))
-        Vinvocation_directory = call1 (Qfile_truename, Vinvocation_directory);
-
       dir = Vinvocation_directory;
 #ifdef WINDOWSNT
       /* If we are running from the build directory, set DIR to the
@@ -490,8 +487,15 @@ init_cmdargs (int argc, char **argv, int skip_args, char const *original_pwd)
       if (SBYTES (dir) > sizeof ("/i386/") - 1
 	  && 0 == strcmp (SSDATA (dir) + SBYTES (dir) - sizeof ("/i386/") + 1,
 			  "/i386/"))
-	dir = Fexpand_file_name (build_string ("../.."), dir);
-#else  /* !WINDOWSNT */
+	{
+	  if (NILP (Vpurify_flag))
+	    {
+	      Lisp_Object file_truename = intern ("file-truename");
+	      if (!NILP (Ffboundp (file_truename)))
+		dir = call1 (file_truename, dir);
+	    }
+	  dir = Fexpand_file_name (build_string ("../.."), dir);
+	}
 #endif
       name = Fexpand_file_name (Vinvocation_name, dir);
       while (1)
diff --git a/src/lread.c b/src/lread.c
index 99e0ce30ba..4f3446b09d 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1999,11 +1999,10 @@ readevalloop (Lisp_Object readcharfun,
 	    (NILP (lex_bound) || EQ (lex_bound, Qunbound)
 	     ? Qnil : list1 (Qt)));
 
-  /* Try to ensure sourcename is a truename, except whilst preloading.  */
+  /* Ensure sourcename is absolute, except whilst preloading.  */
   if (!will_dump_p ()
-      && !NILP (sourcename) && !NILP (Ffile_name_absolute_p (sourcename))
-      && !NILP (Ffboundp (Qfile_truename)))
-    sourcename = call1 (Qfile_truename, sourcename) ;
+      && !NILP (sourcename) && !NILP (Ffile_name_absolute_p (sourcename)))
+    sourcename = Fexpand_file_name (sourcename, Qnil);
 
   LOADHIST_ATTACH (sourcename);
 
@@ -4678,9 +4677,6 @@ load_path_default (void)
 void
 init_lread (void)
 {
-  if (NILP (Vpurify_flag) && !NILP (Ffboundp (Qfile_truename)))
-    Vsource_directory = call1 (Qfile_truename, Vsource_directory);
-
   /* First, set Vload_path.  */
 
   /* Ignore EMACSLOADPATH when dumping.  */
@@ -5100,7 +5096,6 @@ this variable will become obsolete.  */);
   DEFSYM (Qload, "load");
   DEFSYM (Qload_file_name, "load-file-name");
   DEFSYM (Qeval_buffer_list, "eval-buffer-list");
-  DEFSYM (Qfile_truename, "file-truename");
   DEFSYM (Qdir_ok, "dir-ok");
   DEFSYM (Qdo_after_load_evaluation, "do-after-load-evaluation");
 
-- 
2.17.1


  parent reply	other threads:[~2019-09-19  6:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-18  9:02 bug#37445: 27.0.50; Permission denied after make install Tino Calancha
2019-09-18 19:12 ` Paul Eggert
2019-09-19  6:57 ` Paul Eggert [this message]
2019-09-19 11:35   ` Tino Calancha
2019-09-19 17:41     ` Paul Eggert
2019-09-20  6:07       ` Tino Calancha
2019-09-20  7:00         ` Eli Zaretskii
2019-09-20  9:10         ` Paul Eggert
2019-09-20 12:40           ` Eli Zaretskii
2019-09-20 18:17             ` Paul Eggert
2019-09-20 18:59               ` Eli Zaretskii
2019-09-20 19:33                 ` Paul Eggert
2019-09-21  6:07                   ` Eli Zaretskii
2019-09-26 20:11                     ` Paul Eggert

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=f74a7399-8d94-03ee-5e98-760e47a91f5d@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=37445-done@debbugs.gnu.org \
    --cc=tino.calancha@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.