Subject: | CreateShare should add share at the bottom |
Date: | Fri, 25 Sep 2020 08:30:06 +0200 |
To: | bug-File-Samba [...] rt.cpan.org |
From: | Christian Fenzl <fenzl [...] t-r-t.at> |
Perl v5.28.1 on Raspbian Buster
File::Samba 0.03
createShare adds the new share at the top.
File shares should be added at the bottom of the configuration, as the
smb.conf "copy" will not work with shares that are listed above the share
to clone.
Example:
# In /tmp/smb.conf a share 'othershare' already exists
use File::Samba;
my $smb = File::Samba->new("/tmp/smb.conf");
$smb->createShare('newshare');
$smb->sectionParameter('newshare', 'copy', 'othershare');
$smb->sectionParameter('newshare', 'path', '/tmp');
$smb->save('/tmp/smb.conf');
Running the Samba config test will fail:
testparm -s --debuglevel=1 /tmp/smb.conf
Load smb config files from /tmp/smb.conf
Unable to copy service - source not found: othershare
Error loading services.
This is, because the 'copy' parameter requires that the share to clone is
above the copied share.
File::Samba always adds the shares on top.