[Samba] old bug with usershares of what?

Илья Коскин kasakoff87 at gmail.com
Mon Nov 5 11:03:54 UTC 2018


sorry for opening this thread again, but it looks like there is some bug in
samba usershares.
I successfully reproduced this bug in OpenBSD and in Fedora.

Steps to reproduce:
1) Use default samba config.
2) Add options:
usershare max shares = 5 (or else number)
usershare allow guests = Yes
3) create usershares directory (personally i use directory path from
testparm -v)
4) create group usershare and add target user to this group
5) chgrp usershares dir to usershare group
6) chown 1770 usershares dir
7) create usershare with: net usershare add share /home/user/share ""
Everyone:F guest_ok=y

8) try to access server with any client like windows or linux and voila:
[2018/11/05 13:53:02.185034,  0]
../source3/param/loadparm.c:3560(load_usershare_service)
  load_usershare_service: stat of /var/samba/usershares failed. Permission
denied


ср, 31 окт. 2018 г. в 15:16, Илья Коскин <kasakoff87 at gmail.com>:

>
> ср, 31 окт. 2018 г. в 14:51, Rowland Penny via samba <
>> samba at lists.samba.org>:
>>
>>> On Wed, 31 Oct 2018 14:41:45 +0300
>>> Илья Коскин via samba <samba at lists.samba.org> wrote:
>>>
>>> > Hello! Please look at this log entry:
>>> >
>>> > [2018/10/30 15:26:04.013132,  0]
>>> > ../source3/param/loadparm.c:3358(process_usershare_file)
>>> >   process_usershare_file: stat of /var/lib/samba/usershares/share
>>> > failed. Permission denied
>>> >
>>> > I don't know why this message is spamming my log, my version of samba
>>> > is 4.9.1 from fedora 29, but problem existed long time ago with older
>>> > versions.
>>> >
>>> > here is usershares permissions and file contents:
>>> >
>>> > [root at kasakoff kasak]# ls -al /var/lib/samba/usershares/
>>> > итого 12
>>> > drwxrwx--T 2 root  usershares 4096 июл 18 15:57 .
>>> > drwxr-xr-x 9 root  root       4096 окт 31 12:57 ..
>>> > -rw-r--r-- 1 kasak kasak       115 фев 19  2018 share
>>> >
>>> > [root at kasakoff kasak]# cat /var/lib/samba/usershares/share
>>> > #VERSION 2
>>> > path=/home/kasak/Общедоступные
>>> > comment=
>>> > usershare_acl=S-1-1-0:F
>>> > guest_ok=y
>>> > sharename=Share
>>> >
>>> > The message apears when I open my server from windows 10 or 7 machine.
>>> > And i have selinux disabled!
>>> > Also I have no problem accessing share from win 7, from win 10 i have
>>> > issues, and maybe it is related to this bug
>>>
>>> Can you please post your smb.conf
>>>
>>> Rowland
>>>
>>>
>>> --
>>> To unsubscribe from this list go to the following URL and read the
>>> instructions:  https://lists.samba.org/mailman/options/samba
>>
>>
> [global]
> workgroup = WORKGROUP
> security = user
> map to guest = Bad user
>
> server min protocol = SMB2
>
> printing = cups
> printcap name = cups
> load printers = yes
> cups options = raw
>
> usershare allow guests = Yes
> usershare max shares = 5
>
> [homes]
> comment = Home Directories
> valid users = %S, %D%w%S
> browseable = No
> read only = No
> inherit acls = Yes
>
> [printers]
> comment = All Printers
> path = /var/tmp
> printable = Yes
> create mask = 0600
> browseable = No
>
> [print$]
> comment = Printer Drivers
> path = /var/lib/samba/drivers
> write list = @printadmin root
> force group = @printadmin
> create mask = 0664
> directory mask = 0775
>


More information about the samba mailing list