Skip to content

Commit 5ac43ef

Browse files
committed
mgr/smb: Add acl_xattr configuration to share definition
Samba allows to store full Windows(NT) ACLs and bypass any lossy mapping attempts to and from POSIX ACLs. Therefore we stack an additional module in front of ceph to store NTACLs in a special extended attribute. Due to certain limitations within containers the default xattr from security namespace can't be used. Instead we configure a similar xattr from more flexible 'user' namespace with the help of an option to the module. ref: https://www.samba.org/samba/docs/current/man-html/vfs_acl_xattr.8.html Signed-off-by: Anoop C S <[email protected]>
1 parent 2f02bce commit 5ac43ef

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

qa/suites/orch/cephadm/smb/tasks/deploy_smb_basic.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,9 @@ tasks:
4343
globals = ["default", "domain"]
4444
instance_name = "SAMBA"
4545
[shares.share1.options]
46-
"vfs objects" = "ceph"
46+
"vfs objects" = "acl_xattr ceph"
4747
path = "/"
48+
"acl_xattr:security_acl_name" = "user.NTACL"
4849
"ceph:config_file" = "/etc/ceph/ceph.conf"
4950
"ceph:user_id" = "smbdata"
5051
"kernel share modes" = "no"

qa/suites/orch/cephadm/smb/tasks/deploy_smb_domain.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,9 @@ tasks:
4242
globals = ["default", "domain"]
4343
instance_name = "SAMBA"
4444
[shares.share1.options]
45-
"vfs objects" = "ceph"
45+
"vfs objects" = "acl_xattr ceph"
4646
path = "/"
47+
"acl_xattr:security_acl_name" = "user.NTACL"
4748
"ceph:config_file" = "/etc/ceph/ceph.conf"
4849
"ceph:user_id" = "smbdata"
4950
"kernel share modes" = "no"

src/pybind/mgr/smb/handler.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,8 @@ def _generate_share(
977977
# smb.conf options
978978
'options': {
979979
'path': path,
980-
"vfs objects": "ceph",
980+
"vfs objects": "acl_xattr ceph",
981+
'acl_xattr:security_acl_name': 'user.NTACL',
981982
'ceph:config_file': '/etc/ceph/ceph.conf',
982983
'ceph:filesystem': share.cephfs.volume,
983984
'ceph:user_id': cephx_entity,

src/pybind/mgr/smb/tests/test_smb.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,8 @@ def test_share_dump_config(tmodule):
421421
'browseable': 'Yes',
422422
'kernel share modes': 'no',
423423
'x:ceph:id': 'foo.s1',
424-
'vfs objects': 'ceph',
424+
'vfs objects': 'acl_xattr ceph',
425+
'acl_xattr:security_acl_name': 'user.NTACL',
425426
'ceph:config_file': '/etc/ceph/ceph.conf',
426427
'ceph:filesystem': 'cephfs',
427428
'ceph:user_id': 'smb.fs.cluster.foo',
@@ -434,7 +435,8 @@ def test_share_dump_config(tmodule):
434435
'browseable': 'Yes',
435436
'kernel share modes': 'no',
436437
'x:ceph:id': 'foo.stwo',
437-
'vfs objects': 'ceph',
438+
'vfs objects': 'acl_xattr ceph',
439+
'acl_xattr:security_acl_name': 'user.NTACL',
438440
'ceph:config_file': '/etc/ceph/ceph.conf',
439441
'ceph:filesystem': 'cephfs',
440442
'ceph:user_id': 'smb.fs.cluster.foo',

0 commit comments

Comments
 (0)