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

Use homefolder for org open under linux to prevent issues with sandboxing through snap #992

Closed
wants to merge 1 commit into from

Conversation

fmannreply
Copy link

@fmannreply fmannreply commented Mar 21, 2024

What does this PR do?

Currently sf org open creates a file under /tmp (base on TMPDIR/TMP environment vars). The /tmp folder is not visible to snaps due to sandboxing. Snaps are the recommended distribution for Firefox under Ubuntu.

Instead of creating a file under tmp this creates the file under the homefolder in a subdirectory called temp. /home/.tmp also does not work, as snaps can not see hidden folders. The temp files could also be created under /home directly, as they are deleted either way.

What issues does this PR fix or reference?

forcedotcom/cli#2769

Copy link

Thanks for the contribution! Before we can merge this, we need @fmannreply to sign the Salesforce Inc. Contributor License Agreement.

@iowillhoit
Copy link
Contributor

Hey @fmannreply, I don't think we would want to make this change for all Linux machines.

You should be able to set your temp directory for this command. Try running TMPDIR="$HOME/temp" sf org open [your-flags]

@fmannreply
Copy link
Author

Hi @iowillhoit , yep your mentioned workaround works. Adding the environment var under bashrc should also provide a permanent fix for me.

However, this behavior effects all linux users using snap, which is the default distribution on Ubuntu. I also checked on a new release (23.10) and there the tmp folder also defaults to /tmp.

I can still understand if you don't want to make the changes for all Linux machines.

@iowillhoit
Copy link
Contributor

Hey @fmannreply thanks for the reply, I am glad that workaround worked for you.

I spoke with the team and we are not going to make this change for Linux. The main reason for this decision is that this particular piece of functionality is temporary, and will be removed in the future as we collaborate with another team at Salesforce. Setting TMPDIR is what we will suggest as a workaround until it is removed.

Thank you so much for being willing to open a Pull Request. We really do appreciate it!

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

Successfully merging this pull request may close these issues.

2 participants