Shared files are shown as folders

Bug #1872476 reported by INIZAN yannick on 2020-04-13
84
This bug affects 17 people
Affects Status Importance Assigned to Milestone
samba (Ubuntu)
High
Sergio Durigan Junior
Focal
High
Sergio Durigan Junior

Bug Description

[Impact]

The current samba package on focal suffers from a bug that manifests itselft when the SMB1 (NT1) protocol is being used. In this scenario, the user will see regular files being presented as directories when using GIO/gvfs to browse the samba share (e.g., via nautilus, or using the "gio" command). Even though the SMB1 protocol is old, it is still used by some NAS devices and therefore this issue can impact a non-trivial number of users.

The fix, which had to be cherry-picked from upstream, is to revert a specific libsmb code that attempts to obtain some POSIX stat(2) information when running on UNIX-like environments. The upstream commit can be found here:

  https://gitlab.com/samba-team/devel/samba/-/commit/39c910fd9cba3caf7414274b678b9eee33d7e20b

[Test Case]

In order to reproduce the bug, one can do:

$ lxc launch ubuntu-daily:focal samba-bug1872476
$ lxc shell samba-bug1872476

When inside the LXC container, as root:

# apt install samba smbclient gvfs gvfs-backends dbus-x11
# sed -i 's/^\[global\]/[global]\n client min protocol = NT1\n client max protocol = NT1\n server min protocol = NT1\n server max protocol = NT1/g' /etc/samba/smb.conf
# cat >> /etc/samba/smb.conf << __EOF__
[testshare]
  path = /testshare
  readonly = no
  browsable = yes
  guest ok = yes
__EOF__
# mkdir /testshare
# cat > /testshare/123.txt << __EOF__
Hi, this is a test for samba bug 1872476.
This is a regular file, and not a directory.
__EOF__
# ufw allow samba
# eval $(dbus-launch --sh-syntax)
# gio mount -a smb://127.0.0.1/testshare
# gio info smb://127.0.0.1/testshare/123.txt | grep '^type:'
type: directory

As can be seen above, the regular file '123.txt' is mistakenly listed as a directory.

There's a PPA with a proposed fix here:

https://launchpad.net/~sergiodj/+archive/ubuntu/samba-bug1872476-v2

When trying it out, it is important to umount the share and remount it with the new package:

# gio mount -u smb://127.0.0.1/testshare
# add-apt-repository ppa:sergiodj/samba-bug1872476-v2
# apt update && apt upgrade
# gio mount -a smb://127.0.0.1/testshare
# gio info smb://127.0.0.1/testshare/123.txt | grep '^type:'
type: regular

[Regression Potential]

This change is relatively simple and has been incorporated by upstream and by other distributions, but it touches libsmb, which is a central area of samba.

The POSIX stat(2) call was only made when dealing with the NT1/SMB1 version of the samba protocol running on UNIX-like environments, which contributes to reduce the impact of the patch.

We can assume that there is regression potential for users of the NT1/SMB1 protocol on UNIX-like environments that are dealing with different types of files (regular, directory, symbolic links, etc.), since the code that the patch modifies is responsible for obtaining the attributes of a file. Even though the function uses fallback mechanisms (like resorting to qpathinfo calls) to not depend solely on stat(2), the user might experience some regression when trying to determine the type of a file.

[Original Description]
System : Xubuntu 20.04 LTS, kernel 5.6.2
Samba : Version 4.11.6-Ubuntu

problem : latest versions of samba can't mount remote disk if the remote protocol is too old. Can be fixed by adding "client min protocol = CORE" under [global] section in conf.
But there is another problem, all files in remote disk are shown as folders, so we can't read these files

(screenshot : https://ibb.co/g9FW14c)

Related branches

Thank you for taking the time to file a bug report.

Could you please describe detailed steps in order to reproduce this issue ?

Something like:

1) Configure smb.conf like this ""
2) Restart smb service
3) Try to access remote shared folder using smbfs://xxxx/yyyy
4) If it is authenticated or not
5) The other side OS version and configuration

and/or any other information, that might help us reproducing the issue, would be great!

Since there is not enough information in your report to begin triage or to
differentiate between a local configuration problem and a bug in Ubuntu, I
am marking this bug as "Incomplete". We would be grateful if you would:
provide a more complete description of the problem, explain why you
believe this is a bug in Ubuntu rather than a problem specific to your
system, and then change the bug status back to "New".

For local configuration issues, you can find assistance here:
http://www.ubuntu.com/support/community

Changed in samba (Ubuntu):
status: New → Incomplete
Bruno F (bruno-fr) wrote :

I can reproduce the problem on a fresh new installed Ubuntu desktop 20.04 :

1) install package samba-common
   which is currently version 2:4.11.6+dfsg-0ubuntu1

2) add "client min protocol = NT1" to /etc/samba/smb.conf in [global] section
Note : required to access my NAS which only support SMB v1. It is included in my ISP internet box so I can not upgrade it.

3) launch "Files"
Note : Files version is currently 3.36.1.1-stable.

4.1) browse "Other Locations", Windows Network, WORKGROUP, FREEBOX_SERVER (which is my NAS)

4.2) connect as "Anonymous"

4.3) browse my NAS folder, all files are displayed as Folder, like on the attached screenshot "files_shown_as_folder.png".

4.4) I can not use any file on my NAS. When clicking on an item, a message box is displayed « This location could not be displayed. "France 3 Pays de Loire…" could not be found. Perhaps it has recently been deleted » as shown on the screenshot "can_not_open_file.png".

This was working correctly on Ubuntu 19.10. It looks like the upgrade to v4.11 of samba cause some problems with file browser accessing SMB v1 share.
I can reproduce the problem on LUbuntu 20.04 with either PCManFM-Qt and Dolhpin file browser.

With Ubuntu 20.04 "smbclient", I can correctly access the same share through SMB v1 and files are correctly displayed as files and usable, cf attachment "smbclient-works.txt"

Bruno F (bruno-fr) wrote :
Bruno F (bruno-fr) wrote :
Changed in samba (Ubuntu):
status: Incomplete → New
Andreas Hasenack (ahasenack) wrote :

When you are connected with the GUI and seeing all files as browsers, can you please run smbstatus on your NAS to see what protocol version was used?

NT1 is used for browsing when you set that option, but the client (your machine) might switch to a higher version if the NAS says it supports it.

For example, I just tried with a 20.04 install, browser to my NAS (a synology DS216) using windows network, and when I actually connected to a share, smbstatus on the server says it used SMB3_11:

root@ds216:~# smbstatus
29552 1587992052 andreas 10.10.1.230 downloads SMB3_11

Regarding your smbclient test, you didn't add the -m switch, so it's likely is used a higher protocol version.

Example:
a) no -m switch:
$ smbclient //ds216.lowtech/downloads
Enter WORKGROUP\andreas's password:
Try "help" to get a list of possible commands.
smb: \>

smbstatus on the NAS:
# smbstatus
29833 1587992358 andreas 10.10.1.195 downloads SMB3_11

b) with -m NT1:
$ smbclient //ds216.lowtech/downloads -m NT1
Enter WORKGROUP\andreas's password:
Try "help" to get a list of possible commands.
smb: \>

smbstatus on the NAS:
# smbstatus
29816 1587992342 andreas 10.10.1.195 downloads NT1

Andreas Hasenack (ahasenack) wrote :

In fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1801442#c28

Looks like the fix for https://bugzilla.samba.org/show_bug.cgi?id=14101 which went into 4.11.6 needs to be reverted for now.

Thanks santa_ on #ubuntu-devel for the pointers!

I would like to add a few notes:

1. I have been experiencing this bug while using kde's plasma kio smb:// protocol in dolphin

2. To reproduce the bug, it seems you need to force the "NT1" (~ CIFS 1.0) protocol. You can do this adding these 2 lines to /etc/samba/sm.conf under the "[global]" section:
client min protocol = NT1
client max protocol = NT1

3. This bug, apparently, was fixed in samba 4.11.7 (we have 4.11.6 in focal). I have seen Andreas did some partial work on 4.11.7 for focal here:
https://launchpad.net/~ahasenack/+archive/ubuntu/samba-4117
So I just fixed the ldb symbols files and rebuilt that plasma package in this PPA:
https://launchpad.net/~panfaust/+archive/ubuntu/samba-4117

4. With the packages from my PPA the bug goes away for me, but we don't know yet which commit fixed it.

Nevermind, it seems the problem is not fixed yet in 4.11.7.

I have just tested again and I can still reproduce the bug with the packages from my PPA.

Bruno F (bruno-fr) wrote :

Jose Manuel,
I tried with the samba 4.11.7 package from your PPA and the bug still occurs with "Files"

Andreas,
I have no shell access on the NAS so I am unable to check smbstatus. However I can confirm you that it always uses SMB1. This NAS does not support SMB2/3.

I could capture SMB traffic with Wireshark. Would it help you ?

Andreas Hasenack (ahasenack) wrote :

Bruno, no need, we reproduced the bug and will work on a fix.

Changed in samba (Ubuntu):
assignee: nobody → Sergio Durigan Junior (sergiodj)
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in samba (Ubuntu):
status: New → Confirmed
LE POITTEVIN (lepolau) wrote :

Same observation, my NAS is in smb1, idem for my router with a USB disk.
The files are seen as folders. You can neither read the files nor delete them.
The same folder mounted in CIFS by fstab is seen correctly.

I have a fix and will work on getting it ready for upload today. Thanks.

For information, me too, I have the same problem: Kubuntu 20.04, files displayed like folders. Old Nas, with smb1.

On Friday, May 01 2020, Pier Luigi Cinquantini wrote:

> For information, me too, I have the same problem: Kubuntu 20.04, files
> displayed like folders. Old Nas, with smb1.

Could you folks please give it a try with:

https://launchpad.net/~sergiodj/+archive/ubuntu/samba-bug1872476-v2

?

Thanks,

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

H I Murphy (him610) wrote :

Yes, issue is present on 2 systems running Xubuntu LTS 20.04. Another system (18.04.4) has no problem accessing files as files on legacy NAS running freenas vers 0.68.

I did that:
I addedd the new PPA:
sudo add-apt-repository ppa:sergiodj/samba-bug1872476-v2
I updated
sudo apt-get update
I upgraded installing the new samba files.

But now it doesn't see the NAS.

If useful, in the beginning I created .smb/smb.conf with these lines:
[global]
    client min protocol = NT1
    client max protocol = SMB3

I'm not an expert, maybe I have to do something more..

A moment!
I did these commands:
smbclient -L //192.168.1.51 -N --option='client min protocol = NT1'
smbclient -L //192.168.1.51 --user="USER"%"PASSWORD" --option='client min protocol = NT1'

and now it works properly.

On Friday, May 01 2020, Pier Luigi Cinquantini wrote:

> A moment!
> I did these commands:
> smbclient -L //192.168.1.51 -N --option='client min protocol = NT1'
> smbclient -L //192.168.1.51 --user="USER"%"PASSWORD" --option='client min protocol = NT1'
>
> and now it works properly.

I assume that "works properly" means that the bug has been fixed, right?

Thanks for checking!

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Right!
Thank you.
A question, please. Now the official PPA will be updated with the nes files, isn't?
What to do with these bug-files? Do remove them before the updating?

Max-Ulrich Farber (m.u.farber) wrote :

Hi Sergio Durigan jr.,

could you please tell us what has been changed in the samba 4.11.7 package in your PPA. It would be fine if I could know that before installing your samba version in my system. I am surprised that you could find the bug in samba and not in GIO/gvfs, for smbclient and mount.cifs both work fine without any problems in the original samba 4.11.7, and files are not shown as folders there.

On Friday, May 01 2020, Pier Luigi Cinquantini wrote:

> Right!
> Thank you.
> A question, please. Now the official PPA will be updated with the nes files, isn't?
> What to do with these bug-files? Do remove them before the updating?

This PPA is for testing purposes only. I will soon create an SRU to
officially ship these fixes to focal.

Thanks,

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

On Friday, May 01 2020, Max-Ulrich Farber wrote:

> Hi Sergio Durigan jr.,

Hi Max-Ulrich,

> could you please tell us what has been changed in the samba 4.11.7
> package in your PPA. It would be fine if I could know that before
> installing your samba version in my system. I am surprised that you
> could find the bug in samba and not in GIO/gvfs, for smbclient and
> mount.cifs both work fine without any problems in the original samba
> 4.11.7, and files are not shown as folders there.

The PPA still contains samba 4.11.6, not 4.11.7. We don't want to bump
the package version right now, so I just backported a few fixes needed
to fix this problem.

The fixes are:

  https://gitlab.com/samba-team/devel/samba/-/commit/a33656c9df2cde3ff1cfc6b0427c7dfb2b140cae
  https://gitlab.com/samba-team/devel/samba/-/commit/a95a8c7eaa46d5c8c485de714f0a97e307e49f7e
  https://gitlab.com/samba-team/devel/samba/-/commit/39c910fd9cba3caf7414274b678b9eee33d7e20b

The first two are included in samba 4.11.7; the third one hasn't been
released yet, AFAIK.

It's interesting to notice that the bug manifests only on GIO/gvfs, and
not on mount.cifs/smbclient, not even when using samba 4.11.6. I
haven't investigated much to find the reason for this discrepancy; maybe
GIO/gvfs's implementation of the SMB protocol are able to trigger a
corner case on samba when using SMB1. You can look at the bugs from
Fedora and/or Samba to see that the problem was with the way
libsmbclient dealt with stat(2) on UNIX:

  https://bugzilla.samba.org/show_bug.cgi?id=14101
  https://bugzilla.redhat.com/show_bug.cgi?id=1801442#c28

As I explained to Pier, there will be an SRU for samba on focal which
will include this fix.

Cheers,

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Bruno F (bruno-fr) wrote :

Sergio,

Thank for your fix !

After adding your ppa, I did the same test as the one I described in comment #2.
Now files are correctly displayed as files when I browse my SMBv1 NAS with Dolphin or PCManFM-Qt.

Max-Ulrich Farber (m.u.farber) wrote :

Thanks, Sergio!

After adding your ppa in a newly installed virtual machine with Xubuntu 20.02, all shares of my NAS and my FritzBox were accessible and browsable via SMB-1 (client max protocol = NT1). I tried with Thunar and Nautilus (both gtk and therefore using gvfs); all files are displayed correctly and accessible without any problems. As Bruno F verified, it is the same thing for file managers in qt (Kubuntu, Dolphin and others) using GIO slaves.

For my real machines I shall wait for the SRU you announced, and I hope it will arrive soon!

Hi Sergio,

I have tried to build a package just with the posix stat patch here:
https://launchpad.net/~panfaust/+archive/ubuntu/samba-bugfix

In my case that patch seems enough to get it working again for me.

Would you mind to explain why the other 2 patches are needed? Thanks for your work.

Changed in samba (Ubuntu):
importance: Undecided → High
tags: added: rls-ff-incoming

On Monday, May 04 2020, Jose Manuel Santamaria Lema wrote:

> Hi Sergio,

Hey Jose,

> I have tried to build a package just with the posix stat patch here:
> https://launchpad.net/~panfaust/+archive/ubuntu/samba-bugfix
>
> In my case that patch seems enough to get it working again for me.

Heh, that's interesting. I was indeed starting to test this scenario
here myself. After playing a bit with this bug, I noticed that, in
order to really check whether the bug has been fixed or not, it's better
if you umount and remount the samba share. If you don't, then the bug
might still manifest even after you install a samba package with the
fix.

> Would you mind to explain why the other 2 patches are needed? Thanks for
> your work.

Because of what I explained above, I initially thought the fix involved
upgrading samba to 4.11.7 + backporting the POSIX stat patch. So what I
did was try to find possible patch candidates on 4.11.7 that might be
needed to fix the bug.

Anyhow, I'm running some more tests here and will file the SRU as soon
as I have a confirmation of the necessary patch(es) to fix the bug.

Thanks,

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

ffatman (jjjnjankowski) wrote :

For me works only the solution:
 sudo add-apt-repository ppa:sergiodj/samba-bug1872476-v2
and line added
 client min protocol = CORE
as access to Freebox and D-Link NAS Freebox connected and to see files as files.

But this solution affects SMPlayer & VLC.

SMPlayer (mpv):

/usr/bin/mpv --no-config --no-quiet --terminal --no-msg-color --input-file=/dev/stdin --msg-level=ffmpeg/demuxer=error --no-fs --hwdec=no --sub-auto=fuzzy --audio-device=pulse/alsa_output.pci-0000_00_09.2.analog-stereo --ao=pulse, --no-input-default-bindings --input-vo-keyboard=no --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=211812372 --monitorpixelaspect=1 --osd-level=1 --osd-scale=1 --osd-bar-align-y=0.6 --sub-ass --embeddedfonts --sub-ass-line-spacing=0 --sub-scale=1 --sub-font=Noto Sans --sub-color=#ffffffff --sub-shadow-color=#ff000000 --sub-border-color=#ff000000 --sub-border-size=0.75 --sub-shadow-offset=2.5 --sub-font-size=60 --sub-bold=yes --sub-italic=no --sub-margin-y=0 --sub-margin-x=0 --sub-ass-force-style=PlayResX=512,PlayResY=320,Name=Default,Fontname=Noto Sans,Fontsize=24,PrimaryColour=&H00ffffff,BackColour=&H00000000,OutlineColour=&H00000000,Bold=1,Italic=0,Alignment=1,BorderStyle=1,Outline=0.3,Shadow=0,MarginL=0,MarginR=0,MarginV=0 --sub-codepage=CP1250 --sub-pos=100 --volume=165 --cache=auto --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg --screenshot-directory=/home/bagadyr/Obrazy/smplayer_screenshots --audio-pitch-correction=yes --volume-max=300 --term-playing-msg=MPV_VERSION=${=mpv-version:}
INFO_VIDEO_WIDTH=${=width}
INFO_VIDEO_HEIGHT=${=height}
INFO_VIDEO_ASPECT=${=video-params/aspect}
INFO_VIDEO_FPS=${=container-fps:${=fps}}
INFO_VIDEO_FORMAT=${=video-format}
INFO_VIDEO_CODEC=${=video-codec}
INFO_AUDIO_FORMAT=${=audio-codec-name}
INFO_AUDIO_CODEC=${=audio-codec}
INFO_AUDIO_RATE=${=audio-params/samplerate}
INFO_AUDIO_NCH=${=audio-params/channel-count}
INFO_LENGTH=${=duration:${=length}}
INFO_DEMUXER=${=current-demuxer:${=demuxer}}
INFO_SEEKABLE=${=seekable}
INFO_TITLES=${=disc-titles}
INFO_CHAPTERS=${=chapters}
INFO_TRACKS_COUNT=${=track-list/count}
METADATA_TITLE=${metadata/by-key/title:}
METADATA_ARTIST=${metadata/by-key/artist:}
METADATA_ALBUM=${metadata/by-key/album:}
METADATA_GENRE=${metadata/by-key/genre:}
METADATA_DATE=${metadata/by-key/date:}
METADATA_TRACK=${metadata/by-key/track:}
METADATA_COPYRIGHT=${metadata/by-key/copyright:}
INFO_MEDIA_TITLE=${=media-title:}
INFO_STREAM_PATH=${stream-path}
 --audio-client-name=SMPlayer --term-status-msg=STATUS: ${=time-pos} / ${=duration:${=length:0}} P: ${=pause} B: ${=paused-for-cache} I: ${=core-idle} VB: ${=video-bitrate:0} AB: ${=audio-bitrate:0} /run/user/1000/gvfs/smb-share:server=dlink-8f6f7d,share=volume_1/BIBLIOTEKA/FILMY/C/Casino.Royale.1967/Casino Royale.mp4

Error parsing option input-file (option not found)
Setting commandline option --input-file=/dev/stdin failed.
Exiting... (Fatal error)

VLC - slow and slow frame rate.

On Monday, May 04 2020, I wrote:

> Anyhow, I'm running some more tests here and will file the SRU as soon
> as I have a confirmation of the necessary patch(es) to fix the bug.

I confirmed that the POSIX stat patch is indeed the only one needed to
fix this bug. Thanks, Jose!

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Download full text (3.5 KiB)

On Monday, May 04 2020, ffatman wrote:

> For me works only the solution:
> sudo add-apt-repository ppa:sergiodj/samba-bug1872476-v2
> and line added
> client min protocol = CORE
> as access to Freebox and D-Link NAS Freebox connected and to see files as files.

Sorry, do you mean that the PPA package works for you?

AFAIK, the CORE protocol is silently upgraded to NT1, so you could use
"client protocol min = NT1".

> But this solution affects SMPlayer & VLC.
>
> SMPlayer (mpv):
>
> /usr/bin/mpv --no-config --no-quiet --terminal --no-msg-color
> --input-file=/dev/stdin --msg-level=ffmpeg/demuxer=error --no-fs
> --hwdec=no --sub-auto=fuzzy
> --audio-device=pulse/alsa_output.pci-0000_00_09.2.analog-stereo
> --ao=pulse, --no-input-default-bindings --input-vo-keyboard=no
> --no-input-cursor --cursor-autohide=no --no-keepaspect --wid=211812372
> --monitorpixelaspect=1 --osd-level=1 --osd-scale=1
> --osd-bar-align-y=0.6 --sub-ass --embeddedfonts
> --sub-ass-line-spacing=0 --sub-scale=1 --sub-font=Noto Sans
> --sub-color=#ffffffff --sub-shadow-color=#ff000000
> --sub-border-color=#ff000000 --sub-border-size=0.75
> --sub-shadow-offset=2.5 --sub-font-size=60 --sub-bold=yes
> --sub-italic=no --sub-margin-y=0 --sub-margin-x=0
> --sub-ass-force-style=PlayResX=512,PlayResY=320,Name=Default,Fontname=Noto
> Sans,Fontsize=24,PrimaryColour=&H00ffffff,BackColour=&H00000000,OutlineColour=&H00000000,Bold=1,Italic=0,Alignment=1,BorderStyle=1,Outline=0.3,Shadow=0,MarginL=0,MarginR=0,MarginV=0
> --sub-codepage=CP1250 --sub-pos=100 --volume=165 --cache=auto
> --screenshot-template=cap_%F_%p_%02n --screenshot-format=jpg
> --screenshot-directory=/home/bagadyr/Obrazy/smplayer_screenshots
> --audio-pitch-correction=yes --volume-max=300
> --term-playing-msg=MPV_VERSION=${=mpv-version:}
> INFO_VIDEO_WIDTH=${=width}
> INFO_VIDEO_HEIGHT=${=height}
> INFO_VIDEO_ASPECT=${=video-params/aspect}
> INFO_VIDEO_FPS=${=container-fps:${=fps}}
> INFO_VIDEO_FORMAT=${=video-format}
> INFO_VIDEO_CODEC=${=video-codec}
> INFO_AUDIO_FORMAT=${=audio-codec-name}
> INFO_AUDIO_CODEC=${=audio-codec}
> INFO_AUDIO_RATE=${=audio-params/samplerate}
> INFO_AUDIO_NCH=${=audio-params/channel-count}
> INFO_LENGTH=${=duration:${=length}}
> INFO_DEMUXER=${=current-demuxer:${=demuxer}}
> INFO_SEEKABLE=${=seekable}
> INFO_TITLES=${=disc-titles}
> INFO_CHAPTERS=${=chapters}
> INFO_TRACKS_COUNT=${=track-list/count}
> METADATA_TITLE=${metadata/by-key/title:}
> METADATA_ARTIST=${metadata/by-key/artist:}
> METADATA_ALBUM=${metadata/by-key/album:}
> METADATA_GENRE=${metadata/by-key/genre:}
> METADATA_DATE=${metadata/by-key/date:}
> METADATA_TRACK=${metadata/by-key/track:}
> METADATA_COPYRIGHT=${metadata/by-key/copyright:}
> INFO_MEDIA_TITLE=${=media-title:}
> INFO_STREAM_PATH=${stream-path}
> --audio-client-name=SMPlayer --term-status-msg=STATUS: ${=time-pos} /
> ${=duration:${=length:0}} P: ${=pause} B: ${=paused-for-cache} I:
> ${=core-idle} VB: ${=video-bitrate:0} AB: ${=audio-bitrate:0}
> /run/user/1000/gvfs/smb-share:server=dlink-8f6f7d,share=volume_1/BIBLIOTEKA/FILMY/C/Casino.Royale.1967/Casino
> Royale.mp4
>
> Error parsing option input-file (option not found)
> Setting commandline option --input-file=/...

Read more...

ffatman (jjjnjankowski) wrote :

"Sorry, do you mean that the PPA package works for you?"

Yes, but with problems, I've found that comic books (cbr, cbz..) are recognized as documents, and many formats of documents (lit, doc, rtf...) are not recognized.

Is it a difference between "client min protocol" and "client protocol min"?

Edit: Don't mind, "NT1" not connecting. Only "CORE".

On Monday, May 04 2020, ffatman wrote:

> "Sorry, do you mean that the PPA package works for you?"
>
> Yes, but with problems, I've found that comic books (cbr, cbz..) are
> recognized as documents, and many formats of documents (lit, doc,
> rtf...) are not recognized.

What do you mean by "not recognized"?

I cannot reproduce this bug here. I created a .doc document inside a
share, and was able to access it without problems using Nautilus.

Can you confirm that this bug does *not* happen with the current version
from focal?

> Is it a difference between "client min protocol" and "client protocol
> min"?

Sorry, it should have been "client min protocol = NT1".

> Edit: Don't mind, "NT1" not connecting. Only "CORE".

This is strange.

What does "sudo smbstatus" say?

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Max-Ulrich Farber (m.u.farber) wrote :

In the German UbuntuUsers forum there are several threads concerning this bug, for instance:

https://forum.ubuntuusers.de/topic/freigaben-im-netzwerk-sind-nicht-erreichbar/

For some users it happens regularly (like myself), for others it happens sometimes and with several kinds of files only, and still others say that it does not happen at all. This is very strange!

Anyhow, for me the bug seems to disappear completely with Sergio's update.

Changed in samba (Ubuntu Focal):
assignee: nobody → Sergio Durigan Junior (sergiodj)
status: New → In Progress
importance: Undecided → High
description: updated
H I Murphy (him610) wrote :

When I try, using Thunar, to open my fileserver, error message appears:
Failed to open 'fileserver'. Failed to retrieve share list from server: Software caused connection abort.

 affects ubuntu/samba
 affects thunar

May be related to Bug #1872476

Steps to recreate:
1. Open FileManager (thunar 1.8.14)
2. Left click mouse on Browse Network
3. Double-left click mouse on fileserver (freenas0)
  or right click then select Open with "FileManager" in dropdown list.
Error message appears:
Failed to open 'fileserver'. Failed to retrieve share list from server: Software caused connection abort.

Max-Ulrich Farber (m.u.farber) wrote :

@ H I Murphy:

This is not a bug but a feature. In SMBv2 and SMBv3 there are no more share lists, and SMBv1 is disabled by default in samba 4.11. But the error message is quite misleading!

Andreas Hasenack (ahasenack) wrote :

For the SRU team reviewing this, I can confirm the bug is fixed in samba 4.12.2 which I will upload to groovy shortly:

root@groovy-samba-file-folder:~# gio info smb://127.0.0.1/testshare/123.txt | grep '^type:'
type: regular
root@groovy-samba-file-folder:~# apt-cache policy samba
samba:
  Installed: 2:4.12.2+dfsg-0ubuntu1~ppa2
  Candidate: 2:4.12.2+dfsg-0ubuntu1~ppa2
  Version table:
 *** 2:4.12.2+dfsg-0ubuntu1~ppa2 500
        500 http://ppa.launchpad.net/ahasenack/samba-4122/ubuntu groovy/main amd64 Packages
        100 /var/lib/dpkg/status
     2:4.11.6+dfsg-0ubuntu1.1 500
        500 http://archive.ubuntu.com/ubuntu groovy/main amd64 Packages

Hello INIZAN, or anyone else affected,

Accepted samba into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/samba/2:4.11.6+dfsg-0ubuntu1.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in samba (Ubuntu Focal):
status: In Progress → Fix Committed
tags: added: verification-needed verification-needed-focal
Vincent (vinnl) wrote :

Thanks Brian, I just upgrade to the package from focal-proposed, and it worked for me. The testing I did was accessing a Samba share through Nautilus that would previously throw an error when I copied files there, and that would display files as folder. With the updated version, I could copy files onto it, and files were listed as they should.

The versions of the packages I tested:

    Selected version '2:4.11.6+dfsg-0ubuntu1.2' (Ubuntu:20.04/focal-proposed [amd64]) for 'samba'
    Selected version '2:4.11.6+dfsg-0ubuntu1.2' (Ubuntu:20.04/focal-proposed [amd64]) for 'samba-common-bin' because of 'samba'
    Selected version '2:4.11.6+dfsg-0ubuntu1.2' (Ubuntu:20.04/focal-proposed [amd64]) for 'samba-libs' because of 'samba-common-bin'

tags: added: verification-done-focal
removed: verification-needed-focal
Bruno F (bruno-fr) wrote :

I did some testing with these new packages : I have activated focal-proposed repository on two new virtual machines. One is Ubuntu 20.04 and the other LUbuntu 20.04.
On both VM, I upgraded all packages and now samba-common, samba-libs, libwbclient0:amd64 and libsmbclient:amd64 have version 2:4.11.6+dfsg-0ubuntu1.2

I added "client min protocol = NT1" to /etc/samba/smb.conf in [global] section to access my NAS which ONLY support SMB v1.

Now files are correctly displayed as files when I browse this NAS with Nautilus on Ubuntu 20.04
and they are also correctly displayed as files with Dolphin and PCManFM-Qt on LUbuntu 20.04.
And now I can watch the video files stored on this NAS with VLC.

With the old package version 2:4.11.6+dfsg-0ubuntu1, files were displayed as folder, see my comment #2

Below are some outputs exhibiting the bug and its correction.

Reference test with samba:amd64 2:4.11.6+dfsg-0ubuntu1.1

# gio mount -a smb://xxxx/xxxxxxxx
# ls -l /run/user/1000/gvfs/smb-share\:server\=xxxx\,share\=xxxxxxxx/
total 0
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Enregistrements
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Laurent-2019-08-31-18-27-03.gramps
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Médias
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Musiques
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Photos
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Téléchargements
drwx------ 1 sylvie sylvie 0 avril 2 18:57 Vidéos

Test with proposed samba:amd64 2:4.11.6+dfsg-0ubuntu1.2

# gio mount -a smb://xxxx/xxxxxxxx
# ls -l /run/user/1000/gvfs/smb-share\:server\=xxxx\,share\=xxxxxxxx/
total 111
drwx------ 1 sylvie sylvie 0 févr. 2 10:27 Enregistrements
-rwx------ 1 sylvie sylvie 112916 août 31 2019 Laurent-2019-08-31-18-27-03.gramps
drwx------ 1 sylvie sylvie 0 févr. 2 10:29 Médias
drwx------ 1 sylvie sylvie 0 nov. 18 2018 Musiques
drwx------ 1 sylvie sylvie 0 févr. 2 10:31 Photos
drwx------ 1 sylvie sylvie 0 avril 4 10:14 Téléchargements
drwx------ 1 sylvie sylvie 0 févr. 2 10:30 Vidéos

The proposed version fixed the problem for me.
Thanks.

ffatman (jjjnjankowski) wrote :

samba:amd64=2:4.11.6+dfsg-0ubuntu1.2 seems at last working properly. It's official Canonical focal-propoosed I presume. Thanks to everyone who's been working hard for the last two weeks!

Andreas Hasenack (ahasenack) wrote :

This is fixed in 4.12.2 uploaded to groovy, so marking that task as fix released.

Changed in samba (Ubuntu):
status: Confirmed → Fix Released

The verification of the Stable Release Update for samba has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:4.11.6+dfsg-0ubuntu1.2

---------------
samba (2:4.11.6+dfsg-0ubuntu1.2) focal; urgency=medium

  * Fix "Shared files are shown as folders" (LP: #1872476)
    - d/p/0023-libsmb-Don-t-try-to-find-posix-stat-info-in-SMBC_get.patch:
      Don't obtain stat(2) information if dealing with older protocols on
      UNIX-like systems.

 -- Sergio Durigan Junior <email address hidden> Thu, 30 Apr 2020 15:17:24 -0400

Changed in samba (Ubuntu Focal):
status: Fix Committed → Fix Released
ffatman (jjjnjankowski) wrote :

>> What do you mean by "not recognized"? (cbr, cbz, doc, lit etc...)<<

@sergiodj: "Unknown type", when to copy on the desk - recognizable. Still exist the ptoblem.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.