• [6.8.1] smb-extra.conf loaded before smb-shares.conf


    Xaero
    • Closed

    Description

    This is an issue I had crop up when attempting to override default unraid settings or add additional settings to unraid shares. Basically the samba configuration file is loaded top to bottom in order, and includes are handled inline following the same logic. This allows tiered configuration files to override one another for different settings and creates a robust settings architecture. 

    I want to override settings for several user shares to restrict wireguard clients to specific shares via IP, and to eventually create per-user storage volumes for quota based individual usage. Seems easy enough - add a new entry like so:

    
    [ShareName]
    Key = Value
    
    


    in the smb-extra configuration section in the settings menu!

    The problem is that these settings are loaded before the unraid shares are defined, which means my new entry is defining the share:
    /etc/samba/smb.conf:

    
            # hook for user-defined samba config
            include = /boot/config/smb-extra.conf
    
            # auto-configured shares
            include = /etc/samba/smb-shares.conf
    
    


     This is a problem because this new share has no path, so samba marks it unavailable and doesn't list it anymore:

     

    
    testparm
    
    WARNING: No path in service Backups - making it unavailable!
    
    NOTE: Service Backups is flagged unavailable.
    
    

     


    Simply reversing the order that these two conf files are included resolves this and allows settings to be overridden or added at will.

     

     

    Steps to Reproduce:

    1. Add an entry matching the name of any existing Unraid auto-configured share to smb-extra.conf
    2. Restart the SMB service or stop/start the array

     

     




    User Feedback

    Recommended Comments

    I would like to request this feature to be able to override Unraids default smb.conf

     

    There has been many a time when being able to edit and manual specify your own SMB config is more beneficial.

     

    To implement, this, we would need to create another samba config file. Have smb.conf include that config file move Unriads default settings to the new config file.

     

    Then add a Web GUi option under samba to disable unraid default smb config with Warrnigns.

     

    And to use smb-extra to write [global] and other custom smb config. in the web gui to specify the manually samba config.

     

    A disable option could send/echo a sed and mark or remove a # to include the Unraid smb config could be an option in the web gui for users to continue using unraids default. While giving advance samba config users more granular controller over the smb.conf

     

     

    ?How to make that happen?

    Edited by bmartino1
    Link to comment


    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Restore formatting

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Status Definitions

     

    Open = Under consideration.

     

    Solved = The issue has been resolved.

     

    Solved version = The issue has been resolved in the indicated release version.

     

    Closed = Feedback or opinion better posted on our forum for discussion. Also for reports we cannot reproduce or need more information. In this case just add a comment and we will review it again.

     

    Retest = Please retest in latest release.


    Priority Definitions

     

    Minor = Something not working correctly.

     

    Urgent = Server crash, data loss, or other showstopper.

     

    Annoyance = Doesn't affect functionality but should be fixed.

     

    Other = Announcement or other non-issue.