Skip to content

python/samba/netcmd: domain_backup_restore to adjust perms on msg.[sl]ock dirs

Post 8c90c66a running CI with a modern python version (e.g. even Python 3.6.15 on leap15.5) which has 'extraction_filter' backported results in multiple CI failures. In particular the testenvs restoredc, renamedc and labdc fail to start, due to permission errors on msg.[ls]ock directories The root cause is the 'data' filter which doesn't apply mode permissions to dir elements when extracting from the archive, this results in just the default dir perms for the user resulting from directory creation which makes the samba server unhappy. There are 2 patches here

  • PATCH1 attempts to make domain_backup_restore functional for all by hardcoding special treatment for the affected directories, the alternative is to just assume the user will 'fix' things up after a backup (which would seem a little surprising I think for the user/admin). It would be nicer to somehow get a custom filter to do this but it seems to me there is a chicken/egg situation here in that you need to extract first to get the smb.conf in order to correctly work out the affected directories. Of course there is always a possibility the directories determined from the config have been overridden somehow (on server startup, as is the case with selftest) but really this can't be catered for beyond the little hark for the know scenario of selftest
  • PATCH2 just takes the "assume the user will deal with things post extraction" and just fixes things for selftest

I've marked this merge request as DRAFT as I really don't know what the correct solution is, patch1, patch2 or some other approach

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 Noel Power

Merge request reports