See [http://nas-central.org/index.php/How_to_disable_the_automatic_update_of_smb.conf%2C_proftpd.conf%2C_Applevolumes.default How to disable the automatic update of smb.conf] Linkstation (LS1/LS2) section.

+

=LSPro/LSLive with stock or modified stock firmware=

=LSPro/LSLive with stock or modified stock firmware=

==Description of the mechanism==

==Description of the mechanism==

−

nas_configgen!!

+

nas_configgen!! (/usr/local/sbin/nas_configgen)

+

+

This is called by /etc/init.d/smb.sh in the configure() section.

+

/usr/local/sbin/nas_configgen -c samba

+

+

This file with the correct arguments, will parse /etc/melco/shareinfo & /etc/melco/info to obtain the info required to create the smb.conf.

+

+

When you create/edit the shares/basic with the WebUi, shareinfo, info & the smb.conf are rewritten & the samba service is restarted by smb.sh

+

+

+

Within nas_configgen, Buffalo have included a default [Global] section which requires a minimal amount of information taken from /etc/melco/info. Such as 'dos charset', 'netbios name', 'server string', 'wins server' & 'workgroup'.

+

The default [info] share is also added at this point.

+

+

+

The shares sections added by the user in the WebUi, are then added at the bottom of the smb.conf. These are taken from /etc/melco/shareinfo, in the following format.

Paste that after line 20 in the /etc/init.d/smb.sh - info share is removed on restart, and every restart thereafter.

Paste that after line 20 in the /etc/init.d/smb.sh - info share is removed on restart, and every restart thereafter.

+

+

'''Warning''': It's possible that the above sed line will not clean out the entire <tt>'''[info]'''</tt> stanza. In my case (LS-GL v2), the last line is not <tt>'''guest ok = yes'''</tt> but <tt>'''csc policy = disable'''</tt>. Also, if there's a problem with the sed command (eg sed gets corrupted) then smb.conf can end up empty. So perhaps this scriptlet will work more reliably:

Why this article?

On the original and modified stockfirmwares we always have a some default shares. The normal "share" is not the problem, but "info" is as you cannot get rid of it. This article describes how to deal with that problem.

LSPro/LSLive with stock or modified stock firmware

Description of the mechanism

This file with the correct arguments, will parse /etc/melco/shareinfo & /etc/melco/info to obtain the info required to create the smb.conf.

When you create/edit the shares/basic with the WebUi, shareinfo, info & the smb.conf are rewritten & the samba service is restarted by smb.sh

Within nas_configgen, Buffalo have included a default [Global] section which requires a minimal amount of information taken from /etc/melco/info. Such as 'dos charset', 'netbios name', 'server string', 'wins server' & 'workgroup'.
The default [info] share is also added at this point.

The shares sections added by the user in the WebUi, are then added at the bottom of the smb.conf. These are taken from /etc/melco/shareinfo, in the following format.

With sed

Paste that after line 20 in the /etc/init.d/smb.sh - info share is removed on restart, and every restart thereafter.

Warning: It's possible that the above sed line will not clean out the entire [info] stanza. In my case (LS-GL v2), the last line is not guest ok = yes but csc policy = disable. Also, if there's a problem with the sed command (eg sed gets corrupted) then smb.conf can end up empty. So perhaps this scriptlet will work more reliably: