Set client max/min protocol via environmantal variables

Mikhail Novosyolov m.novosyolov at
Tue Feb 12 20:13:00 UTC 2019

12.02.2019 23:01, Andreas Schneider пишет:
> On Tuesday, 12 February 2019 20:27:49 CET Mikhail Novosyolov wrote:
>> 12.02.2019 21:47, Andreas Schneider пишет:
>>> On Tuesday, February 12, 2019 6:50:35 PM CET Mikhail Novosyolov via samba-
>>> technical wrote:
>>>> I've made a patch trying to allow setting 'client min protocol' and
>>>> 'client max protocol' via an environmental variable.
>>>> Samba 4.9.4 with this patch builds OK, but I don't see any effect from
>>>> e.g. SMB_CLIENT_MAX_PROTOCOL=NT1, even when setting this in systemd unit
>>>> smb.service
>>> What are you trying to achieve?
>> I am trying to workaround listing smb:// network/workgroups, broken in
>> Samba 4.8 compared to Samba 4.7 due to client min protocol becoming SMB3
>> and fixing Badlock.
>> Listing is done not be smbdclient CLI tool, but via
> There is a function for doing that, see:
> 0dae4e2f5c65167fdb2405e232436921a0bb17e6
> This has been implemented for gvfs. The function is only available in Samba
> 4.10 release candidates. You have to wait till 4.10 will be released to be
> able to consume the function.
I know this and cherry-picked 0dae4e2f5c65167fdb2405e232436921a0bb17e6 
and 50f89bcdc9473abf69da1fee6f9014df63adc3e3 to samba 4.9, it is what is about. When I made 
that bug, I did not understand that I had made a mistake and that 
actually did not help, I just had 'client max protocol = NT1' in my 
config and thought that patches helped.

My samba build is here:

Yes, this has been implemented in gvfs via
but right now I've installed Mageia 7 beta with Samba 4.10 rc1 and GVFS 
1.38.1 (1.38.1 already has this patch, but gitlab does not show this for 
some reason).
Browsing smb:// in Nautilus returns nothing, even if I set 'client max 
protocol = NT1' in ~/.smb/smb.conf. smbtree does see the network:

> $ smbtree
> Unable to initialize messaging context
> Enter MYGROUP\user's password:
>     \\ROSA5                  Samba on rosa5 (ROSA GNU/Linux 2016.1)
>         \\ROSA5\IPC$               IPC Service (Samba on rosa5 (ROSA 
> GNU/Linux 2016.1))
>         \\ROSA5\print$             Printer Drivers
>     \\ROSA4                  Samba on rosa4 (ROSA GNU/Linux 2016.1)
>         \\ROSA4\IPC$               IPC Service (Samba on rosa4 (ROSA 
> GNU/Linux 2016.1))
>         \\ROSA4\print$             Printer Drivers
>     \\ROSA3                  Samba on rosa3 (ROSA GNU/Linux 2016.1)
>         \\ROSA3\IPC$               IPC Service (Samba on rosa3 (ROSA 
> GNU/Linux 2016.1))
>         \\ROSA3\print$             Printer Drivers
>     \\ROSA2                  Samba on rosa2 (ROSA GNU/Linux 2016.1)
>         \\ROSA2\IPC$               IPC Service (Samba on rosa2 (ROSA 
> GNU/Linux 2016.1))
>         \\ROSA2\print$             Printer Drivers
>     \\PAY2                   Samba on pay2 (ROSA GNU/Linux 2016.1)
>         \\PAY2\Boomaga            Boomaga
>         \\PAY2\Kyocera-FS-1060DN    Kyocera FS-1060DN (USB)
>         \\PAY2\Kyocera-FS-1060DN-KPSL    Kyocera FS-1060DN KPSL
>         \\PAY2\IPC$               IPC Service (pay2 server (Samba, 
> Ubuntu))
>         \\PAY2\print$             Printer Drivers
On ROSA ( is ROSA build server) with samba 4.9.4 
( setting 'client max protocol = NT1' 
does help to list smb:///

More information about the samba-technical mailing list