[pbs-devel] [PATCH proxmox-backup] chunk_store: fix problem with permission checking

Wolfgang Bumiller w.bumiller at proxmox.com
Wed Nov 13 15:42:47 CET 2024


On Wed, Nov 13, 2024 at 03:20:54PM GMT, Gabriel Goller wrote:
> On 13.11.2024 13:40, Hannes Laimer wrote:
> > Permissions are stored in the lower 9 bits (rwxrwxrwx),
> > so we have to mask `st_mode` with 0o777.
> > The datastore root dir is created with 755, the `.chunks` dir and its
> > contents with 750 and the `.lock` file with 644, this changes the
> > expected permissions accordingly.
> 
> Oops, this is my bad, I missed this.
> 
> Matching the whole st_mode exactly would be nice, but not so practical
> as we would need to be generic over file/dir and symbolic link.
> 
> Also CC'ing @Wolfgang as he persuaded me to match exactly in the first
> place :)

Ah yes, would have had to include the mode bits...

But it seems the actual permissions were wrong as well?

(Not sure if I mentioned this, but I'm not convinced we should *fail* on
unexpected permissions, I mean, we're already changing the values in the
check now 🤷)

> Consider:
> 
> Fixes: 6e101ff75777 ("fix #5439: allow to reuse existing datastore")
> Reviewed-By: Gabriel Goller <g.goller at proxmox.com>




More information about the pbs-devel mailing list