So if we create '20writable' and enter this text (change what ever is in BOLD):
Ok, thanks. I created the file in MidnightCommander:
{
if ($key eq 'ged-files')
{
$OUT .= "writable = no\n";
$OUT .= "write list = \@teachers\n";
$OUT .= "valid users = \@teachers \@ged\n";
}
}
Edit: I just found out the hard way that you have to have a LF at the end of the file. Without it the result is:
[root@mef-server ibays]# expand-template /etc/smb.conf
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/esmith/templates.pm line 579.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: ERROR: Cannot process template /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable:
at /etc/e-smith/templates//etc/smb.conf/90ibays line 9
WARNING in /etc/e-smith/templates//etc/smb.conf/90ibays: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/smb.conf/90ibays line 9.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/esmith/templates.pm line 579.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: ERROR: Cannot process template /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable:
at /etc/e-smith/templates//etc/smb.conf/90ibays line 9
WARNING in /etc/e-smith/templates//etc/smb.conf/90ibays: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/smb.conf/90ibays line 9.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/esmith/templates.pm line 579.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: ERROR: Cannot process template /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable:
at /etc/e-smith/templates//etc/smb.conf/90ibays line 9
WARNING in /etc/e-smith/templates//etc/smb.conf/90ibays: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/smb.conf/90ibays line 9.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/esmith/templates.pm line 579.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: ERROR: Cannot process template /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable:
at /etc/e-smith/templates//etc/smb.conf/90ibays line 9
WARNING in /etc/e-smith/templates//etc/smb.conf/90ibays: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/smb.conf/90ibays line 9.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/esmith/templates.pm line 579.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: ERROR: Cannot process template /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable:
at /etc/e-smith/templates//etc/smb.conf/90ibays line 9
WARNING in /etc/e-smith/templates//etc/smb.conf/90ibays: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/smb.conf/90ibays line 9.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: Use of uninitialized value in concatenation (.) or string at /usr/lib/perl5/site_perl/esmith/templates.pm line 579.
WARNING in /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable: ERROR: Cannot process template /etc/e-smith/templates-custom//etc/smb.conf/ibays/writable:
at /etc/e-smith/templates//etc/smb.conf/90ibays line 9
WARNING in /etc/e-smith/templates//etc/smb.conf/90ibays: Use of uninitialized value in concatenation (.) or string at /etc/e-smith/templates//etc/smb.conf/90ibays line 9.
WARNING: Template processing succeeded for //etc/samba/smb.conf: 6 fragments generated warnings
at /sbin/e-smith/expand-template line 45
It's now working the way it should. Thanks again to all who helped.
I still believe that this is a common scenario. Best security practice is to keep the admin password in a safe place. As it is now it seems impossible to delegate authority to users to maintain non-public shares. (I think most of the target audience of SME would not be capable of implementing templates like this.
Perhaps we could have an option in server manager to modify samba access to shares?
Should I do something about the bug I raised?