From unknown Wed Jun 25 10:51:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#27871 <27871@debbugs.gnu.org> To: bug#27871 <27871@debbugs.gnu.org> Subject: Status: 26.0.50; Bad handling of unmounted directory Reply-To: bug#27871 <27871@debbugs.gnu.org> Date: Wed, 25 Jun 2025 17:51:04 +0000 retitle 27871 26.0.50; Bad handling of unmounted directory reassign 27871 emacs submitter 27871 Philipp severity 27871 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Jul 29 17:07:14 2017 Received: (at submit) by debbugs.gnu.org; 29 Jul 2017 21:07:14 +0000 Received: from localhost ([127.0.0.1]:33426 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbYx8-00039K-EW for submit@debbugs.gnu.org; Sat, 29 Jul 2017 17:07:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39823) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dbYx6-000395-Is for submit@debbugs.gnu.org; Sat, 29 Jul 2017 17:07:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbYx0-0005Ld-2c for submit@debbugs.gnu.org; Sat, 29 Jul 2017 17:07:07 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52447) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dbYwz-0005LZ-VG for submit@debbugs.gnu.org; Sat, 29 Jul 2017 17:07:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dbYwy-0007PY-Gx for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2017 17:07:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dbYwx-0005Jk-7a for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2017 17:07:04 -0400 Received: from mail-wr0-x231.google.com ([2a00:1450:400c:c0c::231]:37152) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dbYww-0005Il-Uk for bug-gnu-emacs@gnu.org; Sat, 29 Jul 2017 17:07:03 -0400 Received: by mail-wr0-x231.google.com with SMTP id 33so109409191wrz.4 for ; Sat, 29 Jul 2017 14:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=Br8Vggggdcq7f7Dxg7RhERvZgPJFQcn0v5aMWUsYsQo=; b=bK5W5U9N0mMDlaoDCIXXWKvWmvkIqEOqs2SSBbzS7/pOeK5RlGcxW2BJmtjdpWB6qa 64J6qTCRcxoDsX42fP4uYGOdh9CT1wVIqQtZk1Y6kC+GWHn5+LxkPeNRz77HqqoK+OjC xTVc5lNxCbnTp7NcgU5UhZph4Ba4a/gYbQntpc0BsEjLHkuUwXte3w2Bru2iK+HzlHMf sHSCfHJznZgDLyTYJpNrKoHfcUnPaiYZxHhTzdHGlqtqyUNWOyrZMMfUK9xo5fcHqs2L td9dHOptqhyWPshwyy7Tt5PHNRvDWKg4i8tq3JcLlbHsRMDPhwaYtqqkMz7L62Sh6zNh xqPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=Br8Vggggdcq7f7Dxg7RhERvZgPJFQcn0v5aMWUsYsQo=; b=IsC4SudA9Vxsol5wAMLi83nnCm/HUu2v/AfirkS+rqEGFS+b0RAIfZmzs/Kje6rvj2 tiHalLxdgPXc8jbrZ7mF8cRiglaljj0/iSCuwcqfAHNE9e8bTwxi00twSy40mhwpCyQv ax3zm4CmFFe69Hn8INZtjTdbKiMCbJcwXFsjStyBHLZJg4pIqyOTXVHqYdlacIUx9t1U OcdbrTdGmRDNlNivIIt48FTDCHwYMTy9hBICpFotJPbpN/ozVXdWokFhaEAaj1v58hBX FqkWwozMSpHzhCHaHNQSOFs2FKzha0CNTnT9g3Sat0AcJ0CSvJNjbiwxmd0OxNVGjNhU sxlA== X-Gm-Message-State: AIVw113oCqlHa6kDnBJUQ2drudzPxwdhcV8IyvwxO6Xc3+hhFbkF6Vn+ SfFGbkAoivtITrhU8hk= X-Received: by 10.223.169.45 with SMTP id u42mr8325023wrc.281.1501362420063; Sat, 29 Jul 2017 14:07:00 -0700 (PDT) Received: from phst-glaptop ([2001:4c50:256:ae00:ec0e:b536:977b:3ff8]) by smtp.gmail.com with ESMTPSA id p140sm21545410wmb.28.2017.07.29.14.06.59 for (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 29 Jul 2017 14:06:59 -0700 (PDT) From: Philipp To: bug-gnu-emacs@gnu.org Subject: 26.0.50; Bad handling of unmounted directory Date: Sat, 29 Jul 2017 23:06:32 +0200 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -3.8 (---) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.8 (---) Create a FUSE mount point, e.g. cd /tmp mkdir a a/a b touch a/a/a bindfs -f a b While bindfs(1) is running, cd to the mounted directory in a second shell: cd /tmp/b/a Now kill bindfs, e.g. by hitting ^C in the first shell. The second shell will now be in an unmounted directory. From that directory, start Emacs: $ emacs -Q -batch a Apparent cycle of symbolic links for (unreachable) or, with stack trace $ emacs -Q -batch -f toggle-debug-on-error a Debug on Error enabled globally ... file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)" (-1) (nil)) file-truename("(unreachable)/a" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)/a" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)/a/(unreachable)" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/(unreachable)" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/(unreachable)/a" (-1) (nil)) file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/(unreachable)/a/a") find-file-noselect("(unreachable)/a/(unreachable)/a/a") #f(compiled-function (displayable-buffers dir line column name) #)((nil) "(unreachable)/a/" (0) (0) "a") command-line-1(("-f" "toggle-debug-on-error" "a")) command-line() normal-top-level() It seems like the logic for `default-directory' and/or `file-truename' should be improved for unmounted filesystems. In GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2017-07-29 built on unknown Repository revision: 2c930d15f541761422a268cd2b5a7f5c11c9a00e Windowing system distributor 'The X.Org Foundation', version 11.0.11803000 System Description: Ubuntu 14.04.5 LTS Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Configured using: 'configure --with-modules --without-pop --with-mailutils --enable-checking --enable-check-lisp-object-type --enable-gcc-warnings 'CFLAGS=-ggdb3 -O0'' Configured features: XPM JPEG TIFF GIF PNG SOUND GSETTINGS NOTIFY GNUTLS FREETYPE XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 MODULES Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message subr-x puny seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib dired dired-loaddefs format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote inotify dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 94115 11926) (symbols 48 20077 1) (miscs 40 38 119) (strings 32 28435 1945) (string-bytes 1 754739) (vectors 16 13893) (vector-slots 8 487465 12899) (floats 8 48 97) (intervals 56 205 0) (buffers 992 11) (heap 1024 19129 984)) From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 06:19:38 2017 Received: (at 27871) by debbugs.gnu.org; 23 Sep 2017 10:19:38 +0000 Received: from localhost ([127.0.0.1]:53515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvhX8-00029M-6L for submit@debbugs.gnu.org; Sat, 23 Sep 2017 06:19:38 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:47909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvhX6-000299-JC for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 06:19:37 -0400 Received: by mail-oi0-f47.google.com with SMTP id b1so1526645oih.4 for <27871@debbugs.gnu.org>; Sat, 23 Sep 2017 03:19:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=4OTBYULu/1GOxDk8QW41dKufdF9iOBPGYG1VEWBRNv4=; b=hydBsUpZa2TcwhsTE4nvas9o//la77F+bURG/9mL/xPtyP+zZacNTahdoKMmZVIYEe zxSgxHAPFgr9upWrQOeMNc8XYE4Hihi0vVgVuag3XZbl6mdQdNd+uLx5R3RBgBO5arx5 ZwQMv4L0aN0ARQrzyPc8tD8QcAeY/lvmyyzMfirXRkKLUe31uLBqHY7/dNDHdN5wS8uZ 4Xe9jfCBDSyTWSHC25SG81LG0i6j1e8NN90aizWUGONPjaFIQT3UpuIPJ5u3m80Sop8x XL8tXYlWEJn+e64RTAx9huB4cwCjZjxq8r5b/TiqrZVnYplwH0Yhflu5P0NltZsHnA6a qf+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=4OTBYULu/1GOxDk8QW41dKufdF9iOBPGYG1VEWBRNv4=; b=mqMtskC6vMPgoT70usscI5hdpHXRD7v6ntwk2a99H84A/F/z0ilLx5fDF6Ce3sIRJ8 0Ui5GQp1nxhk74KttuWpt2RutfcMl3vmL7HzzyKbdQW5UsWUxiQX1J5+aJkmTnn88dxL ZavcpoBdfbJOUk1CA9XZd3fN/On1FJ2d8H7GpE7qTs1N7GWd8R3IyRsJJ0LCMvejN3hD 3/aYYAJZIECsMIOKQDop7NjPpnvgqXlJAPv7Um9thXHzeTx2IgHUaYRFE4pUAK9isGZG zq6z97R4nrF5K24gKtKG6DnctYAMKJ18ysfz+Fopa9AqxCEXcPhDIntsDDRs3dYTu/55 zlDQ== X-Gm-Message-State: AHPjjUiYi9iGqdaUAM351GTeRoz4F92gkcsFOCcvEGDNZnGWhcjcsz7l 0hv/2lYlI7bChuDjcfpS1p/1Pdx5OQy8se6V89wKpA== X-Google-Smtp-Source: AOwi7QAz/BYfD2xJyucVEmVdEbfz0Vs5USkaHAz6MLDkVUEmYAUndaVtnWb+gNpM+ILnsMFSN9vkiWAufsSG/+LZaiE= X-Received: by 10.202.66.196 with SMTP id p187mr1928008oia.52.1506161970826; Sat, 23 Sep 2017 03:19:30 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Philipp Stephani Date: Sat, 23 Sep 2017 10:19:19 +0000 Message-ID: Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory To: 27871@debbugs.gnu.org Content-Type: multipart/mixed; boundary="001a113d688c3ef7e00559d8a934" X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 27871 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) --001a113d688c3ef7e00559d8a934 Content-Type: multipart/alternative; boundary="001a113d688c3ef7db0559d8a932" --001a113d688c3ef7db0559d8a932 Content-Type: text/plain; charset="UTF-8" Philipp schrieb am Sa., 29. Juli 2017 um 23:08 Uhr: > > Create a FUSE mount point, e.g. > > cd /tmp > mkdir a a/a b > touch a/a/a > bindfs -f a b > > While bindfs(1) is running, cd to the mounted directory in a second > shell: > > cd /tmp/b/a > > Now kill bindfs, e.g. by hitting ^C in the first shell. The second > shell will now be in an unmounted directory. From that directory, start > Emacs: > > $ emacs -Q -batch a > Apparent cycle of symbolic links for (unreachable) > > or, with stack trace > > $ emacs -Q -batch -f toggle-debug-on-error a > Debug on Error enabled globally > ... > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)/a/(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a/(unreachable)/a" (-1) (nil)) > file-truename("(unreachable)/a/(unreachable)/a/(unreachable)" (-1) (nil)) > file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a" (-1) > (nil)) > > file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/(unreachable)" > (-1) (nil)) > > file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/(unreachable)/a" > (-1) (nil)) > > file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/(unreachable)/a/a") > find-file-noselect("(unreachable)/a/(unreachable)/a/a") > #f(compiled-function (displayable-buffers dir line column name) > #)((nil) "(unreachable)/a/" (0) (0) "a") > command-line-1(("-f" "toggle-debug-on-error" "a")) > command-line() > normal-top-level() > > It seems like the logic for `default-directory' and/or `file-truename' > should be improved for unmounted filesystems. > > Here's a patch. With the patch, the output is Error getting directory: Transport endpoint is not connected Warning (initialization): Error setting default-directory Ignoring relative file name (a) due to nil default-directory --001a113d688c3ef7db0559d8a932 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Philip= p <p.stephani2@gmail.com>= ; schrieb am Sa., 29. Juli 2017 um 23:08=C2=A0Uhr:

Create a FUSE mount point, e.g.

cd /tmp
mkdir a a/a b
touch a/a/a
bindfs -f a b

While bindfs(1) is running, cd to the mounted directory in a second
shell:

cd /tmp/b/a

Now kill bindfs, e.g. by hitting ^C in the first shell.=C2=A0 The second shell will now be in an unmounted directory.=C2=A0 From that directory, sta= rt
Emacs:

$ emacs -Q -batch a
Apparent cycle of symbolic links for (unreachable)

or, with stack trace

$ emacs -Q -batch -f toggle-debug-on-error a
Debug on Error enabled globally
...
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a/(unreachable)" (-1) (nil))<= br> =C2=A0 file-truename("(unreachable)/a/(unreachable)/a" (-1) (nil)= )
=C2=A0 file-truename("(unreachable)/a/(unreachable)/a/(unreachable)&qu= ot; (-1) (nil))
=C2=A0 file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a&= quot; (-1) (nil))
=C2=A0 file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/= (unreachable)" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/= (unreachable)/a" (-1) (nil))
=C2=A0 file-truename("(unreachable)/a/(unreachable)/a/(unreachable)/a/= (unreachable)/a/a")
=C2=A0 find-file-noselect("(unreachable)/a/(unreachable)/a/a") =C2=A0 #f(compiled-function (displayable-buffers dir line column name) #<= ;bytecode>)((nil) "(unreachable)/a/" (0) (0) "a") =C2=A0 command-line-1(("-f" "toggle-debug-on-error" &qu= ot;a"))
=C2=A0 command-line()
=C2=A0 normal-top-level()

It seems like the logic for `default-directory' and/or `file-truename&#= 39;
should be improved for unmounted filesystems.


Here's a patch. With the patch, the ou= tput is

=C2=A0Error getting directory: Transport e= ndpoint is not connected
Warning (initialization): Error setting = default-directory
Ignoring relative file name (a) due to nil defa= ult-directory

--001a113d688c3ef7db0559d8a932-- --001a113d688c3ef7e00559d8a934 Content-Type: text/plain; charset="US-ASCII"; name="0001-Treat-unreachable-current-directory-as-error.txt" Content-Disposition: attachment; filename="0001-Treat-unreachable-current-directory-as-error.txt" Content-Transfer-Encoding: base64 Content-ID: <15eae3f12829b4675fb1> X-Attachment-Id: 15eae3f12829b4675fb1 RnJvbSBiMzU0MWIzYmM5MzZiYmI4ZTk5NTBkMWFlZDE0ZDI1NzFlMDNjMWZlIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh dGU6IFNhdCwgMjMgU2VwIDIwMTcgMTI6MTM6MzkgKzAyMDAKU3ViamVjdDogW1BBVENIXSBUcmVh dCB1bnJlYWNoYWJsZSBjdXJyZW50IGRpcmVjdG9yeSBhcyBlcnJvcgoKTGludXggcHJlZml4ZXMg YW4gdW5yZWFjaGFibGUgKGUuZy4gdW5tb3VudGVkKSBjdXJyZW50IGRpcmVjdG9yeSB3aXRoCnRo ZSBzcGVjaWFsIHN0cmluZyAiKHVucmVhY2hhYmxlKSIsIGNmLiBCdWcjMjc4NzEuICBUcmVhdCBz dWNoCmRpcmVjdG9yaWVzIGFzIGVycm9yIGJlY2F1c2UgdGhleSB3b3VsZG4ndCB3b3JrIGFueXdh eS4KCiogc3JjL3N5c2RlcC5jIChlbWFjc19nZXRfY3VycmVudF9kaXJfbmFtZV8xKTogUmVuYW1l ZCBmcm9tCmVtYWNzX2dldF9jdXJyZW50X2Rpcl9uYW1lLgooZW1hY3NfZ2V0X2N1cnJlbnRfZGly X25hbWUpOiBDaGVjayBmb3IgcHJlZml4ICIodW5yZWFjaGFibGUpIi4KLS0tCiBzcmMvc3lzZGVw LmMgfCAyOSArKysrKysrKysrKysrKysrKysrKysrKysrLS0tLQogMSBmaWxlIGNoYW5nZWQsIDI1 IGluc2VydGlvbnMoKyksIDQgZGVsZXRpb25zKC0pCgpkaWZmIC0tZ2l0IGEvc3JjL3N5c2RlcC5j IGIvc3JjL3N5c2RlcC5jCmluZGV4IDFlNmUwZDAxMWIuLjZjNzZmMTYyNDIgMTAwNjQ0Ci0tLSBh L3NyYy9zeXNkZXAuYworKysgYi9zcmMvc3lzZGVwLmMKQEAgLTIyMCwxMCArMjIwLDggQEAgaW5p dF9zdGFuZGFyZF9mZHMgKHZvaWQpCiAgIGZvcmNlX29wZW4gKFNUREVSUl9GSUxFTk8sIE9fUkRP TkxZKTsKIH0KIAotLyogUmV0dXJuIHRoZSBjdXJyZW50IHdvcmtpbmcgZGlyZWN0b3J5LiAgVGhl IHJlc3VsdCBzaG91bGQgYmUgZnJlZWQKLSAgIHdpdGggJ2ZyZWUnLiAgUmV0dXJuIE5VTEwgb24g ZXJyb3JzLiAgKi8KLWNoYXIgKgotZW1hY3NfZ2V0X2N1cnJlbnRfZGlyX25hbWUgKHZvaWQpCitz dGF0aWMgY2hhciAqCitlbWFjc19nZXRfY3VycmVudF9kaXJfbmFtZV8xICh2b2lkKQogewogIyBp ZiBIQVZFX0dFVF9DVVJSRU5UX0RJUl9OQU1FICYmICFCUk9LRU5fR0VUX0NVUlJFTlRfRElSX05B TUUKICMgIGlmZGVmIEhZQlJJRF9NQUxMT0MKQEAgLTI4Myw2ICsyODEsMjkgQEAgZW1hY3NfZ2V0 X2N1cnJlbnRfZGlyX25hbWUgKHZvaWQpCiAgIHJldHVybiBidWY7CiB9CiAKKy8qIFJldHVybiB0 aGUgY3VycmVudCB3b3JraW5nIGRpcmVjdG9yeS4gIFRoZSByZXN1bHQgc2hvdWxkIGJlIGZyZWVk CisgICB3aXRoICdmcmVlJy4gIFJldHVybiBOVUxMIG9uIGVycm9ycy4gICovCitjaGFyICoKK2Vt YWNzX2dldF9jdXJyZW50X2Rpcl9uYW1lICh2b2lkKQoreworICBjaGFyICpkaXIgPSBlbWFjc19n ZXRfY3VycmVudF9kaXJfbmFtZV8xICgpOworICBpZiAoZGlyID09IE5VTEwpCisgICAgcmV0dXJu IE5VTEw7CisgIC8qIE9uIExpbnV4LCBnZXRjd2QgYW5kIGdldF9jdXJyZW50X2Rpcl9uYW1lIHJl dHVybiBhIHN0cmluZworICAgICBzdGFydGluZyB3aXRoICIodW5yZWFjaGFibGUpIiBpZiB0aGUg Y3VycmVudCBkaXJlY3RvcnkgZG9lc24ndAorICAgICBleGlzdCwgZS5nLiBiZWNhdXNlIGl0IHdh cyB1bm1vdW50ZWQuICBUcmVhdCB0aGF0IGFzIGFuIGVycm9yLgorICAgICBTZWUgaHR0cHM6Ly9k ZWJidWdzLmdudS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTI3ODcxLiAgKi8KKyAgY29uc3Qg Y2hhciAqcHJlZml4ID0gIih1bnJlYWNoYWJsZSkiOworICBzaXplX3QgZGlyX2xlbiA9IHN0cmxl biAoZGlyKTsKKyAgc2l6ZV90IHByZWZpeF9sZW4gPSBzdHJsZW4gKHByZWZpeCk7CisgIGlmIChk aXJfbGVuID49IHByZWZpeF9sZW4gJiYgc3RybmNtcCAoZGlyLCBwcmVmaXgsIHByZWZpeF9sZW4p ID09IDApCisgICAgeworICAgICAgZXJybm8gPSBFTk9UQ09OTjsKKyAgICAgIHJldHVybiBOVUxM OworICAgIH0KKyAgcmV0dXJuIGRpcjsKK30KKwogDAogLyogRGlzY2FyZCBwZW5kaW5nIGlucHV0 IG9uIGFsbCBpbnB1dCBkZXNjcmlwdG9ycy4gICovCiAKLS0gCjIuMTQuMS44MjEuZzhmYTY4NWQz YjctZ29vZwoK --001a113d688c3ef7e00559d8a934-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 06:39:49 2017 Received: (at 27871) by debbugs.gnu.org; 23 Sep 2017 10:39:49 +0000 Received: from localhost ([127.0.0.1]:53528 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvhqf-0002hw-1o for submit@debbugs.gnu.org; Sat, 23 Sep 2017 06:39:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:60020) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvhqd-0002hj-J0 for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 06:39:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvhqT-00033J-AU for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 06:39:42 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34718) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvhqT-00033C-7F; Sat, 23 Sep 2017 06:39:37 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2136 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dvhqR-00040z-Np; Sat, 23 Sep 2017 06:39:37 -0400 Date: Sat, 23 Sep 2017 13:39:29 +0300 Message-Id: <83a81lbswu.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sat, 23 Sep 2017 10:19:19 +0000) Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27871 Cc: 27871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sat, 23 Sep 2017 10:19:19 +0000 > > Here's a patch. With the patch, the output is > > Error getting directory: Transport endpoint is not connected > Warning (initialization): Error setting default-directory > Ignoring relative file name (a) due to nil default-directory Thanks. > +/* Return the current working directory. The result should be freed > + with 'free'. Return NULL on errors. */ > +char * > +emacs_get_current_dir_name (void) > +{ > + char *dir = emacs_get_current_dir_name_1 (); > + if (dir == NULL) > + return NULL; > + /* On Linux, getcwd and get_current_dir_name return a string > + starting with "(unreachable)" if the current directory doesn't > + exist, e.g. because it was unmounted. Treat that as an error. > + See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27871. */ > + const char *prefix = "(unreachable)"; > + size_t dir_len = strlen (dir); > + size_t prefix_len = strlen (prefix); > + if (dir_len >= prefix_len && strncmp (dir, prefix, prefix_len) == 0) > + { > + errno = ENOTCONN; > + return NULL; What if there's a directory called literally "(unreachable)SOMETHING"? This isn't disallowed on GNU/Linux, is it? We should probably stat the result if we see this prefix, before we declare it a failure, IMO. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 07:30:56 2017 Received: (at 27871) by debbugs.gnu.org; 23 Sep 2017 11:30:56 +0000 Received: from localhost ([127.0.0.1]:53559 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvie8-0004sh-Dt for submit@debbugs.gnu.org; Sat, 23 Sep 2017 07:30:56 -0400 Received: from mail-out.m-online.net ([212.18.0.9]:35036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvie7-0004qo-8W for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 07:30:55 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3xzp7f00tsz1qs0B; Sat, 23 Sep 2017 13:30:53 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3xzp7d6b5mz1qqkB; Sat, 23 Sep 2017 13:30:53 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 9dWz0hqyOsWX; Sat, 23 Sep 2017 13:30:52 +0200 (CEST) X-Auth-Info: Asr2yjnOFfJKcMUAbQ1LPgf7eTqwtLUAKbxB35lmV5S6Wi4E/lUjoOYAdKyegO+v Received: from igel.home (ppp-88-217-7-222.dynamic.mnet-online.de [88.217.7.222]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Sat, 23 Sep 2017 13:30:52 +0200 (CEST) Received: by igel.home (Postfix, from userid 1000) id 90FD32C39A8; Sat, 23 Sep 2017 13:30:51 +0200 (CEST) From: Andreas Schwab To: Eli Zaretskii Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory References: <83a81lbswu.fsf@gnu.org> X-Yow: A shapely CATHOLIC SCHOOLGIRL is FIDGETING inside my costume.. Date: Sat, 23 Sep 2017 13:30:51 +0200 In-Reply-To: <83a81lbswu.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 23 Sep 2017 13:39:29 +0300") Message-ID: <87r2uxejo4.fsf@linux-m68k.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 27871 Cc: Philipp Stephani , 27871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) On Sep 23 2017, Eli Zaretskii wrote: >> +/* Return the current working directory. The result should be freed >> + with 'free'. Return NULL on errors. */ >> +char * >> +emacs_get_current_dir_name (void) >> +{ >> + char *dir = emacs_get_current_dir_name_1 (); >> + if (dir == NULL) >> + return NULL; >> + /* On Linux, getcwd and get_current_dir_name return a string >> + starting with "(unreachable)" if the current directory doesn't >> + exist, e.g. because it was unmounted. Treat that as an error. >> + See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27871. */ >> + const char *prefix = "(unreachable)"; >> + size_t dir_len = strlen (dir); >> + size_t prefix_len = strlen (prefix); >> + if (dir_len >= prefix_len && strncmp (dir, prefix, prefix_len) == 0) >> + { >> + errno = ENOTCONN; >> + return NULL; > > What if there's a directory called literally "(unreachable)SOMETHING"? An absolute file name cannot start with "(unreachable)". Andreas. -- Andreas Schwab, schwab@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different." From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 07:33:31 2017 Received: (at 27871) by debbugs.gnu.org; 23 Sep 2017 11:33:31 +0000 Received: from localhost ([127.0.0.1]:53563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvigc-0005qM-Tl for submit@debbugs.gnu.org; Sat, 23 Sep 2017 07:33:31 -0400 Received: from mail-oi0-f48.google.com ([209.85.218.48]:52613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvigb-0005q9-Mo for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 07:33:30 -0400 Received: by mail-oi0-f48.google.com with SMTP id p126so1639195oih.9 for <27871@debbugs.gnu.org>; Sat, 23 Sep 2017 04:33:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aahdP2oC0xkICaJ8856OoOR9Bkd/t5mUql5ny69snPU=; b=ojsonWlCzPdgJi+ycXunwg5E2Nm/lWbPW3NSuqA0TIZKr/Py83vcrsAMysrG5F3PrX vBfh+8dxm6sDhy8A3qCIcYqmoxtjRFFYE1cAg+XWY3676FgzU0iLGNumdT282osdjO1c 3EAc//JzrqorchZcC18nhqZDgFOtL/v3VaQV3UgAwTKCzOmi6t1cIlfCoCIkCJ8G4Cja FNgMkqx57s0z/MaXWXkFettp2cHF9cX30mY2he0ijMWvF1yHrcGGfqo+nTnKN76Zpb9U kAJToB+SMPeOPhsKqef3N4SctjkGuPxjupedfj+u6jgrsKmgy41OjO12eucH4hoS2S62 W/0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=aahdP2oC0xkICaJ8856OoOR9Bkd/t5mUql5ny69snPU=; b=aYtkUrgcVZPOuIQd6GutTNSETvzgjYdATj7TziStHU7e2KIIay/eLrHot/1fcEep6D KLVAc4P/ZDfeHfSCx2w4cEAApsnwmdeXxcCVUNP550ua27CfY6gxEnZf8vN0eyo5H8ix F9PBq1QiIgmv2h8qbqFciBpB/2dnOnkwqMwRvjucmvfnzqlnONjOLNQpHJKzPHqlFSKX aXpmGLq/HTY8Kqk82la3KVpPR3DCQOY9tXc8rBU5CI6i3/YcqXNMN740uNFo8QicoT2e PeqrzJpKsRVXP+HUEB3+D7V13jxkUcv7lBYE95AgTtAAhqb7i+qHEINidPDLxXY/NGqA K67A== X-Gm-Message-State: AHPjjUj3O7A12tVheY/+v/iu/mykXWSI/NcFFwmDKkm4a/GW/JZxPH3s V50fyU6QlQ+9ymKCIUf9htKSekhSiHg5Mqmf6No= X-Google-Smtp-Source: AOwi7QDWZz6b+R/MwaPUdk0ih2NqI4tNK14o1/ZGh0DiLu81Kbz/xPXomwmq2EkrPLZQJXieicMhxMiYYN7640jMU+k= X-Received: by 10.202.56.214 with SMTP id f205mr1340577oia.316.1506166404043; Sat, 23 Sep 2017 04:33:24 -0700 (PDT) MIME-Version: 1.0 References: <83a81lbswu.fsf@gnu.org> <87r2uxejo4.fsf@linux-m68k.org> In-Reply-To: <87r2uxejo4.fsf@linux-m68k.org> From: Philipp Stephani Date: Sat, 23 Sep 2017 11:33:13 +0000 Message-ID: Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory To: Andreas Schwab , Eli Zaretskii Content-Type: multipart/alternative; boundary="001a113ca93a7c59090559d9b121" X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 27871 Cc: 27871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) --001a113ca93a7c59090559d9b121 Content-Type: text/plain; charset="UTF-8" Andreas Schwab schrieb am Sa., 23. Sep. 2017 um 13:30 Uhr: > On Sep 23 2017, Eli Zaretskii wrote: > > >> +/* Return the current working directory. The result should be freed > >> + with 'free'. Return NULL on errors. */ > >> +char * > >> +emacs_get_current_dir_name (void) > >> +{ > >> + char *dir = emacs_get_current_dir_name_1 (); > >> + if (dir == NULL) > >> + return NULL; > >> + /* On Linux, getcwd and get_current_dir_name return a string > >> + starting with "(unreachable)" if the current directory doesn't > >> + exist, e.g. because it was unmounted. Treat that as an error. > >> + See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27871. */ > >> + const char *prefix = "(unreachable)"; > >> + size_t dir_len = strlen (dir); > >> + size_t prefix_len = strlen (prefix); > >> + if (dir_len >= prefix_len && strncmp (dir, prefix, prefix_len) == 0) > >> + { > >> + errno = ENOTCONN; > >> + return NULL; > > > > What if there's a directory called literally "(unreachable)SOMETHING"? > > An absolute file name cannot start with "(unreachable)". > > Yes, and getcwd and friends only return absolute filenames, and we only use $PWD if it's absolute, so anything except '/' or a drive letter can't be a prefix in the success case. I'll add a comment to that effect. --001a113ca93a7c59090559d9b121 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Andrea= s Schwab <schwab@linux-m68k.org= > schrieb am Sa., 23. Sep. 2017 um 13:30=C2=A0Uhr:
On Sep 23 2017, Eli Zaretskii <eliz@gnu.org> wrote:

>> +/* Return the current working directory.=C2=A0 The result should = be freed
>> +=C2=A0 =C2=A0with 'free'.=C2=A0 Return NULL on errors.=C2= =A0 */
>> +char *
>> +emacs_get_current_dir_name (void)
>> +{
>> +=C2=A0 char *dir =3D emacs_get_current_dir_name_1 ();
>> +=C2=A0 if (dir =3D=3D NULL)
>> +=C2=A0 =C2=A0 return NULL;
>> +=C2=A0 /* On Linux, getcwd and get_current_dir_name return a stri= ng
>> +=C2=A0 =C2=A0 =C2=A0starting with "(unreachable)" if th= e current directory doesn't
>> +=C2=A0 =C2=A0 =C2=A0exist, e.g. because it was unmounted.=C2=A0 T= reat that as an error.
>> +=C2=A0 =C2=A0 =C2=A0See https://debbu= gs.gnu.org/cgi/bugreport.cgi?bug=3D27871.=C2=A0 */
>> +=C2=A0 const char *prefix =3D "(unreachable)";
>> +=C2=A0 size_t dir_len =3D strlen (dir);
>> +=C2=A0 size_t prefix_len =3D strlen (prefix);
>> +=C2=A0 if (dir_len >=3D prefix_len && strncmp (dir, pr= efix, prefix_len) =3D=3D 0)
>> +=C2=A0 =C2=A0 {
>> +=C2=A0 =C2=A0 =C2=A0 errno =3D ENOTCONN;
>> +=C2=A0 =C2=A0 =C2=A0 return NULL;
>
> What if there's a directory called literally "(unreachable)SO= METHING"?

An absolute file name cannot start with "(unreachable)".


Yes, and getcwd and friends only retur= n absolute filenames, and we only use $PWD if it's absolute, so anythin= g except '/' or a drive letter can't be a prefix in the success= case. I'll add a comment to that effect.=C2=A0
--001a113ca93a7c59090559d9b121-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 07:38:52 2017 Received: (at 27871) by debbugs.gnu.org; 23 Sep 2017 11:38:53 +0000 Received: from localhost ([127.0.0.1]:53567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvilo-0005xq-JD for submit@debbugs.gnu.org; Sat, 23 Sep 2017 07:38:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40667) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dviln-0005xd-0o for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 07:38:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvild-0002FC-W7 for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 07:38:45 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35111) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvild-0002F8-ST; Sat, 23 Sep 2017 07:38:41 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2308 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dvild-0000hE-7v; Sat, 23 Sep 2017 07:38:41 -0400 Date: Sat, 23 Sep 2017 14:38:38 +0300 Message-Id: <837ewpbq69.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Sat, 23 Sep 2017 11:33:13 +0000) Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory References: <83a81lbswu.fsf@gnu.org> <87r2uxejo4.fsf@linux-m68k.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27871 Cc: 27871@debbugs.gnu.org, schwab@linux-m68k.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Philipp Stephani > Date: Sat, 23 Sep 2017 11:33:13 +0000 > Cc: 27871@debbugs.gnu.org > > > What if there's a directory called literally "(unreachable)SOMETHING"? > > An absolute file name cannot start with "(unreachable)". > > Yes, and getcwd and friends only return absolute filenames, and we only use $PWD if it's absolute, so > anything except '/' or a drive letter can't be a prefix in the success case. I'll add a comment to that effect. Then why not just check that the first character is something other than '/'? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 23 07:41:50 2017 Received: (at 27871) by debbugs.gnu.org; 23 Sep 2017 11:41:50 +0000 Received: from localhost ([127.0.0.1]:53571 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dviog-00062G-5D for submit@debbugs.gnu.org; Sat, 23 Sep 2017 07:41:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:41571) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dvioe-000622-31 for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 07:41:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dvioV-0003HH-TC for 27871@debbugs.gnu.org; Sat, 23 Sep 2017 07:41:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35147) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dvioV-0003H2-P6; Sat, 23 Sep 2017 07:41:39 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2314 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dvioV-00050q-4S; Sat, 23 Sep 2017 07:41:39 -0400 Date: Sat, 23 Sep 2017 14:41:36 +0300 Message-Id: <8360c9bq1b.fsf@gnu.org> From: Eli Zaretskii To: p.stephani2@gmail.com, schwab@linux-m68k.org In-reply-to: <837ewpbq69.fsf@gnu.org> (message from Eli Zaretskii on Sat, 23 Sep 2017 14:38:38 +0300) Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory References: <83a81lbswu.fsf@gnu.org> <87r2uxejo4.fsf@linux-m68k.org> <837ewpbq69.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27871 Cc: 27871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Eli Zaretskii > Cc: schwab@linux-m68k.org, 27871@debbugs.gnu.org > > Then why not just check that the first character is something other > than '/'? Or, more general, that the result fails file_name_absolute_p (which would be more portable)? From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 30 14:49:40 2017 Received: (at 27871) by debbugs.gnu.org; 30 Sep 2017 18:49:40 +0000 Received: from localhost ([127.0.0.1]:41437 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyMpY-00051i-HQ for submit@debbugs.gnu.org; Sat, 30 Sep 2017 14:49:40 -0400 Received: from mail-oi0-f51.google.com ([209.85.218.51]:56891) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyMpX-00051S-BA for 27871@debbugs.gnu.org; Sat, 30 Sep 2017 14:49:39 -0400 Received: by mail-oi0-f51.google.com with SMTP id m198so1882996oig.13 for <27871@debbugs.gnu.org>; Sat, 30 Sep 2017 11:49:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4OWfpmy3WgpY/q3KxNLIQ2RT48p9iTHEtcxCRq8XKVU=; b=slquS59Bsyz5opXP/25audtiryRueNgnC+EgdGPdaHDuCjluBQzPT8yhV/PqBhOqpB zkBkqh2/o6fykzzcRJAJuxA2bDj+BEHHVMLWPDcsD6oUpl13YLDRUmROpMVkcbygxfJ7 zYr/pF/r9UaBBHDMuHARrM/21L/3XTcxuH0bT7S3UhW3edDyhrldHTliH2+bSpJC3G5r GyFBhQYy2p5ukl6bFAlNmSEEZHeHTvLmnClk4q7ydj6q/XBGjI854s11hUEfuS9VL8b1 D5TAMyg7eBD9WYZAkNsMPGzYfIqw+NaWulU/pojPpIRCE2JzzcQZVLYG23WQLaMBHLkA EYmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4OWfpmy3WgpY/q3KxNLIQ2RT48p9iTHEtcxCRq8XKVU=; b=fohzswbZ9f/1nRdu4idgG/eAtDuxu3Xnd6TZAhrk2sW13ffUdPhrg8Mr54pcHxwWlt VFpv3tNrxQ4Q6TtMQnS1TkheK2oCiJADfDKV3nqvp1k4lkeFUR4/LlJL1tY6uSj8UScP Q0caFdzE2D684Hikrn3wbl5HR9eaap8Du6q4YqGP7NV+Fk/+upq/HWaIJ1Ot2aPqGFPZ BNm/jTacD+LOWK2kXjYNnnN/Di3OdWtNkVpN7lZjBi4BPY+q7GJAM6TGZYWMkGQKh1+C 9OvN+n5Y6eIS2BAl4gLyZAhoqoFagfM8kL7wHXD0eSeyvhbrvHC0bYTDw7zWxNN6J4Q1 bKZw== X-Gm-Message-State: AMCzsaWA3e5oz1IGpglbv9arV9l5Xsn14SrAMv+DKKPxt0nviaY3mpBg mybJ6pkdF8pKWGwedFo9eCUqpT8G62vPCPoSMqA= X-Google-Smtp-Source: AOwi7QCAzgr2VMAFOrJpkHjgc6qa9gXFHWlJ/eKFLdH5kwbyHUrBC6GfS7kGkTEVXztAQO37klAuRGoKfRnryN4p/R8= X-Received: by 10.157.59.55 with SMTP id z52mr569402otb.75.1506797373608; Sat, 30 Sep 2017 11:49:33 -0700 (PDT) MIME-Version: 1.0 References: <83a81lbswu.fsf@gnu.org> <87r2uxejo4.fsf@linux-m68k.org> <837ewpbq69.fsf@gnu.org> <8360c9bq1b.fsf@gnu.org> In-Reply-To: <8360c9bq1b.fsf@gnu.org> From: Philipp Stephani Date: Sat, 30 Sep 2017 18:49:23 +0000 Message-ID: Subject: Re: bug#27871: 26.0.50; Bad handling of unmounted directory To: Eli Zaretskii , schwab@linux-m68k.org Content-Type: multipart/alternative; boundary="001a113779ea33d767055a6c9a27" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 27871 Cc: 27871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --001a113779ea33d767055a6c9a27 Content-Type: text/plain; charset="UTF-8" Eli Zaretskii schrieb am Sa., 23. Sep. 2017 um 13:41 Uhr: > > From: Eli Zaretskii > > Cc: schwab@linux-m68k.org, 27871@debbugs.gnu.org > > > > Then why not just check that the first character is something other > > than '/'? > > Or, more general, that the result fails file_name_absolute_p (which > would be more portable)? > Sounds reasonable, I'll send a new patch. --001a113779ea33d767055a6c9a27 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Sa., 23. Sep. 2017 um 13:41=C2=A0Uhr:
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: schwab@= linux-m68k.org, 27871@debbugs.gnu.org
>
> Then why not just check that the first character is something other > than '/'?

Or, more general, that the result fails file_name_absolute_p (which
would be more portable)?

Sounds reasona= ble, I'll send a new patch.=C2=A0
--001a113779ea33d767055a6c9a27-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 30 14:50:22 2017 Received: (at 27871) by debbugs.gnu.org; 30 Sep 2017 18:50:22 +0000 Received: from localhost ([127.0.0.1]:41441 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyMqD-00053A-Qq for submit@debbugs.gnu.org; Sat, 30 Sep 2017 14:50:22 -0400 Received: from mail-wr0-f173.google.com ([209.85.128.173]:56514) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyMqB-00052s-ON for 27871@debbugs.gnu.org; Sat, 30 Sep 2017 14:50:20 -0400 Received: by mail-wr0-f173.google.com with SMTP id r74so1487488wrb.13 for <27871@debbugs.gnu.org>; Sat, 30 Sep 2017 11:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zjI5ak+x14ewYeU+e3R3ds15Ql6Zj2BmcBjK9x5umfU=; b=Jj/FafcabMKEuFPBm2jId83x8UvYv4yM0ARBEhZ4WBckcXFz2FMpuXo5goWj92Fgs2 hglLovlNgA9c218MEKvQWXXNOV3yEVIcD4HUkQ64MpXNvEpvxoeR+b9i0EpzX4yHC5dm dZOS8MOWQzcqz/aRGib+T6NfJHNJQrnrmQNk6KdUKK/U3Xnd/xN7raNgwhfkOKHuErCb XY1UFDgJDSQykN3r7839hjt1F4hfYPdySgvXYyEJneF77lip2xmRgVwljQpykXXWew2s gBVlosMKQbpx+CSY4tMOFRLROFDdsAeNIOtlIBX1NLFvKPsoXYX8NpOwx1va0pRaa99T 1AGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zjI5ak+x14ewYeU+e3R3ds15Ql6Zj2BmcBjK9x5umfU=; b=Ie59bcVFMOWf62Bhsh8rPmuwfdViTXQnFxzClvBgg+ZOCJ5k1/t1Awl48ah3ArGEA5 oRFuAHMVusvPp+70Ep7ZkECS6fzkY29qYGtrBTuKQfc0Q9k55u+1IwjxJYo05wmPxooZ GJqs6Raq1rIy49lH9IT8VLu4z5boBae/Oqao6aSMOC4tCE62jFQBny2truiCoKuOtefl lQLCH+RkpgmLoLJ/fKu2ihgpkMzPSNptuZUeew4dO8efRi3Fiq7t7qJBDn+fq710zSkk rY46T27qGw5RCsMEQe8CJYNUETgcdXlEv0c2ofrIZ41bWgOCFYwRqQ1BtlXkP5m3bziy ZDjg== X-Gm-Message-State: AHPjjUjQVD+ND9YWn8BjzQZ4bMJa0hHaeavNbK986pwnrsRDIRfuXBbk 7xDFh9NtNdI1sZyk5jJqaac= X-Google-Smtp-Source: AOwi7QBAa5ZmgrRJIDwhNwWXBBAv0M2rUc6+BtMGJ+aa6l2O68ppAvHhC6kM4Zrf55e5ER2cNY5Aig== X-Received: by 10.223.163.18 with SMTP id c18mr10740877wrb.211.1506797413977; Sat, 30 Sep 2017 11:50:13 -0700 (PDT) Received: from p.cm.cablesurf.de (46.128.198.151.dynamic.cablesurf.de. [46.128.198.151]) by smtp.gmail.com with ESMTPSA id 6sm6883957wru.33.2017.09.30.11.50.13 (version=TLS1 cipher=AES128-SHA bits=128/128); Sat, 30 Sep 2017 11:50:13 -0700 (PDT) From: Philipp Stephani X-Google-Original-From: Philipp Stephani To: emacs-devel@gnu.org, 27871@debbugs.gnu.org Subject: [PATCH] Treat unreachable current directory as error Date: Sat, 30 Sep 2017 20:50:06 +0200 Message-Id: <20170930185006.54096-1-phst@google.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: References: X-Spam-Score: -2.0 (--) X-Debbugs-Envelope-To: 27871 Cc: Philipp Stephani X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.0 (--) Linux prefixes an unreachable (e.g. unmounted) current directory with the special string "(unreachable)", cf. Bug#27871. Treat such directories as error because they wouldn't work anyway. * src/sysdep.c (emacs_get_current_dir_name_1): Renamed from emacs_get_current_dir_name. (emacs_get_current_dir_name): Check for prefix "(unreachable)". --- src/sysdep.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index 1e6e0d011b..efc0396c93 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -220,10 +220,8 @@ init_standard_fds (void) force_open (STDERR_FILENO, O_RDONLY); } -/* Return the current working directory. The result should be freed - with 'free'. Return NULL on errors. */ -char * -emacs_get_current_dir_name (void) +static char * +emacs_get_current_dir_name_1 (void) { # if HAVE_GET_CURRENT_DIR_NAME && !BROKEN_GET_CURRENT_DIR_NAME # ifdef HYBRID_MALLOC @@ -283,6 +281,27 @@ emacs_get_current_dir_name (void) return buf; } +/* Return the current working directory. The result should be freed + with 'free'. Return NULL on errors. */ +char * +emacs_get_current_dir_name (void) +{ + char *dir = emacs_get_current_dir_name_1 (); + if (dir == NULL) + return NULL; + /* On Linux, getcwd and get_current_dir_name return a string + starting with "(unreachable)" if the current directory doesn't + exist, e.g. because it was unmounted. Treat that as an error. + See https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27871. */ + if (!file_name_absolute_p (dir)) + { + free (dir); + errno = ENOTCONN; + return NULL; + } + return dir; +} + /* Discard pending input on all input descriptors. */ -- 2.14.1 From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 30 20:00:17 2017 Received: (at 27871) by debbugs.gnu.org; 1 Oct 2017 00:00:17 +0000 Received: from localhost ([127.0.0.1]:41611 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyRg9-0006yn-7m for submit@debbugs.gnu.org; Sat, 30 Sep 2017 20:00:17 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46178) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dyRg7-0006yY-4p for 27871@debbugs.gnu.org; Sat, 30 Sep 2017 20:00:15 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0B29D16008A; Sat, 30 Sep 2017 17:00:08 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id jdQJmXcClT0K; Sat, 30 Sep 2017 17:00:07 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3F65B160AEB; Sat, 30 Sep 2017 17:00:07 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id WbhBtsAUhPc8; Sat, 30 Sep 2017 17:00:07 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.18.85]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1C2CB16008A; Sat, 30 Sep 2017 17:00:07 -0700 (PDT) Subject: Re: [PATCH] Treat unreachable current directory as error To: Philipp Stephani , 27871@debbugs.gnu.org References: <20170930185006.54096-1-phst@google.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Sat, 30 Sep 2017 17:00:06 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20170930185006.54096-1-phst@google.com> Content-Type: multipart/mixed; boundary="------------E19CBFB4322C21B426F09748" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27871 Cc: Philipp Stephani X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------E19CBFB4322C21B426F09748 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Philipp Stephani wrote: > + if (!file_name_absolute_p (dir)) That doesn't look right here, since leading '~' counts as absolute to=20 file_name_absolute_p, which is not what is wanted here. > + errno =3D ENOTCONN; Why ENOTCONN? Shouldn't it be ENOENT? The failure has nothing to do with = socket=20 connections. Also, I'd feel a bit better if we apply the workaround only to the functi= on that=20 has the problem. How about the attached patch instead? --------------E19CBFB4322C21B426F09748 Content-Type: text/x-patch; name="0001-Fix-bug-with-unmounted-directory-on-GNU-Linux.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Fix-bug-with-unmounted-directory-on-GNU-Linux.patch" =46rom a1f839b0c60fb345944ee39626e8645402c1f060 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 30 Sep 2017 16:53:54 -0700 Subject: [PATCH] Fix bug with unmounted directory on GNU/Linux * src/sysdep.c (emacs_get_current_dir_name): Do not use get_current_dir_name result unless it is absolute (Bug#27871). --- src/sysdep.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sysdep.c b/src/sysdep.c index 1e6e0d011b..a3526c3740 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -232,7 +232,18 @@ emacs_get_current_dir_name (void) bool use_libc =3D true; # endif if (use_libc) - return get_current_dir_name (); + { + /* GNU/Linux get_current_dir_name can return a string starting + with "(unreachable)" (Bug#27871). */ + char *wd =3D get_current_dir_name (); + if (wd && ! (IS_DIRECTORY_SEP (*wd) || (*wd && IS_DEVICE_SEP (wd[1= ])))) + { + free (wd); + errno =3D ENOENT; + return NULL; + } + return wd; + } # endif =20 char *buf; --=20 2.13.5 --------------E19CBFB4322C21B426F09748-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 05 06:13:27 2017 Received: (at 27871) by debbugs.gnu.org; 5 Oct 2017 10:13:27 +0000 Received: from localhost ([127.0.0.1]:49772 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e039i-0000yd-OG for submit@debbugs.gnu.org; Thu, 05 Oct 2017 06:13:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:52875) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e039h-0000yQ-GA for 27871@debbugs.gnu.org; Thu, 05 Oct 2017 06:13:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e039b-000807-IX for 27871@debbugs.gnu.org; Thu, 05 Oct 2017 06:13:20 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46351) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e039W-0007tw-Gs; Thu, 05 Oct 2017 06:13:14 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2864 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e039V-0001bh-71; Thu, 05 Oct 2017 06:13:13 -0400 Date: Thu, 05 Oct 2017 13:13:02 +0300 Message-Id: <83376xykb5.fsf@gnu.org> From: Eli Zaretskii To: Paul Eggert In-reply-to: (message from Paul Eggert on Sat, 30 Sep 2017 17:00:06 -0700) Subject: Re: bug#27871: [PATCH] Treat unreachable current directory as error References: <20170930185006.54096-1-phst@google.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 27871 Cc: phst@google.com, p.stephani2@gmail.com, 27871@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Paul Eggert > Date: Sat, 30 Sep 2017 17:00:06 -0700 > Cc: Philipp Stephani > > How about the attached patch instead? Thanks, this LGTM. I think we want this on the release branch. From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 05 19:06:27 2017 Received: (at 27871-done) by debbugs.gnu.org; 5 Oct 2017 23:06:27 +0000 Received: from localhost ([127.0.0.1]:51910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0FDn-00024X-FT for submit@debbugs.gnu.org; Thu, 05 Oct 2017 19:06:27 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:46506) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0FDl-00024J-D9 for 27871-done@debbugs.gnu.org; Thu, 05 Oct 2017 19:06:25 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id EB291160E14; Thu, 5 Oct 2017 16:06:17 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id NMNRtRPNUJR7; Thu, 5 Oct 2017 16:06:17 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 429F0160E1F; Thu, 5 Oct 2017 16:06:17 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id TIIx2FqhINk0; Thu, 5 Oct 2017 16:06:17 -0700 (PDT) Received: from Penguin.CS.UCLA.EDU (Penguin.CS.UCLA.EDU [131.179.64.200]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 298D9160E14; Thu, 5 Oct 2017 16:06:17 -0700 (PDT) Subject: Re: bug#27871: [PATCH] Treat unreachable current directory as error To: Eli Zaretskii References: <20170930185006.54096-1-phst@google.com> <83376xykb5.fsf@gnu.org> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: Date: Thu, 5 Oct 2017 16:06:17 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <83376xykb5.fsf@gnu.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27871-done Cc: phst@google.com, p.stephani2@gmail.com, 27871-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) On 10/05/2017 03:13 AM, Eli Zaretskii wrote: > Thanks, this LGTM. I think we want this on the release branch. OK, thanks, installed, and closing this bug report. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 07 04:49:19 2017 Received: (at 27871) by debbugs.gnu.org; 7 Oct 2017 08:49:19 +0000 Received: from localhost ([127.0.0.1]:53749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0knO-00083z-U9 for submit@debbugs.gnu.org; Sat, 07 Oct 2017 04:49:19 -0400 Received: from mail-oi0-f54.google.com ([209.85.218.54]:49782) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e0knN-00083m-Ps for 27871@debbugs.gnu.org; Sat, 07 Oct 2017 04:49:18 -0400 Received: by mail-oi0-f54.google.com with SMTP id w197so28349288oif.6 for <27871@debbugs.gnu.org>; Sat, 07 Oct 2017 01:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NUJBUJME7KsaQI/72Fcow7CwuufXZQ+6URd8bcR4L0I=; b=L5KJhatRQwr8cqKae8uKA9vnY5WWLKRcm26m4jvta8ztiolmB09aNwIkJudVxbRJ35 ctLeJT9yN0W9XqQQw7wouiA738/x0dM+iyvUhxY9pwIvq/hG0s9Qd4FUZzj4SpqBZzuD lGBmMEqV3+jZUXuT54l/8aHaJgnCMpuFFGZ8BjkAR6EQhG6wx7YH2sv85bYRI/fVaxMX Ktt/A6YsiN9MqvvTa+RQvvWaVxvhQi04J9us8jRaz8z4L/UDmeRUVrJ8OU0F8O26sPtO RtPolEYe1Sr8LNNy8+pQ7NTNzfSPN0dwt+sg2NJjq64bEy3PWTLXpapO29Hzwunrwugl L5jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NUJBUJME7KsaQI/72Fcow7CwuufXZQ+6URd8bcR4L0I=; b=dTcER9+s1lApbJKTX9bfZ169OO5VCRlWz+UoMp8wkTDvfsan7BGQZX+SLCjzvRthBo g4iqzKoODaNNrtFUdiyRLgSlQHJAXFo8DvK3rwXZD6MpyCCXZzO0/UoLKjvdrOA3sPkr g1noOo5gcphqsqIjiCBCnSh05AlL/ZG9nSk9qdIgJmZo47zhyz3P90l9gENlzNKK81Y8 6YCKwyOCjj6CR2MrSPH8Ke56ji0OiaFfrxZH7JDs1h6SmZ+grbJoLH1748jLs+ImH8CM hPrRqVjW1m0RLYu9lYPrt4RA9ZIo7pjsNpJBvx/hvTK5iKQA06+WDemdtLCvEHhxGBhP sUzw== X-Gm-Message-State: AMCzsaVZHucY4gYx6nCCuaQYk+T9LXRv6SPhepMQEnYOlyvYdZJwE1AS uIy38HZKKvoowFdIGt5V7p3xtFWd/Lm8zmKV6Yc= X-Google-Smtp-Source: AOwi7QBBm9UC/LFXntqLRO7TrR60OhBEj9ReJR+2bAdqQyopX+Za8P+renL3hvKEeyMWrnOJteNgWfTiz6s5yuQUnwg= X-Received: by 10.202.206.207 with SMTP id e198mr385378oig.150.1507366151814; Sat, 07 Oct 2017 01:49:11 -0700 (PDT) MIME-Version: 1.0 References: <20170930185006.54096-1-phst@google.com> In-Reply-To: From: Philipp Stephani Date: Sat, 07 Oct 2017 08:49:01 +0000 Message-ID: Subject: Re: [PATCH] Treat unreachable current directory as error To: Paul Eggert , 27871@debbugs.gnu.org Content-Type: multipart/alternative; boundary="001a113ade5e0698ee055af10844" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 27871 Cc: Philipp Stephani X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --001a113ade5e0698ee055af10844 Content-Type: text/plain; charset="UTF-8" Paul Eggert schrieb am So., 1. Okt. 2017 um 02:00 Uhr: > Philipp Stephani wrote: > > > + if (!file_name_absolute_p (dir)) > > That doesn't look right here, since leading '~' counts as absolute to > file_name_absolute_p, which is not what is wanted here. > That shouldn't matter because getcwd never returns a string starting with ~. > > > + errno = ENOTCONN; > > Why ENOTCONN? Shouldn't it be ENOENT? The failure has nothing to do with > socket > connections. > I think ENOTCONN is the error returned by stat(".") if the current directory doesn't exist. But I don't care much about the exact error number, any nonzero value should do the job. > > Also, I'd feel a bit better if we apply the workaround only to the > function that > has the problem. > > All of the current directory functions exhibit this behavior, including getwd and getcwd, so you need to make sure they are also covered. --001a113ade5e0698ee055af10844 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am So., 1. Okt. 2017 um 02:00=C2=A0Uhr:
Philipp Stephani wrote:

> +=C2=A0 if (!file_name_absolute_p (dir))

That doesn't look right here, since leading '~' counts as absol= ute to
file_name_absolute_p, which is not what is wanted here.

That shouldn't matter because getcwd never returns a s= tring starting with ~.
=C2=A0

> +=C2=A0 =C2=A0 =C2=A0 errno =3D ENOTCONN;

Why ENOTCONN? Shouldn't it be ENOENT? The failure has nothing to do wit= h socket
connections.

I think ENOTCONN is the er= ror returned by stat(".") if the current directory doesn't ex= ist. But I don't care much about the exact error number, any nonzero va= lue should do the job.
=C2=A0

Also, I'd feel a bit better if we apply the workaround only to the func= tion that
has the problem.


All of the current directory functions= exhibit this behavior, including getwd and getcwd, so you need to make sur= e they are also covered.
--001a113ade5e0698ee055af10844-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 08 02:05:04 2017 Received: (at 27871) by debbugs.gnu.org; 8 Oct 2017 06:05:04 +0000 Received: from localhost ([127.0.0.1]:55421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e14i0-000620-1v for submit@debbugs.gnu.org; Sun, 08 Oct 2017 02:05:04 -0400 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:48092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e14hy-00061M-Fc for 27871@debbugs.gnu.org; Sun, 08 Oct 2017 02:05:03 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8730E160D38; Sat, 7 Oct 2017 23:04:55 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id 7KRQ-6M5pBnq; Sat, 7 Oct 2017 23:04:54 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 9DF7F160E42; Sat, 7 Oct 2017 23:04:54 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Xc6z4n37Vy93; Sat, 7 Oct 2017 23:04:54 -0700 (PDT) Received: from [192.168.1.9] (unknown [47.154.18.85]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 741AB160D38; Sat, 7 Oct 2017 23:04:54 -0700 (PDT) Subject: Re: [PATCH] Treat unreachable current directory as error To: Philipp Stephani , 27871@debbugs.gnu.org References: <20170930185006.54096-1-phst@google.com> From: Paul Eggert Organization: UCLA Computer Science Department Message-ID: <9b7b9905-dc97-feb4-9569-27372b1c6b5d@cs.ucla.edu> Date: Sat, 7 Oct 2017 23:04:54 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/mixed; boundary="------------267EEDB52C8C4A56A73B1C57" Content-Language: en-US X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 27871 Cc: Philipp Stephani X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) This is a multi-part message in MIME format. --------------267EEDB52C8C4A56A73B1C57 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Philipp Stephani wrote: > All of the current directory functions exhibit this behavior, including > getwd and getcwd, so you need to make sure they are also covered. Thanks for letting us know. I installed the 2nd attached patch, which add= resses=20 this by making the patch behave more like what you originally proposed, w= hile=20 still avoiding the need to use file_name_absolute_p (which is about Emacs= file=20 names, not OS names). Also, I noticed a related memory leak and fixed tha= t by=20 installing the 1st attached patch. --------------267EEDB52C8C4A56A73B1C57 Content-Type: text/x-patch; name="0001-src-xsmfns.c-x_session_initialize-Fix-memory-leak.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename*0="0001-src-xsmfns.c-x_session_initialize-Fix-memory-leak.patch" =46rom 2202952b8307f3a6407820280e94e4d979b7a122 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 7 Oct 2017 22:48:49 -0700 Subject: [PATCH 1/2] * src/xsmfns.c (x_session_initialize): Fix memory le= ak. --- src/xsmfns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/xsmfns.c b/src/xsmfns.c index 2cb4f3e..fb0d01b 100644 --- a/src/xsmfns.c +++ b/src/xsmfns.c @@ -401,12 +401,14 @@ x_session_initialize (struct x_display_info *dpyinf= o) ptrdiff_t name_len =3D 0; =20 /* libSM seems to crash if pwd is missing - see bug#18851. */ - if (! emacs_get_current_dir_name ()) + char *pwd =3D emacs_get_current_dir_name (); + if (!pwd) { fprintf (stderr, "Disabling session management due to pwd error: %= s\n", emacs_strerror (errno)); return; } + xfree (pwd); =20 ice_fd =3D -1; doing_interact =3D false; --=20 2.7.4 --------------267EEDB52C8C4A56A73B1C57 Content-Type: text/x-patch; name="0002-Improve-test-for-unreachable-dirs.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0002-Improve-test-for-unreachable-dirs.patch" =46rom 7c2c117c91eeef5e7bd70c98cc7e201007016b1e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 7 Oct 2017 22:56:29 -0700 Subject: [PATCH 2/2] Improve test for unreachable dirs * src/sysdep.c (get_current_dir_name_or_unreachable): New function, with most of the old contents of emacs_get_current_dir_name. (emacs_get_current_dir_name): Use it. Use a simpler test for unreachable directory strings, and also apply it to getcwd etc. (Bug#27871) --- src/sysdep.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/sysdep.c b/src/sysdep.c index 8291a60..c348492 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -221,9 +221,12 @@ init_standard_fds (void) } =20 /* Return the current working directory. The result should be freed - with 'free'. Return NULL on errors. */ -char * -emacs_get_current_dir_name (void) + with 'free'. Return NULL (setting errno) on errors. If the + current directory is unreachable, return either NULL or a string + beginning with '('. */ + +static char * +get_current_dir_name_or_unreachable (void) { # if HAVE_GET_CURRENT_DIR_NAME && !BROKEN_GET_CURRENT_DIR_NAME # ifdef HYBRID_MALLOC @@ -233,16 +236,9 @@ emacs_get_current_dir_name (void) # endif if (use_libc) { - /* GNU/Linux get_current_dir_name can return a string starting - with "(unreachable)" (Bug#27871). */ - char *wd =3D get_current_dir_name (); - if (wd && ! (IS_DIRECTORY_SEP (*wd) || (*wd && IS_DEVICE_SEP (wd[1= ])))) - { - free (wd); - errno =3D ENOENT; - return NULL; - } - return wd; + /* For an unreachable directory, this returns a string that starts= + with "(unreachable)"; see Bug#27871. */ + return get_current_dir_name (); } # endif =20 @@ -294,6 +290,23 @@ emacs_get_current_dir_name (void) return buf; } =20 +/* Return the current working directory. The result should be freed + with 'free'. Return NULL (setting errno) on errors; an unreachable + directory (e.g., its name starts with '(') counts as an error. */ + +char * +emacs_get_current_dir_name (void) +{ + char *dir =3D get_current_dir_name_or_unreachable (); + if (dir && *dir =3D=3D '(') + { + free (dir); + errno =3D ENOENT; + return NULL; + } + return dir; +} + =0C /* Discard pending input on all input descriptors. */ =20 --=20 2.7.4 --------------267EEDB52C8C4A56A73B1C57-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 08 10:56:30 2017 Received: (at 27871) by debbugs.gnu.org; 8 Oct 2017 14:56:30 +0000 Received: from localhost ([127.0.0.1]:56499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1D0I-00043I-Hg for submit@debbugs.gnu.org; Sun, 08 Oct 2017 10:56:30 -0400 Received: from mail-oi0-f52.google.com ([209.85.218.52]:55092) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e1D0G-000434-0H for 27871@debbugs.gnu.org; Sun, 08 Oct 2017 10:56:28 -0400 Received: by mail-oi0-f52.google.com with SMTP id u130so36077671oib.11 for <27871@debbugs.gnu.org>; Sun, 08 Oct 2017 07:56:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=IRBwRB7h7jdPughVaUfdDSxAkN9u7lE7HweH1/oG8EY=; b=ju3szZ2gtBFzKR3NNIE8/iEwXeGy3JzISNcUAfU45Fwlo6u15BUmg8RbIKW5R504TE SWF0ZpIbS0T/19AVCfJYhZHkAs/p/6bCEROF8bFl7ZSSGSkii207skMYeKp0QfukMVYN 3vOBqB0uDwQ7Q7vDKEZN6bAZb0NUMH9+bnxQ1eNX2ICxrcgxmBXW2TPeU2Tzqa9BS2ub vsQxAXBTrXXog0ooZY5KFCFuFsg2Z5H2F6iANUD3egUnRB/SHR0PMSaoFk352/0exE78 Moy+4lSpfxmp9HtZ3tWWF6/iTMJnWaPUnbxPfwKKDtlQgThOXQM6N+eWBd9nvC9VK88M Y8PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=IRBwRB7h7jdPughVaUfdDSxAkN9u7lE7HweH1/oG8EY=; b=WbojZLjk56cXMt+/poshpRYSRdpXF7ojD5vKjmT6x6mnW1KqPiRHh30IjCaWEAdE2J RQ2R6rxOdCD4bVXbaNhTvuJH/Vj12jtFKhJIKKvIxz7uMmBo4iDuD17+pXoZVcOGlJ1i qx55boINwxeif8ow4xd11cJXw9RdJGhRqtE7bGn0+Fo5EVruV5dYAVpEsSMNsO5YIMhk 2maGZtNZLt85tLA/cOjc2Hhuux52QvejjNLBRBv5kjizjv5jsgnHCXTFNOBE4WPdHt0/ 3HsFu8Awn2Q5DcfZuj8O4JCCpX88je8DR/8yerNPrkdeMsaZttGaYm+NWOKG3vfVzChU wQLw== X-Gm-Message-State: AMCzsaXgPwyChjUF0ZxQHZ4BgU5e21FQbRTUo53urdrlfZdTqd3WVHEg 1bBjYRuqKsnQESSCHYu+IEGE11D5dBV1mOCtek4= X-Google-Smtp-Source: AOwi7QAtTvP2zvXTomFYywrsOeu/0sT/2+7N0vpDNABdsvPCrpbSQYv/QdhRqLx5PcXsVISN1gEo68PvDy4gj+D9mEI= X-Received: by 10.157.59.55 with SMTP id z52mr4144733otb.75.1507474582252; Sun, 08 Oct 2017 07:56:22 -0700 (PDT) MIME-Version: 1.0 References: <20170930185006.54096-1-phst@google.com> <9b7b9905-dc97-feb4-9569-27372b1c6b5d@cs.ucla.edu> In-Reply-To: <9b7b9905-dc97-feb4-9569-27372b1c6b5d@cs.ucla.edu> From: Philipp Stephani Date: Sun, 08 Oct 2017 14:56:11 +0000 Message-ID: Subject: Re: bug#27871: [PATCH] Treat unreachable current directory as error To: Paul Eggert , 27871@debbugs.gnu.org Content-Type: multipart/alternative; boundary="001a113779eafbb1d8055b0a4601" X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 27871 Cc: Philipp Stephani X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.7 (/) --001a113779eafbb1d8055b0a4601 Content-Type: text/plain; charset="UTF-8" Paul Eggert schrieb am So., 8. Okt. 2017 um 08:06 Uhr: > Philipp Stephani wrote: > > All of the current directory functions exhibit this behavior, including > > getwd and getcwd, so you need to make sure they are also covered. > > Thanks for letting us know. I installed the 2nd attached patch, which > addresses > this by making the patch behave more like what you originally proposed, > while > still avoiding the need to use file_name_absolute_p (which is about Emacs > file > names, not OS names). > That should work, thanks. FTR, this behavior is documented in the Linux manpage: http://man7.org/linux/man-pages/man2/getcwd.2.html --001a113779eafbb1d8055b0a4601 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Paul E= ggert <eggert@cs.ucla.edu> = schrieb am So., 8. Okt. 2017 um 08:06=C2=A0Uhr:
Philipp Stephani wrote:
> All of the current directory functions exhibit this behavior, includin= g
> getwd and getcwd, so you need to make sure they are also covered.

Thanks for letting us know. I installed the 2nd attached patch, which addre= sses
this by making the patch behave more like what you originally proposed, whi= le
still avoiding the need to use file_name_absolute_p (which is about Emacs f= ile
names, not OS names).

That should work= , thanks. FTR, this behavior is documented in the Linux manpage:=C2=A0http://man7.org/l= inux/man-pages/man2/getcwd.2.html=C2=A0
--001a113779eafbb1d8055b0a4601-- From unknown Wed Jun 25 10:51:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 06 Nov 2017 12:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator