Skip to content

Conversation

steverweber
Copy link

skip broken symlinks

#3151

skip broken symlinks

jupyter#3151
@takluyver
Copy link
Member

Using git blame, it appears this was changed the other way in #2574.

Pinging @minrk - you OKed the behaviour change in that PR.

@minrk
Copy link
Member

minrk commented Dec 20, 2017

Following #2574, I think hiding broken symlinks was always the wrong thing to do. Those files do exist in the directories being listed and clicking on them 404s, as it should. Coloring them red would be nice, but I'm not sure if there's a place for that info in the API.

At the very least, the comment should be updated to reflect the fact that we are preserving rather than ignoring broken symlinks.

@steverweber where are you running into symlinks that are broken and should be hidden rather than fixed or removed from the filesystem?

@steverweber
Copy link
Author

our university has multiple facilities and each one has storage for the users.
we are deploying jupyterhub as a somewhat campus wide solution and want to allow users access to all their home dirs... symlinks in home dirs point to automounts of cifs mounts that require kerberos tickets.

its working well.

it might be possible for us to remove the symlinks when we first create them... but not an idea solution because generation/regeneration of the links would need to be done everytime the pam session or auth stack is hit for the user... besides its nicer for the user if at runtime their extra home dir would become active without requiring a logout and login.

anyways i can workaround it... just my solutions are not going to be as simple as removing one byte in a python file.

if bad symlinks being visible is intended, that's fine.. I'll just hack it in for our jupyter deployment.

sed -i 's|st = os.lstat(os_path)|st = os.stat(os_path)|' /usr/local/lib/python3.5/dist-packages/notebook/services/contents/filemanager.py

perhaps can set an icon as a red 'X' for the file icon. I'll do some more investigation.

@steverweber
Copy link
Author

well i tried... dont think i'll get the icon idea done in 30min so i give up :)

feel free to close

@scanon
Copy link
Contributor

scanon commented Aug 24, 2018

I added a comment to #3151. You can easily see the issue. Just create a link in a directory to a directory you don't have permissions to and you will see the problem.

On my mac I can do...

ln -s /etc/cups/certs .
jupyter notebook

We have users hitting this issue and it is causing some usability issues. Steve's patch seems to fix it but let me see if I can come up with another PR that addresses your concern.

@coolingozone
Copy link

This issue had been open and not updated for quite some time. Do we want to close it?

@Zsailer
Copy link
Member

Zsailer commented May 15, 2020

Closing, since this has been inactive for awhile. Happy to review a new PR if someone has time to devote to this.

@Zsailer Zsailer closed this May 15, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants