Bug 6152 - Include files left in testparm-generated smb.conf causing issues
Summary: Include files left in testparm-generated smb.conf causing issues
Status: RESOLVED DUPLICATE of bug 4271
Alias: None
Product: Samba 3.3
Classification: Unclassified
Component: Client tools (show other bugs)
Version: 3.3.1
Hardware: x86 Linux
: P3 minor
Target Milestone: ---
Assignee: Michael Adam
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-03 06:47 UTC by Ant Owen
Modified: 2009-11-20 18:52 UTC (History)
1 user (show)

See Also:


Attachments
samba config with include files (9.03 KB, application/octet-stream)
2009-05-05 04:23 UTC, Ant Owen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ant Owen 2009-03-03 06:47:52 UTC
I have a fairly large config file, with separate include statements for most main sections, including shares. Sometimes, include statements appear in the middle of the previous section, resulting in certain options not working properly, for example root preexec in the [homes] share just doesn't run.  Once the include lines are removed from smb.conf, the root preexec works.

Here's a snippit on the testparm-generated smb.conf

[profiles]
        path = /usr/local/fhs/profiles/
        invalid users = sweepupd
        read only = No
        force create mode = 0600
        force directory mode = 02700
        profile acls = Yes
        case sensitive = No
        delete veto files = Yes
        veto files = /thumbs\.db/desktop\.ini/aquota.*/
        browseable = No
        csc policy = disable
        include = /etc/samba/shares/homes.share.conf
        root preexec = /usr/local/fhs/bin/mk-profiledir %u %d %a %m %I
        delete readonly = Yes

[homes]
        comment = Your curric home drive (%U)
        path = /usr/local/fhs/users/%U
        valid users = %S
        read only = No
        create mask = 0640
        directory mask = 0750
        max connections = 4
        delete veto files = Yes
        veto files = /*.scr/*.dll/desktop.ini/*porn*/*.exe/
        browseable = No
        csc policy = disable
        include = /etc/samba/printing/point-and-print.share.conf
        root preexec = /usr/local/fhs/bin/mk-admin-homedir "%S"
        delete readonly = Yes

[print$]
        comment = Printer Drivers
        path = /usr/local/samba/printer-drivers/
 


I realise this is related to issue 4271, however I've never noticed it causing any actual errors until today.  https://bugzilla.samba.org/show_bug.cgi?id=4271
Comment 1 Michael Adam 2009-05-04 08:03:03 UTC
Hi,

Of course a config as the one you listed, is problematic.

When you include a file in the middle of a share definition [homes]
and the include file starts a new section, then the parameters
following the include (root preexec) will not be assigned to the original share any more.

In order to evaluate if this is just an instance of bug #4271,
which I expect, can you please post your original smb.conf + the
include files?

Thanks - Michael

(In reply to comment #0)
> I have a fairly large config file, with separate include statements for most
> main sections, including shares. Sometimes, include statements appear in the
> middle of the previous section, resulting in certain options not working
> properly, for example root preexec in the [homes] share just doesn't run. 

> Once the include lines are removed from smb.conf, the root preexec works.
> 
> Here's a snippit on the testparm-generated smb.conf
> 
> [profiles]
>         path = /usr/local/fhs/profiles/
>         invalid users = sweepupd
>         read only = No
>         force create mode = 0600
>         force directory mode = 02700
>         profile acls = Yes
>         case sensitive = No
>         delete veto files = Yes
>         veto files = /thumbs\.db/desktop\.ini/aquota.*/
>         browseable = No
>         csc policy = disable
>         include = /etc/samba/shares/homes.share.conf
>         root preexec = /usr/local/fhs/bin/mk-profiledir %u %d %a %m %I
>         delete readonly = Yes
> 
> [homes]
>         comment = Your curric home drive (%U)
>         path = /usr/local/fhs/users/%U
>         valid users = %S
>         read only = No
>         create mask = 0640
>         directory mask = 0750
>         max connections = 4
>         delete veto files = Yes
>         veto files = /*.scr/*.dll/desktop.ini/*porn*/*.exe/
>         browseable = No
>         csc policy = disable
>         include = /etc/samba/printing/point-and-print.share.conf
>         root preexec = /usr/local/fhs/bin/mk-admin-homedir "%S"
>         delete readonly = Yes
> 
> [print$]
>         comment = Printer Drivers
>         path = /usr/local/samba/printer-drivers/
> 
> 
> 
> I realise this is related to issue 4271, however I've never noticed it causing
> any actual errors until today.  https://bugzilla.samba.org/show_bug.cgi?id=4271
> 

Comment 2 Ant Owen 2009-05-05 04:23:53 UTC
Created attachment 4115 [details]
samba config with include files
Comment 3 Ant Owen 2009-05-05 04:25:10 UTC
Hi Michael

Please find attached config files.

smb.conf is the filtered one that we have to use, i.e.
 testparm -s smb-master.conf | grep -v include > smb.conf

smb.conf-unfiltered is the raw one that was causing the problems.

Each include file relates to a separate section.  The reason I suspect this is a bug, is because testparm seems to be mixing them into the other sections.
 
Ant
Comment 4 Michael Adam 2009-11-20 18:52:50 UTC
Hi Ant,

sorry for coming back late to your issue.
This is the same as bug #4271, which is fixed in 3.4 and won't be fixed in 3.3 any more?
Can you upgrade to 3.4? or Live with your include filter until you can upgrade?

cheers - Michael

*** This bug has been marked as a duplicate of bug 4271 ***