Skip to content

Commit

Permalink
fix: migration with no shares (#78)
Browse files Browse the repository at this point in the history
If there are no shares, the setfacl command fails for a bad argument
(empty string). This commit ensures that setfacl always run with the
required argument corresponding to the share path.

Refs NethServer/dev#7295
  • Loading branch information
DavidePrincipi authored Feb 28, 2025
1 parent 34894b2 commit 4916fd2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions samba-dc/usr/local/sbin/rsyncd-import-shares
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,7 @@ echo "Now reading shares metadata from stdin..."
while IFS=$'\t' read -r sharename description; do
net conf addshare "${sharename}" "${SAMBA_SHARES_DIR:?}/${sharename}" writeable=y guest_ok=n "${description}"
net conf setparm "${sharename}" 'acl_xattr:ignore system acls' no
# Grant ACL read privileges to domain controllers:
setfacl -m group:"domain controllers":rx "${SAMBA_SHARES_DIR}/${sharename}" || :
echo "Enabled share ${sharename}"
done

# Grant ACL read privileges to domain controllers:
shopt -s nullglob
printf '%s\0' "${SAMBA_SHARES_DIR}"/* | xargs -0 -r -- setfacl -m group:"domain controllers":rx

0 comments on commit 4916fd2

Please sign in to comment.