SMB homes share path override broken in FreeNAS-11.3-U2.1

hamstercnw

Cadet
Joined
May 7, 2020
Messages
5
Our system:
Issue on upgraded version:
FreeNAS-11.3-U2.1 on a Dell R320 Intel(R) Xeon(R) CPU E5620 @ 2.40GHz 36GB Ram
No issue on previous version:
FreeNAS-11.2-U8 on a Dell T310 Intel(R) Xeon(R) CPU X3430 @ 2.40GHz 16 GB Ram


Issue:
We use a configuration where home directories are located in a folder named samba inside users directory. This is done by overriding the "path = " share configuration with the following line in "Auxiliary parameters" :
path = /mnt/Store00/users/%u/samba/

%u differ from %U as %u provide the userid from FreeBSD environment and %U provide a rewrite of the email address as name_domainname.tld.
name_domainname.tld derives from the email field in the user information and @ is changed to _.

This configuration is not reflected when configuration is written to /usr/local/etc/smb4.conf.

Workaraound:
As a workaround, I had to create a symbolic link in the users folder named name_domainname.tld to username/samba for each user.

Code:
cd /mnt/Store00/users/
sn -s username/samba name_domainname.tld


Is this a known issue or a bug?


Kindly, Thord
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
Code:
commit 054dadb35a2de436e9611a12e16bab62fdb50718 (origin/NAS-105578, NAS-105578)
Author: Andrew Walker <awalker@ixsystems.com>
Date:   Mon Apr 6 03:06:50 2020 -0700

    Allow auxiliary parameters to override SMB share path

diff --git a/src/middlewared/middlewared/etc_files/local/smb4_share.conf b/src/middlewared/middlewared/etc_files/local/smb4_share.conf
index 5369da825f..469f9c3722 100644
--- a/src/middlewared/middlewared/etc_files/local/smb4_share.conf
+++ b/src/middlewared/middlewared/etc_files/local/smb4_share.conf
@@ -197,7 +197,7 @@
                         make_homedir(base_homedir)
                 elif is_home_share:
                     pc[share["name"]].update({"path": f'{share["path"]}/%U'})
-                else:
+                elif not pc[share["name"]].get("path"):
                     pc[share["name"]].update({"path": share["path"]})
 
             return pc
 

anodos

Sambassador
iXsystems
Joined
Mar 6, 2014
Messages
9,553
You can clone your boot environment, modify /usr/local/lib/python3.7/site-packages/middlewared/etc_files/local/smb4_share.conf with the above change, run the command "service middlewared restart", and run command "midclt call etc.generate smb_share"
 
Top