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

Symlinks not handled properly #289

Open
sfayer opened this issue Jun 26, 2018 · 5 comments
Open

Symlinks not handled properly #289

sfayer opened this issue Jun 26, 2018 · 5 comments
Assignees

Comments

@sfayer
Copy link
Collaborator

sfayer commented Jun 26, 2018

I have a symlink to a dir, it appears as a dir in the listing and I can't delete it (because gridftp rmdir says it isn't a directory). Symlinks should appear as links, so I'm not quite sure if it's the listing process or gridftp that's returning the wrong information?

@alexanderrichards
Copy link
Collaborator

From the web app end I can make them appear as links. Can @martynia check what the gfal scripts report. I'm pretty sure that they just give the status code which I am interpreting using stat.isdir. in this case can easily also check for link. If @martynia provides the correct tool for unlinking then I can use it. Do you see the same problem for file symlinks?

@sfayer
Copy link
Collaborator Author

sfayer commented Jun 26, 2018

Symlinks to files display as if they are just a normal file (with all the properties of the target)... Deletion of these works correctly.
I can see from the log that the returned listing is wrong...

@alexanderrichards
Copy link
Collaborator

alexanderrichards commented Jun 26, 2018 via email

@sfayer
Copy link
Collaborator Author

sfayer commented Jun 27, 2018

Yes, but the listing returned from the gfal2_ls.py script is also wrong... It's doing the equivalent of stat rather than lstat, so symlinks are never visible. I'm starting to think it may be a bug in the gfal2 readdir implementation (or even gridftpd?), we'll have to do some specific tests to track it down...

@sfayer
Copy link
Collaborator Author

sfayer commented Jul 4, 2018

Well, it appears there is no workaround for this for now: Symlinks just have the type of the target in the listing. There is an extra parameter set in the listing (UNIX.slink), but I don't know if that's visible through gfal (I suspect not).

So, there are two tasks for Janusz:

  1. Check if there is any way to get the slink field in the listing.
  2. If not, modify the remove directory code to do an rm (unlink) before the rmdir (so symlinks are correctly deleted). If the rm succeeds, skip the rmdir, otherwise return the result from rmdir as the overall status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants