Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Make temporary build filename user specific to prevent conflict on systems with shared temp folders #1835

Merged
merged 3 commits into from
Aug 13, 2018

Conversation

rikkuness
Copy link
Contributor

As per #1829

src/goBuild.ts Outdated
@@ -56,7 +56,7 @@ export function goBuild(fileUri: vscode.Uri, goConfig: vscode.WorkspaceConfigura
}

const buildEnv = Object.assign({}, getToolsEnvVars());
const tmpPath = path.normalize(path.join(os.tmpdir(), 'go-code-check'));
const tmpPath = path.normalize(path.join(os.tmpdir(), 'go-code-check.' + os.userInfo().username));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we hash that name? There are cases where when trying to investigate an issue I request users to paste a screenshot of the output channel. User name is clearly PII 100% of the time and I want to stay clear of it.

Also, if we hash lets hash it once and re-use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really even need be a username, the filename could be anything providing it didn't cause a collision with another user.

I guess a hash based off username would be okay though, saves randomizing the filename and filling up /tmp.

I'll take another look at it 👍

@msftclas
Copy link

msftclas commented Aug 9, 2018

CLA assistant check
All CLA requirements met.

@rikkuness rikkuness changed the title Add current user username to tmp file to prevent conflict on multi user systems Make temporary build filename user specific to prevent conflict on systems with shared temp folders Aug 9, 2018
@ramya-rao-a ramya-rao-a merged commit 1513adf into microsoft:master Aug 13, 2018
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants