[Linux-cifsd-devel] [PATCH] cifsd: make xattr format of ksmbd compatible with samba's one

Stefan Metzmacher metze at samba.org
Fri Feb 12 13:53:33 UTC 2021


Hi Namjae,

I played with this today and found a few things.

>>> Samba team request that ksmbd should make xattr format of ksmbd
>>> compatible
>>> with samba's one. When user replace samba with ksmbd or replace ksmbd
>>> with samba, The written attribute and ACLs of xattr in file should be
>>> used
>>> on both server. This patch work the following ones.
>>>  1. make xattr prefix compaible.
>>>     - rename creation.time and file.attribute to DOSATTRIB.

I just noticed that you use xattr_DosInfo3 instead of xattr_DosInfo4,
Samba uses xattr_DosInfo4, starting from samba-4.11.0, so all supported
Samba releases write xattr_DosInfo4. All versions from 3.5-4.10 wrote
xattr_DosInfo3. Versions before 3.5 only stored the hex-string.

So it would be good to read hex-string-only, xattr_DosInfo3 and xattr_DosInfo4 and write
xattr_DosInfo4.

>>>     - rename stream. to DosStream.

I noticed that "vfs objects = acl_xattr" is allowed,

"vfs objects = streams_xattr acl_xattr" is not handled at all,
even acl_xattr isn't detected in that case.

>>>     - rename sd. to NTACL.

There seems to be a problem, when a new file inherits acls from the parent
directory. There I see a strange owner sid:

                        owner_sid                : *
                            owner_sid                : S-21-2276714256
and

WARNING! 20 unread bytes
[0000] 00 00 00 00 00 00 00 00   00 00 00 00 00 00 00 00   ........ ........
[0010] 00 00 00 00

I used this command to analyze this:

getfattr -n security.NTACL WHATSNEW.txt | grep security.NTACL| sed -e 's!security.NTACL=0s!!' | ndrdump --base64-input xattr xattr_NTACL struct 2>&1 |less

metze

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20210212/8fa09c04/signature.sig>


More information about the samba-technical mailing list