[Samba] [Bug] Cannot create file but read/write is ok
Rowland penny
rpenny at samba.org
Thu Aug 8 07:51:23 UTC 2019
On 08/08/2019 05:32, lampahome via samba wrote:
> I don't know why I can't register bugzilla so I post here.
>
> I have two ubuntu 16.04 machine A, B, and A install samba version 4.10.6,
> and B install version 4.3.11.
> I use samba-vfs in machine A.
>
> I mount share of A in B ex:
> sudo mount -t cifs -o username='ppp',password='admin' //IP/public
> /home/ppp/test
>
> And I found I can create file like $ touch test/yo
> But I can read/write from existing files in /home/ppp/test
>
> Here is smb.conf of A and I use samba-vfs module:
> [global]
>
> workgroup = MYGROUP
>
> server string = Samba Server
>
> server role = standalone server
>
> log file = /usr/local/samba/var/log.%m
>
> max log size = 50
>
> dns proxy = no
>
> [printers]
> comment = All Printers
> path = /usr/spool/samba
> browseable = no
> guest ok = no
> writable = no
> printable = yes
>
> [public]
> path = /home/ppp/share
> available = yes
> valid users = ppp
> read only = no
> browseable = yes
> public = yes
> vfs objects = full_audit
> full_audit:prefix = [%U:%g@%I]
> full_audit:success = all
> full_audit:failure = all
> full_audit:facility = local7
> full_audit:priority = info
>
> I found I can create file if I remove vfs variable and full_audit blabla.
>
> Then I dig in and I found the %g will cause me fail to create file.
>
> When I change from
> full_audit:prefix = [%U:%g@%I]
> to
> full_audit:prefix = [%U:%I]
>
> I can create file finally.
>
> Anyone can help?
First, this is useless: 'public = yes' (which is really 'guest ok =
yes') for two reasons, you also have 'valid users = ppp', so only 'ppp'
can connect, but even if that wasn't there, it wouldn't allow guest
access because you do not have 'map to guest = bad user' in [global].
As for '%g', have you created a Samba group for ppp's primary group and
mapped ppp's primary group to this ?
Rowland
More information about the samba
mailing list