Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swapping files corrupts multi-owner permissions silently #37

Open
korydraughn opened this issue Sep 16, 2019 · 4 comments
Open

Swapping files corrupts multi-owner permissions silently #37

korydraughn opened this issue Sep 16, 2019 · 4 comments
Labels
bug Something isn't working
Milestone

Comments

@korydraughn
Copy link
Collaborator

Known applications that do this are:

  • Vim
  • Nano
@korydraughn korydraughn added the bug Something isn't working label Sep 16, 2019
@trel
Copy link
Member

trel commented Sep 18, 2019

Possible workaround could be to 'cache' permissions of 'similarly named files' for some amount of time, and detecting a set of known patterns of application behavior... restore the original permissions on the swapped tempfile-turned-realfile.

This is a problematic approach as it's specific to particular programs and their behavior...

Please share any other strategies for the NFSRODS server to 'know' a new file is a tempfile created for the purposes of replacing the realfile by an application on the other side of the mountpoint.

@michael-conway
Copy link
Member

Is the implementation calling 'rename' under the covers on the files? I can dig into the code, but I'm wondering how this swapping takes place in terms of visibility to the underlying iRODS code. I'm confused on this issue, so knowing the call chain that occurs would be the best first step!

@trel
Copy link
Member

trel commented Sep 18, 2019

Kory can be more specific... but as I understand it...

  • 1 - data.file exists in iRODS, and has multiple permissions set on it (alice/own, bobby/read, etc.)
  • 2 - alice opens data.file in vim
  • 3 - vim creates data.file.swp with only alice/own permission
  • 4 - vim, on save (or also at other times(?)), replaces data.file with data.file.swp
    • not sure if this is 'unlink data.file && rename data.file.swp -> data.file' OR
    • just 'rename data.file.swp -> data.file' directly
  • 5 - data.file now only has alice/own permissions, bobby can no longer read the file

@michael-conway
Copy link
Member

michael-conway commented Sep 18, 2019

That's what I'm after, whether there is a definite API 'signal' here. Maybe if we are picking a hackfest day at RENCI we could sit and instrument this before cutting a solution? It's been a while since I dug into that code...

@korydraughn korydraughn added this to the 2.3.0 milestone Feb 1, 2024
@korydraughn korydraughn modified the milestones: 2.3.0, 2.4.0 May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

3 participants