TrueNAS, git, and SMB/CIFS permissions on push

GHJebus

Cadet
Joined
Mar 26, 2024
Messages
2
I'm having some weird git errors when attempting to transition my git backing store from an old QNap to TrueNAS. Initially everything seems ok, I am able to mount the share on the git server, clients can use their keys to pull/clone the repos, however as soon as a client attempts to push I get odd permission errors.

Code:
remote: warning: unable to unlink '/mnt/git/wut.git/./objects/tmp_objdir-incoming-ChXbSc/e9/tmp_obj_yrNxRC': Permission denied       
remote: error: unable to write file /mnt/git/wut.git/./objects/tmp_objdir-incoming-ChXbSc/e9/b2dea8342d0b97661ef533c2c65b6bb072718d: Permission denied        


These are the players:
- TrueNAS Core 13.0-U6.1 hosting an SMB share
- QNap NAS hosting an SMB share
- Git server on a debian bookworm VM
- Linux git client attempting to push after cloning using an ssh authorized_key

This is the setup:
1) Debian git server mounts the SMB shares from both Qnap and TrueNAS (ideally would like to transition away from Qnap)
fstab looks like this:
Code:
//<TRUENASHOST>/git    /mnt/git    cifs     username=user,pass=pass,uid=1001,gid=1001    0    0
//<QNAPHOST>/git    /srv/oldgit    cifs     username=user,pass=pass,uid=1001,gid=1001    0    0

where uid/git of 1001 is the git user on the Debian VM, and the user and pass fields are the respective user and password fields for the SMB shares on the separate hosts

2) Both the /mnt/git and /srv/oldgit appear to have the correct permissions/flags for their directories:

truenas_git_redacted.png

OldGit_redacted.png


3) The user 'git' (uid 1001, gid 1001) is able to add, modify, and delete files and folders in both locations without issue.

4) These are the permissions for the SMB Share (the redacted user here matches the user in the fstab in part 1 above):
SMB_Permissions_redacted.png


5) If the git client attempts to push a change to a repo hosted on the debian VM in the /srv/oldgit directory backed by the Qnap NAS, everything works as expected and the push succeeds.

6) When the git client attempts to push a change to a repo hosted on the debian VM in the /mnt/git directory backed by the TrueNAS share, I get those strange permission errors from above:
Code:
remote: warning: unable to unlink '/mnt/git/wut.git/./objects/tmp_objdir-incoming-ChXbSc/e9/tmp_obj_yrNxRC': Permission denied       
remote: error: unable to write file /mnt/git/wut.git/./objects/tmp_objdir-incoming-ChXbSc/e9/b2dea8342d0b97661ef533c2c65b6bb072718d: Permission denied       


All signs point to a permission issue on the TrueNAS setup I haven't been able to identify. Any ideas on what's wrong with my setup?

Thanks!
 

GHJebus

Cadet
Joined
Mar 26, 2024
Messages
2
Welp, I figured it out. That sound you all heard was a massive facepalm.

Instead of using the permissions editor, if I use the ACL manager, set it to 'Restricted', and grant the owner 'basic' 'Full Control' git push from the linux client works.

So instead of permissions above, set access via the ACL this-wise:
ACLEdit_redacted.png


Now my lack of understanding is preserved for 'eternity'. May this help any other poor unfortunate soul who runs into the same issue.
 
Top