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

User installs should be able to overwrite tool symlinks created by root installs #338

Closed
Chumper opened this issue Mar 16, 2022 · 8 comments · Fixed by #341
Closed

User installs should be able to overwrite tool symlinks created by root installs #338

Chumper opened this issue Mar 16, 2022 · 8 comments · Fixed by #341
Assignees
Labels
priority-2-important User-visible bugs or very important features status:in-progress Someone is working on implementation type:bug Bug fix of existing functionality

Comments

@Chumper
Copy link
Collaborator

Chumper commented Mar 16, 2022

When a root installs a tools the symlink in /usr/local/bin will have the mode 755 set.
This prevents user installs to overwrite symlinks when a user installs a tool.

We should change this to be 775 on created symlinks,

@viceice viceice added type:bug Bug fix of existing functionality priority-2-important User-visible bugs or very important features status:ready Ready to start implementation labels Mar 16, 2022
@Chumper Chumper added status:in-progress Someone is working on implementation and removed status:ready Ready to start implementation labels Mar 16, 2022
@Chumper
Copy link
Collaborator Author

Chumper commented Mar 16, 2022

The problem is not the symlink, but rather the shell wrapper.
The symlinks permission does not really matter:

Symlinks are always world readable/writeable.

from https://askubuntu.com/questions/1145107/mysql-server-config-file-permissions-on-ubuntu-18-04/1145114#1145114

The shell wrapper on the other hand is basically just a shell script and needs proper permissions.
For the case with python this needs a fix in the python tool, for all other tools in the utils/linking.sh.

@viceice
Copy link
Member

viceice commented Mar 17, 2022

Ok, so it seems we should always use shell wrapper scripts to not need change the target files.

@Chumper
Copy link
Collaborator Author

Chumper commented Mar 17, 2022

So no symlinks then?
We will always create a small shell script that simply calls the correct binary in the correct path?
We can do that.
In that case we would utilize shell_wrapper and export_tool_env more.

@viceice viceice reopened this Mar 17, 2022
@viceice
Copy link
Member

viceice commented Mar 17, 2022

what about writing the shell wrapper as root only on prepare stage, and write the tool version to call to /opt/..., so the wrapper simply reads version and calls real binary. 🤔

That way we won't need to make /usr/local/bin writable to users, as we don't need to overwrite the wrapper.

@rarkins WDYT? This would be again a major change and propably would allow us to solve #101

@Chumper
Copy link
Collaborator Author

Chumper commented Mar 17, 2022

So you would write all shell wrappers during the prepare phase?
Or how does it work when we have a tool that is installed during runtime?

The prepare phase for me is that a tool that is installed as root can prepare runtime installation of this tools as well if possible which does not need root rights.
So it is called for each tool initially on each root install for that tool and possibly there is no prepare phase if the tool is never installed as root.

Is the prepare phase for you something that will be called during creation of the docker image for all tools instead?

@viceice
Copy link
Member

viceice commented Mar 17, 2022

Yes, it's called on image build time for each tool seperate or all. So for language images we only like to prepare those, but on full image we like to prepare all.

something like this?

> prepare-tool all
> prepare-tool node
> prepare-tool node,python

@viceice
Copy link
Member

viceice commented Mar 17, 2022

@Chumper Let's fix the issue with small shell wrapper scripts now, so user can overwrite them. And in a later PR we can refactor handling for #101

@viceice
Copy link
Member

viceice commented Mar 25, 2022

As long as /usr/local/bin is writable by user we can already overwrite the links, so it works as expected.

@viceice viceice closed this as completed Mar 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority-2-important User-visible bugs or very important features status:in-progress Someone is working on implementation type:bug Bug fix of existing functionality
Projects
None yet
2 participants