write errors in shell on SMB share mounted from Nautilus (gvfs/fuse)
Affected version
- Nightly flatpak:Can't test it because flatpak failed to install nightly ( https://gitlab.gnome.org/-/snippets/1471 )
- Other: nautilus 3.26.3.1 from Centos 7.9.2009 distro
Steps to reproduce
- Mount SMB share via Nautils
- open gnome-terminal and navigate to /run/user/1000/gvfs/smb-share:server=servername,share=sharename
- attempt to append to a new or existing text file with "echo"; e.g. "echo foo > bar"
Current behavior
bash fails to write the file with the error: "Invalid argument":
$ echo foo > bar
-bash: bar: Invalid argument
Expected behavior
File should be appended
Additional information
"gedit" on a file on the share seems to work without issue. Creating folders in Nautilus works.
But from a terminal all my attempts to write to files result in some kind of error.
e.g. using "vim" on a new file 1) vim reports the file is read-only 2) forcing a write with 'w!' results in a write error in vim ("E212: Can't open file for writing") and 3) after a forced write attempt a numbered empty file is left in the CWD (e.g. file named '4913', where 4913 is seemingly random?)
using vim on an EXISTING file results in different errors: 1) vim reports a swap file already exists, even though it did NOT exist at vim start time
$ ls -a1
.
..
foobar.txt
$ vim foobar.txt
E325: ATTENTION
Found a swap file by the name ".foobar.txt.swp"
owned by: rladmin dated: Thu Jan 21 15:01:37 2021
[cannot be read]
While opening file "foobar.txt"
dated: Thu Jan 21 14:59:39 2021
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r foobar.txt"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".foobar.txt.swp"
to avoid this message.
Swap file ".foobar.txt.swp" already exists!
## ABORTED vim
$ ls -a1 | grep foobar
foobar.txt
.foobar.txt.swo
.foobar.txt.swp
I have mounted the share using mount.cifs with the uid and gid options; in this case the user can read and write files via the shell with no problems.
<!-- Ignore the text under this line. -->