@@ -8,7 +8,6 @@ FileRecoveryService = require './file-recovery-service'
8
8
ipcHelpers = require ' ../ipc-helpers'
9
9
{BrowserWindow , Menu , app , dialog , ipcMain , shell , screen } = require ' electron'
10
10
{CompositeDisposable , Disposable } = require ' event-kit'
11
- crypto = require ' crypto'
12
11
fs = require ' fs-plus'
13
12
path = require ' path'
14
13
os = require ' os'
@@ -34,16 +33,11 @@ class AtomApplication
34
33
# Public: The entry point into the Atom application.
35
34
@ open: (options ) ->
36
35
unless options .socketPath ?
37
- username = if process .platform is ' win32' then process .env .USERNAME else process .env .USER
38
- # Lowercasing the ATOM_HOME to make sure that we don't get multiple sockets
39
- # on case-insensitive filesystems due to arbitrary case differences in paths.
40
- atomHomeUnique = path .resolve (process .env .ATOM_HOME ).toLowerCase ()
41
- hash = crypto .createHash (' sha1' ).update (username).update (' |' ).update (atomHomeUnique)
42
- atomInstanceDigest = hash .digest (' hex' ).substring (0 , 32 )
43
36
if process .platform is ' win32'
44
- options .socketPath = " \\\\ .\\ pipe\\ atom-#{ options .version } -#{ process .arch } -#{ atomInstanceDigest} -sock"
37
+ userNameSafe = new Buffer (process .env .USERNAME ).toString (' base64' )
38
+ options .socketPath = " \\\\ .\\ pipe\\ atom-#{ options .version } -#{ userNameSafe} -#{ process .arch } -sock"
45
39
else
46
- options .socketPath = path .join (os .tmpdir (), " atom-#{ options .version } -#{ process .arch } - #{ atomInstanceDigest } .sock" )
40
+ options .socketPath = path .join (os .tmpdir (), " atom-#{ options .version } -#{ process .env . USER } .sock" )
47
41
48
42
# FIXME: Sometimes when socketPath doesn't exist, net.connect would strangely
49
43
# take a few seconds to trigger 'error' event, it could be a bug of node
0 commit comments