cannot open files on SMB shares, incorrect stat info
I am able to mount SMB shares from a NAS, but I cannot open any files. The client is configured to use min protocol = NT1
if that's of any relevance. The files are presented via the fuse mount as directories.
OS: Arch
- gvfs 1.44.1-3
- gvfs-smb 1.44.1-3
- smbclient 4.12.2-3
The log from gvfsd:
smbc_stat(smb://192.168.1.5/media/Pictures/2004.07.18/HPIM1266.JPG)
SMBC_getatr: sending qpathinfo
num_setup=1, max_setup=0, param_total=8, this_param=8, max_param=2, data_total=0, this_data=0, max_data=100, param_offset=68, param_pad=0, param_disp=0, data_offset=76, data_pad=0, data_disp=0
smb: send_reply(0x7fc548002980), failed=0 ()
smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=209758)
smb: Queued new job 0x7fc548002a20 (GVfsJobQueryInfo)
smbc_stat(smb://192.168.1.5/media/Pictures/2004.07.18/HPIM1266.JPG)
SMBC_getatr: sending qpathinfo
num_setup=1, max_setup=0, param_total=8, this_param=8, max_param=2, data_total=0, this_data=0, max_data=100, param_offset=68, param_pad=0, param_disp=0, data_offset=76, data_pad=0, data_disp=0
smb: send_reply(0x7fc548002a20), failed=0 ()
smb: backend_dbus_handler org.gtk.vfs.Mount:CreateDirectoryMonitor (pid=209758)
smb: Queued new job 0x7fc5400186e0 (GVfsJobCreateMonitor)
smb: send_reply(0x7fc5400186e0), failed=1 (Operation not supported)
smb: backend_dbus_handler org.gtk.vfs.Mount:CreateDirectoryMonitor (pid=209758)
smb: Queued new job 0x557fa86cc040 (GVfsJobCreateMonitor)
smb: send_reply(0x557fa86cc040), failed=1 (Operation not supported)
smb: backend_dbus_handler org.gtk.vfs.Mount:Enumerate (pid=209758)
smb: Queued new job 0x557fa86a48f0 (GVfsJobEnumerate)
parsed path: fname='smb://192.168.1.5/media/Pictures/2004.07.18/HPIM1266.JPG' server='192.168.1.5' share='media' path='\Pictures\2004.07.18\HPIM1266.JPG' options=''
SMBC_check_options(): server='192.168.1.5' share='media' path='\Pictures\2004.07.18\HPIM1266.JPG' options=''
num_setup=1, max_setup=0, param_total=84, this_param=84, max_param=10, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=152, data_pad=0, data_disp=0
map_errno_from_nt_status: 32 bit codes: code=c000003a
smbc errno NT_STATUS_OBJECT_PATH_NOT_FOUND -> 2
smb: send_reply(0x557fa86a48f0), failed=1 (No such file or directory)
As mentioned above, the files are presented as directories through the fuse mount:
$ stat /run/user/1000/gvfs/smb-share:server=192.168.1.5,share=media/Pictures/2004.07.18/HPIM1266.jpg
File: /run/user/1000/gvfs/smb-share:server=192.168.1.5,share=media/Pictures/2004.07.18/HPIM1266.jpg
Size: 0 Blocks: 0 IO Block: 4096 directory
Device: 5dh/93d Inode: 367 Links: 1
Access: (0700/drwx------) Uid: ( 1000/ maciek) Gid: ( 1000/ maciek)
Access: 2014-09-23 00:43:20.000000000 +0200
Modify: 2017-11-20 18:38:42.000000000 +0100
Change: 2017-11-20 18:38:42.000000000 +0100
Birth: -
It is possible to get
that file using smbclient //192.168.1.5/media and then navigating to the right directory. The relevant log from smbclient:
num_setup=1, max_setup=0, param_total=40, this_param=40, max_param=2, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=108, data_pad=0, data_disp=0
tconx ok
Try "help" to get a list of possible commands.
smb: \> list
0: server=192.168.1.5, share=media
smb: \> cd Pictures
dos_clean_name [\Pictures\]
unix_clean_name [\Pictures\]
num_setup=1, max_setup=0, param_total=28, this_param=28, max_param=2, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=96, data_pad=0, data_disp=0
smb: \Pictures\> cd 2004.07.18
dos_clean_name [\Pictures\2004.07.18\]
unix_clean_name [\Pictures\2004.07.18\]
num_setup=1, max_setup=0, param_total=50, this_param=50, max_param=2, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=120, data_pad=2, data_disp=0
smb: \Pictures\2004.07.18\> HPIM1266.JPG
HPIM1266.JPG: command not found
smb: \Pictures\2004.07.18\> get HPIM1266.JPG
dos_clean_name [\Pictures\2004.07.18\HPIM1266.JPG]
unix_clean_name [\Pictures\2004.07.18\HPIM1266.JPG]
map_open_params_to_ntcreate: fname = \Pictures\2004.07.18\HPIM1266.JPG, deny_mode = 0x40, open_func = 0x1
map_open_params_to_ntcreate: file \Pictures\2004.07.18\HPIM1266.JPG, access_mask = 0x120089, share_mode = 0x3, create_disposition = 0x1, create_options = 0x40 private_flags = 0x0
num_setup=1, max_setup=0, param_total=4, this_param=4, max_param=2, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=72, data_pad=0, data_disp=0
getting file \Pictures\2004.07.18\HPIM1266.JPG of size 891708 as HPIM1266.JPG (12094.5 KiloBytes/sec) (average 12094.6 KiloBytes/sec)
For comparison, it is possible to open the file on Fedora 32, the relevant gvfsd log:
parsed path: fname='smb://192.168.1.5/media/Pictures/2004.07.18' server='192.168.1.5' share='media' path='\Pictures\2004.07.18' options=''
SMBC_check_options(): server='192.168.1.5' share='media' path='\Pictures\2004.07.18' options=''
num_setup=1, max_setup=0, param_total=58, this_param=58, max_param=10, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=128, data_pad=2, data_disp=0
smb: send_reply(0x563fa91120f0), failed=0 ()
smb: backend_dbus_handler org.gtk.vfs.Mount:QueryInfo (pid=4975)
smb: Queued new job 0x563fa9100170 (GVfsJobQueryInfo)
smbc_stat(smb://192.168.1.5/media/Pictures/2004.07.18/HPIM1266.JPG)
SMBC_getatr: sending qpathinfo
num_setup=1, max_setup=0, param_total=74, this_param=74, max_param=2, data_total=0, this_data=0, max_data=65535, param_offset=68, param_pad=0, param_disp=0, data_offset=144, data_pad=2, data_disp=0
smb: send_reply(0x563fa9100170), failed=0 ()
smb: backend_dbus_handler org.gtk.vfs.Mount:OpenForRead (pid=4975)
smb: Queued new job 0x563fa91000d0 (GVfsJobOpenForRead)
map_open_params_to_ntcreate: fname = \Pictures\2004.07.18\HPIM1266.JPG, deny_mode = 0x40, open_func = 0x1
map_open_params_to_ntcreate: file \Pictures\2004.07.18\HPIM1266.JPG, access_mask = 0x120089, share_mode = 0x3, create_disposition = 0x1, create_options = 0x40 private_flags = 0x0
smb: send_reply(0x563fa91000d0), failed=0 ()
The files are also properly represented in the fuse mount:
$ stat /run/user/1000/gvfs/smb-share:server=192.168.1.5,share=media/Pictures/2004.07.18/HPIM1266.jpg
File: /run/user/1000/gvfs/smb-share:server=192.168.1.5,share=media/Pictures/2004.07.18/HPIM1266.jpg
Size: 891708 Blocks: 1742 IO Block: 4096 regular file
Device: 29h/41d Inode: 5 Links: 1
Access: (0700/-rwx------) Uid: ( 1000/ maciek) Gid: ( 1000/ maciek)
Context: system_u:object_r:fusefs_t:s0
Access: 2014-09-22 18:53:31.000000000 +0200
Modify: 2004-07-17 23:30:02.000000000 +0200
Change: 2004-07-17 23:30:02.000000000 +0200
Birth: -
Package versions in fedora as seemingly identical:
- gvfs-1.44.1-1.fc32.x86_64
- gvfs-fuse-1.44.1-1.fc32.x86_64
- gvfs-smb-1.44.1-1.fc32.x86_64
- libsmbclient-4.12.2-0.fc32.1.x86_64
Any other way I can try and debug this?