[Samba] testparm and includes

John H Terpstra jht at samba.org
Thu Jun 19 15:33:36 GMT 2008


On Thursday 19 June 2008 10:21:22 André Welter wrote:
> André Welter schrieb:
> > Hi list!
> >
> > I've read some remarks here and in other places that it would be good
> > practice to not edit the smb.conf file directly but rather keep a
> > smb.conf.master file, edit that and then do a testparm -s > smb.conf.
> >
> > Here comes my problem:
> >
> > My smb.conf file uses some include statements. When using testparm those
> > include lines are still in the output directly followed by the content
> > of the included file. This would lead to a kind of double inclusion if I
> > used the output of testparm as my new smb.conf.
> > Is this intentional?

Yes, this behavior is intentional.  The testparm utility is designed to 
produce the total picture presented by a fully parsed smb.conf file.

- John T.

> >
> > Thx,
> >
> > André
>
> Sorry, I forgot to mention, this only happens with the second level of
> includes. Here is an example:
>
> smb.conf:
> [global]
>         server string = myserver
>         encrypt passwords = yes
>         obey pam restrictions = no
>         workgroup = myworkgroup
>         enable privileges = yes
>         security = user
>         passdb backend = smbpasswd
>         include=includes.smb
>
> [print$]
>         path = /etc/samba/printer/
>         browsable = yes
>         guest ok = yes
>         read only = yes
>
>
> includes.smb:
> include=smbopts.share1
> include=smbopts.share2
>
>
> smbopts.share1:
> [share1]
> path = /data/share1
> guest ok = yes
>
>
> smbopts.share2:
> [share2]
> path = /data/share2
> guest ok = yes
>
>
> and what testparm makes of it:
> Load smb config files from smb.conf
> Processing section "[share1]"
> Processing section "[share2]"
> Processing section "[print$]"
> Loaded services file OK.
> Server role: ROLE_STANDALONE
> [global]
>         workgroup = MYWORKGROUP
>         server string = myserver
>         include = smbopts.share1
>
> [share1]
>         path = /data/share1
>         guest ok = Yes
>         include = smbopts.share2
>
> [share2]
>         path = /data/share2
>
> [print$]
>         path = /etc/samba/printer/
>         guest ok = Yes



-- 
John H Terpstra
Samba-Team Member
Phone: +1 (512) 970-0256

Author:
The Official Samba-3 HOWTO & Reference Guide, 2 Ed., ISBN: 0131882228
Samba-3 by Example, 2 Ed., ISBN: 0131882221X
Hardening Linux, ISBN: 0072254971
Other books in production.


More information about the samba mailing list