Issues getting home shares working with LDAP in 11.3

FFF

Dabbler
Joined
Mar 10, 2017
Messages
28
Hi all,
In the past (11.1), I had tricks to get things setup and working the way I needed. In 11.3, I've been having various issues and after lots of tweaks I've now landed on an odd issue I can't get past. The goal is to have AFP sharing individual user home directories and allowing them to be time machine targets. In 11.1, this required me defining something in SMB sharing (but ironically not enabling the service) and things have been working that way for a number of years. One thing that never made sense to me (but I left it alone because it worked) was the home directory FreeNAS reported for LDAP-based users differently than what is explicitly in LDAP.

FreeNAS 11.1 would show this for a user:
Code:
username:*:uid:gid:User Realname:/path/defined/in/smb/sharing/LDAPHOSTNAME-BEFORE-FIRST-DOT/username:/shell


FreeNAS 11.3 instead shows this:
Code:
username:*:uid:gid:User Realname:/path/defined/in/ldap/username:


The differences being the path to the user's home directory is now identical to what's in LDAP and the shell field is missing. Personally, I prefer the former (who wants to type cd /mnt/Mirror01/TimeMachine01/home/LDAPHOSTNAME/username instead of just /home/username ?) and care less about the latter since none of these users get shell access anyway (but it does appear 'su - username' from a root shell does give them a shell which seems wrong). However, I couldn't get it to work because now the basedir regexp doesn't match in 11.3:
Code:
Feb 21 15:34:45.715251 afpd[62947] {netatalk_conf.c:1187} (error:Default): readvolfile: user home "/home/username" doesn't match basedir regex "/mnt/Mirror01/TimeMachine01/home"


In trying to make things work, I removed /home which exists on the FreeNAS ROOT and symlinked it to the proper parent path /mnt/Mirror01/TimeMachine/home. This got me past the above error and let me login and things look OK ... until I try to use the share. Copying a file onto the share works, huzzah! Unfortunately, creating a directory on the same share results in
Code:
An unexpected error occurred (error code -50).
in macOS despite it actually creating the directory - only I'm unable to access it. Apparently the directory permissions are being set to 000, despite /etc/local/afp.conf showing they should be 755 in the home share:

Code:
[Homes]
        basedir regex = /mnt/Mirror01/TimeMachine01/home
        home name = home
        time machine = yes
        cnid dev = no
        file perm = 744
        directory perm = 755
        umask = 022
        veto files = .windows/.mac/


Since I was able to 'su - username' despite the lack of a valid shell in the user record, I was able to confirm the same behavior occurs on the command line using mkdir:

Code:
FreeNAS-TM01% umask
0022
FreeNAS-TM01% mkdir test
FreeNAS-TM01% ls -dl test
d---------+ 2 username  wheel  2 Feb 21 16:17 test


So this is where I'm stuck now. Can someone advise why the directory perm directive does not appear to be honored and causes this issue?
 
Top