[Samba] testparm and includes

André Welter welter at bitbone.de
Thu Jun 19 15:21:22 GMT 2008


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?
>
> 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






More information about the samba mailing list