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

SDKMAN environment variables don't change when su-ing to another user #25

Open
reitzig opened this issue Jan 6, 2019 · 3 comments
Open
Labels
blocked bug Something isn't working

Comments

@reitzig
Copy link
Owner

reitzig commented Jan 6, 2019

Run the following commands:

$ whoami
raphael
$ echo $SDKMAN_CANDIDATES_DIR
/home/raphael/.sdkman/candidates
$ su dhtp
Password: 
$ whoami 
dhtp
$ echo $SDKMAN_CANDIDATES_DIR

Expected: /home/dhtp/.sdkman/candidates

Actual: /home/raphael/.sdkman/candidates

@reitzig reitzig added the bug Something isn't working label Jan 6, 2019
@reitzig
Copy link
Owner Author

reitzig commented Jan 6, 2019

In conf.d/sdk.fish, we re-initialize SDKMAN if not set -q SDKMAN_DIR. This is not enough here: the variable is set (inherited from the shell where su was called), provided the user making that call has SDKMAN installed. If there is sufficient access, sdk will even work.

reitzig added a commit that referenced this issue Jan 6, 2019
Fixes issue #25; assumes that every user has their own SDKMAN installation.
@reitzig
Copy link
Owner Author

reitzig commented Jan 6, 2019

Since an automated test seems to be more involved to set up, efficacy of the fix was confirmed by manual testing.

Only: turns out that sdkman-init.sh has the same issue, it won't overwrite existing but wrong values of the environment variables.

@reitzig reitzig added the blocked label Nov 6, 2019
@reitzig
Copy link
Owner Author

reitzig commented Nov 6, 2019

I created a PR upstream: sdkman/sdkman-cli/pull/718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant