noobaa-core icon indicating copy to clipboard operation
noobaa-core copied to clipboard

NSFS | NC | Update check access implementation to support flags

Open romayalon opened this issue 1 year ago • 2 comments

Environment info

  • NooBaa Version: Master
  • Platform: NC

Actual behavior

The Health script and manage_nsfs account add/update requires us to check if an account has rw access to its new_buckets_path. Currently, we do that by is_dir_rw_accessible() function that stat() the folder and checks its permissions. This access check won't cover supplemental groups and ACLs.

  1. Currently we only checkAccess for read permissions, we want to allow checking permissions for write as well. There are a few options for that -
  2. access() - checking access of the real uid/gid and not the effective uid/gid (so we need to replace the real uid/gid pair as well)
  3. faccessat()/faccessat2() - which are not available on all file systems.
  4. Open a file under the directory using O_CREATE, unlink the file, and close it so the file won't get written to the disk.

Expected behavior

  1. Check access is being checked by the file system and not on our side.

Steps to reproduce

  1. manage_nsfs account add/update
  2. health script full run

More information - Screenshots / Logs / Other output

romayalon avatar Feb 05 '24 16:02 romayalon

This issue had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.

github-actions[bot] avatar May 06 '24 11:05 github-actions[bot]

This issue is stale and had no activity for too long - it will now be closed.

github-actions[bot] avatar Jun 06 '24 11:06 github-actions[bot]