Skip to content

Draft: s3: return raw dos attr to system.dos_attr.mode

When query system.dos_attr.mode, I should return the dos permissions mask.
But at 0fe9dc52, it change from dos permissions mask to unix permission mask. And drop hidden/archive/system props on directory. (but didn't drop hidden/archive/system props on file, see remark1)

So I add one param on func SMBC_getatr to obtain dos permissions mask an return it to the query system.dos_attr.mode

remark1

Why the transfer [dos permissions mask -> unix permission mask] is ok for file but not ok for directory? When dos permissions mask -> unix permission mask, it do the transfer: placed the hidden/archive/system attribute in the execution flag.

hidden - > o + x, (other has exec permission)
archive - > u + x, (owner has exec permission)
system - > g + x, (group has exec permission)

File has default 644 permission mask but directory has default 755 permission mask. So directory drop the hidden/archive/system props

see the code: https://gitlab.com/samba-team/samba/-/blob/84b5440eb4f3c10e2729e916d097f5af07150dcd/source3/libsmb/libsmb_stat.c#L67

refer

Dos permissions mask: https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb/65e0c225-5925-44b0-8104-6b91339c709f

Checklist

  • Commits have Signed-off-by: with name/author being identical to the commit author
  • (optional) This MR is just one part towards a larger feature.
  • (optional, if backport required) Bugzilla bug filed and BUG: tag added
  • Test suite updated with functionality tests
  • Test suite updated with negative tests
  • Documentation updated
  • CI timeout is 3h or higher (see Settings/CICD/General pipelines/ Timeout)

Reviewer's checklist:

  • There is a test suite reasonably covering new functionality or modifications
  • Function naming, parameters, return values, types, etc., are consistent and according to README.Coding.md
  • This feature/change has adequate documentation added
  • No obvious mistakes in the code
Edited by j3l11234

Merge request reports

Loading