[Samba] testparm and includes

This is a discussion on [Samba] testparm and includes within the Samba forums, part of the Networking and Network Related category; Hi list! I've read some remarks here and in other places that it would be good practice to not ...


Go Back   Usenet Forums > Networking and Network Related > Samba

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-19-2008
André Welter
 
Posts: n/a
Default [Samba] testparm and includes

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é


--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #2 (permalink)  
Old 06-19-2008
André Welter
 
Posts: n/a
Default Re: [Samba] testparm and includes

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




--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #3 (permalink)  
Old 06-19-2008
John H Terpstra
 
Posts: n/a
Default Re: [Samba] testparm and includes

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.
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #4 (permalink)  
Old 06-20-2008
André Welter
 
Posts: n/a
Default Re: [Samba] testparm and includes

John H Terpstra schrieb:
> 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.
>
>

Thanks for your reply and sorry for insisting.
But what use does it have if the include statements are shown in the
fully parsed smb.conf right next to the content of the included files?
Wouldn't it be cleaner to just replace the include statements with the
content that is included?

Thanks again for your time.
>>> 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
>>

>
>
>
>



--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
  #5 (permalink)  
Old 06-20-2008
Helmut Hullen
 
Posts: n/a
Default Re: [Samba] testparm and includes

Hallo, André,

Du (welter) meintest am 20.06.08:

> John H Terpstra schrieb:
>> 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.
>>
>>

> Thanks for your reply and sorry for insisting.
> But what use does it have if the include statements are shown in the
> fully parsed smb.conf right next to the content of the included
> files? Wouldn't it be cleaner to just replace the include statements
> with the content that is included?


> Thanks again for your time.
>>>> 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
>>>

>>
>>
>>
>>


Dont full quote - please!
Thank you!

Viele Gruesse!
Helmut
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:55 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0