unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
@ 2019-10-01 15:00 Tim Zander
  2019-10-06 10:37 ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Tim Zander @ 2019-10-01 15:00 UTC (permalink / raw)
  To: 37573

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

Steps to reproduce

Connect to remote ssh server via GNOME-Nautilus.

Drag-and-drop any file from Nautilius to Emacs or just open it from there.

Change this file and try to save.

Get the following Error

Saving file
/run/user/1000/gvfs/sftp:host=196.196.196.196,user=ubuntu/home/ubuntu/FOO...

basic-save-buffer-2: Unlocking file: Function not implemented,
/run/user/1000/gvfs/sftp:host=196.196.196.196,user=ubuntu/home/FOO


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30)
 of 2019-09-26 built on lcy01-amd64-022
Windowing system distributor 'The X.Org Foundation', version 11.0.11906000
System Description: Ubuntu 18.04.3 LTS

Recent messages:
(New file)
funcall-interactively: Buffer is read-only: #<buffer input> [3 times]
Making completion list...
delete-backward-char: Text is read-only
Making completion list...
Read-Only mode disabled in current buffer
Saving file /run/user/1000/gvfs/sftp:host=,user=ubuntu/home/ubuntu/input...
basic-save-buffer-2: Unlocking file: Function not implemented,
/run/user/1000/gvfs/sftp:host=,user=ubuntu/home/ubuntu/input
Mark set
Mark saved where search started

Configured using:
 'configure --build=x86_64-linux-gnu --prefix=/usr
 '--includedir=${prefix}/include' '--mandir=${prefix}/share/man'
 '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var
 --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu'
 '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode
 --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib
 --program-suffix=-snapshot --with-modules=yes --with-x=yes
 --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs-snapshot-fC400k/emacs-snapshot-98514=.
-fstack-protector-strong
 -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY
ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS XWIDGETS
LIBSYSTEMD PDUMPER LCMS2 GMP

Important settings:
  value of $LC_MONETARY: en_GB.UTF-8
  value of $LC_NUMERIC: en_GB.UTF-8
  value of $LC_TIME: en_GB.UTF-8
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
  tooltip-mode: t
  global-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
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/usr/share/emacs/site-lisp/dictionaries-common/flyspell hides
/usr/share/emacs/27.0.50/lisp/textmodes/flyspell
/usr/share/emacs/site-lisp/rst hides
/usr/share/emacs/27.0.50/lisp/textmodes/rst
/usr/share/emacs/site-lisp/dictionaries-common/ispell hides
/usr/share/emacs/27.0.50/lisp/textmodes/ispell
/usr/share/emacs/site-lisp/latex-cjk-thai/thai-word hides
/usr/share/emacs/27.0.50/lisp/language/thai-word

Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
format-spec rfc822 mml easymenu mml-sec password-cache epa derived epg
epg-config gnus-util rmail rmail-loaddefs text-property-search seq
byte-opt gv bytecomp byte-compile cconv mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils misearch multi-isearch
time-date subr-x cl-loaddefs cl-lib browse-url 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 threads dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting xwidget-internal move-toolbar
gtk x-toolkit x multi-tty make-network-process emacs)

Memory information:
((conses 16 49492 11491)
 (symbols 48 6177 1)
 (strings 32 16257 1599)
 (string-bytes 1 525839)
 (vectors 16 9447)
 (vector-slots 8 125910 11864)
 (floats 8 20 46)
 (intervals 56 291 0)
 (buffers 992 14))


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5199 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-01 15:00 bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus Tim Zander
@ 2019-10-06 10:37 ` Michael Albinus
  2019-10-06 17:44   ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2019-10-06 10:37 UTC (permalink / raw)
  To: Tim Zander; +Cc: 37573

Tim Zander <tim.zander@kit.edu> writes:

Hi Tim,

> Steps to reproduce
>
> Connect to remote ssh server via GNOME-Nautilus.
>
> Drag-and-drop any file from Nautilius to Emacs or just open it from there.
>
> Change this file and try to save.
>
> Get the following Error
>
> Saving file
> /run/user/1000/gvfs/sftp:host=196.196.196.196,user=ubuntu/home/ubuntu/FOO...
>
> basic-save-buffer-2: Unlocking file: Function not implemented,
> /run/user/1000/gvfs/sftp:host=196.196.196.196,user=ubuntu/home/FOO

I could reproduce it locally. The problem is, that /run/user/1000/gvfs/
is a GVFS mounted file system. Most of native file operations work
there, but there seems to be a problem to handle symlinks like .#filename
which are used to mark locked files.

Saving the modified buffer itself works. So it might be appropriate to
suppress the file locking on GVFS mounted file systems. Add the
following lines to your .emacs:

(put 'create-lockfiles 'safe-local-variable 'booleanp)
(dir-locals-set-class-variables 'gvfs '((nil . ((create-lockfiles . nil)))))
(dir-locals-set-directory-class (format "/run/user/%d/gvfs" (user-uid)) 'gvfs)

I'm wondering, whether we shall document this approach somewhere. Eli?

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-06 10:37 ` Michael Albinus
@ 2019-10-06 17:44   ` Eli Zaretskii
  2019-10-07  7:55     ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2019-10-06 17:44 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 37573, tim.zander

> From: Michael Albinus <michael.albinus@gmx.de>
> Date: Sun, 06 Oct 2019 12:37:21 +0200
> Cc: 37573@debbugs.gnu.org
> 
> I could reproduce it locally. The problem is, that /run/user/1000/gvfs/
> is a GVFS mounted file system. Most of native file operations work
> there, but there seems to be a problem to handle symlinks like .#filename
> which are used to mark locked files.
> 
> Saving the modified buffer itself works. So it might be appropriate to
> suppress the file locking on GVFS mounted file systems. Add the
> following lines to your .emacs:
> 
> (put 'create-lockfiles 'safe-local-variable 'booleanp)
> (dir-locals-set-class-variables 'gvfs '((nil . ((create-lockfiles . nil)))))
> (dir-locals-set-directory-class (format "/run/user/%d/gvfs" (user-uid)) 'gvfs)
> 
> I'm wondering, whether we shall document this approach somewhere. Eli?

Does this file operation always fail on GVFS volumes?  If so, perhaps
we should not create lockfiles on such volumes by default?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-06 17:44   ` Eli Zaretskii
@ 2019-10-07  7:55     ` Michael Albinus
  2019-10-07 16:28       ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2019-10-07  7:55 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 37573, tim.zander

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

>> I could reproduce it locally. The problem is, that /run/user/1000/gvfs/
>> is a GVFS mounted file system. Most of native file operations work
>> there, but there seems to be a problem to handle symlinks like .#filename
>> which are used to mark locked files.
>>
>> Saving the modified buffer itself works. So it might be appropriate to
>> suppress the file locking on GVFS mounted file systems. Add the
>> following lines to your .emacs:
>>
>> (put 'create-lockfiles 'safe-local-variable 'booleanp)
>> (dir-locals-set-class-variables 'gvfs '((nil . ((create-lockfiles . nil)))))
>> (dir-locals-set-directory-class (format "/run/user/%d/gvfs" (user-uid)) 'gvfs)
>>
>> I'm wondering, whether we shall document this approach somewhere. Eli?
>
> Does this file operation always fail on GVFS volumes?  If so, perhaps
> we should not create lockfiles on such volumes by default?

I've tested the scenario (editing a remote file from Nautilus via Emacs)
with GVFS volumes of different types. ftp and afp-volume work w/o
problems. ssh/sftp behaves as reported (problem with file locking).

dav(s), google-drive and smb-share give another error:

Error: (file-error "Doing chmod" "Operation not supported" "/run/user/1000/gvfs/smb-share:server=detlef,share=netlogon/tmp/tramp-test1H01tS")

So it doesn't make sense to implement the workaround in general. What we
could do instead is to map all files under "/run/user/%d/gvfs" to the
respective Tramp file name. Don't know whether it is worth the effort.

After all, I believe we shall simply document the behavior, and the
workaround for ssh/sftp.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-07  7:55     ` Michael Albinus
@ 2019-10-07 16:28       ` Eli Zaretskii
  2019-10-08 12:57         ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2019-10-07 16:28 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 37573, tim.zander

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: tim.zander@kit.edu,  37573@debbugs.gnu.org
> Date: Mon, 07 Oct 2019 09:55:12 +0200
> 
> I've tested the scenario (editing a remote file from Nautilus via Emacs)
> with GVFS volumes of different types. ftp and afp-volume work w/o
> problems. ssh/sftp behaves as reported (problem with file locking).
> 
> dav(s), google-drive and smb-share give another error:
> 
> Error: (file-error "Doing chmod" "Operation not supported" "/run/user/1000/gvfs/smb-share:server=detlef,share=netlogon/tmp/tramp-test1H01tS")
> 
> So it doesn't make sense to implement the workaround in general. What we
> could do instead is to map all files under "/run/user/%d/gvfs" to the
> respective Tramp file name. Don't know whether it is worth the effort.
> 
> After all, I believe we shall simply document the behavior, and the
> workaround for ssh/sftp.

If we cannot fix this, then documenting sounds good to me.  In
etc/PROBLEMS, perhaps?





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-07 16:28       ` Eli Zaretskii
@ 2019-10-08 12:57         ` Michael Albinus
  2019-10-08 13:11           ` Eli Zaretskii
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2019-10-08 12:57 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 37573, tim.zander

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

Eli Zaretskii <eliz@gnu.org> writes:

>> I've tested the scenario (editing a remote file from Nautilus via Emacs)
>> with GVFS volumes of different types. ftp and afp-volume work w/o
>> problems. ssh/sftp behaves as reported (problem with file locking).
>>
>> dav(s), google-drive and smb-share give another error:
>>
>> Error: (file-error "Doing chmod" "Operation not supported"
>> "/run/user/1000/gvfs/smb-share:server=detlef,share=netlogon/tmp/tramp-test1H01tS")
>>
>> So it doesn't make sense to implement the workaround in general. What we
>> could do instead is to map all files under "/run/user/%d/gvfs" to the
>> respective Tramp file name. Don't know whether it is worth the effort.
>>
>> After all, I believe we shall simply document the behavior, and the
>> workaround for ssh/sftp.
>
> If we cannot fix this, then documenting sounds good to me.  In
> etc/PROBLEMS, perhaps?

I've assembled the appended patch. This includes setting of the
safe-local-variable property of create-lockfiles, 'cos it doesn't hurt.

Comments?


[-- Attachment #2: Type: text/plain, Size: 1531 bytes --]

diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index c0d30ae5b4..836537bc5f 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -1183,6 +1183,23 @@ always) doesn't insert the whitespace of the killed and yanked line.

 The solution is to set the GPaste "trim items" option to OFF.

+*** Gnome: Navigation from Nautilus to remote files.
+
+If you navigate to a file in Nautilus via "Open With Emacs", which
+belongs to a remote server, you might not be able to save this file
+once you have modified it in Emacs. The reasons for failing are
+different, and for some connection methods it might even be possible.
+
+If the remote connection in Nautilus uses ssh or sftp, you could
+mitigate the problem by the following lines in your .emacs file:
+
+(dir-locals-set-class-variables 'gvfs '((nil . ((create-lockfiles . nil)))))
+(dir-locals-set-directory-class (format "/run/user/%d/gvfs" (user-uid)) 'gvfs)
+
+A better approach might be to avoid navigation from Nautilus to Emacs
+for such files, and to open the file in Emacs using Tramp remote file
+name syntax.
+
 *** KDE: When running on KDE, colors or fonts are not as specified for Emacs,
 or messed up.

diff --git a/lisp/userlock.el b/lisp/userlock.el
index f077bc9ad6..209768620c 100644
--- a/lisp/userlock.el
+++ b/lisp/userlock.el
@@ -34,6 +34,9 @@

 (eval-when-compile (require 'cl-lib))

+;;;###autoload
+(put 'create-lockfiles 'safe-local-variable 'booleanp)
+
 (define-error 'file-locked "File is locked" 'file-error)

 ;;;###autoload

[-- Attachment #3: Type: text/plain, Size: 24 bytes --]


Best regards, Michael.

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-08 12:57         ` Michael Albinus
@ 2019-10-08 13:11           ` Eli Zaretskii
  2019-10-08 13:44             ` Michael Albinus
  0 siblings, 1 reply; 9+ messages in thread
From: Eli Zaretskii @ 2019-10-08 13:11 UTC (permalink / raw)
  To: Michael Albinus; +Cc: 37573, tim.zander

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: tim.zander@kit.edu,  37573@debbugs.gnu.org
> Date: Tue, 08 Oct 2019 14:57:54 +0200
> 
> +*** Gnome: Navigation from Nautilus to remote files.
> +
> +If you navigate to a file in Nautilus via "Open With Emacs", which
> +belongs to a remote server, you might not be able to save this file

I suggest to reorder the words in the beginning of this sentence:

  If you navigate to a file, which belongs to a remote server, in
  Nautilus via "Open With Emacs" you might not be able to save this
  file[...]

Does this describe the situation correctly?

The original wording made it hard to understand what "belongs to a
remote server".

> +once you have modified it in Emacs. The reasons for failing are
                                     ^^
Two spaces.

> +different, and for some connection methods it might even be possible.

Here' I'd rephrase

  The reasons for the failure can vary, and for some connection
  methods saving the file might even succeed.

> +A better approach might be to avoid navigation from Nautilus to Emacs
> +for such files, and to open the file in Emacs using Tramp remote file
                   ^^^^^^^^^^^^^^^^^^^^
"and instead to open the file..."

Thanks.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-08 13:11           ` Eli Zaretskii
@ 2019-10-08 13:44             ` Michael Albinus
  2019-10-08 14:15               ` Tim Zander
  0 siblings, 1 reply; 9+ messages in thread
From: Michael Albinus @ 2019-10-08 13:44 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 37573-done, tim.zander

Version: 27.1

Eli Zaretskii <eliz@gnu.org> writes:

Hi Eli,

> I suggest to reorder the words in the beginning of this sentence:

Thanks for the review, all changes applied. I've pushed it to master,
closing the bug.

Tim, if there are problems with the proposed workaround, you might come
back and describe in detail.

> Thanks.

Best regards, Michael.





^ permalink raw reply	[flat|nested] 9+ messages in thread

* bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus
  2019-10-08 13:44             ` Michael Albinus
@ 2019-10-08 14:15               ` Tim Zander
  0 siblings, 0 replies; 9+ messages in thread
From: Tim Zander @ 2019-10-08 14:15 UTC (permalink / raw)
  To: Michael Albinus, Eli Zaretskii; +Cc: 37573-done

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

Thanks, it did help. I am willing to write a patch for mapping the gvfs
files to the tramp files. Could I get some more hints towards this
solution?

Thanks
Tim

On 08/10/2019 15:44, Michael Albinus wrote:
> Version: 27.1
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> Hi Eli,
> 
>> I suggest to reorder the words in the beginning of this sentence:
> 
> Thanks for the review, all changes applied. I've pushed it to master,
> closing the bug.
> 
> Tim, if there are problems with the proposed workaround, you might come
> back and describe in detail.
> 
>> Thanks.
> 
> Best regards, Michael.
> 

-- 
Karlsruher Institut für Technologie (KIT)
Institut für Anthropomatik und Robotik

Dr. Tim Zander
Akademischer Mitarbeiter

IOSB Fraunhofer
Fraunhoferstr. 1,
76131 Karlsruhe, Germany
Telefon +49 (0) 721 - 6091 - 574
mail: tim.zander@kit.edu


Sitz der Körperschaft:
Kaiserstraße 12, 76131 Karlsruhe



KIT –  Die Forschungsuniversität in der Helmholtz-Gemeinschaft


[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 5199 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-10-08 14:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-01 15:00 bug#37573: 27.0.50; Remote file opened from GNOME-Nautilus Tim Zander
2019-10-06 10:37 ` Michael Albinus
2019-10-06 17:44   ` Eli Zaretskii
2019-10-07  7:55     ` Michael Albinus
2019-10-07 16:28       ` Eli Zaretskii
2019-10-08 12:57         ` Michael Albinus
2019-10-08 13:11           ` Eli Zaretskii
2019-10-08 13:44             ` Michael Albinus
2019-10-08 14:15               ` Tim Zander

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).