mirror of
				https://github.com/node-red/node-red.git
				synced 2025-03-01 10:36:34 +00:00 
			
		
		
		
	Ensure sshkey file path is properly escaped on Windows
This commit is contained in:
		| @@ -187,16 +187,18 @@ function getPrivateKeyPath(username, name) { | ||||
|     var privateKeyFilePath = fspath.normalize(fspath.join(sshkeyDir, sshKeyFileBasename)); | ||||
|     try { | ||||
|         fs.accessSync(privateKeyFilePath, (fs.constants || fs).R_OK); | ||||
|         return privateKeyFilePath; | ||||
|     } catch(err) { | ||||
|         privateKeyFilePath = fspath.join(userSSHKeyDir,name); | ||||
|         try { | ||||
|             fs.accessSync(privateKeyFilePath, (fs.constants || fs).R_OK); | ||||
|             return privateKeyFilePath; | ||||
|         } catch(err2) { | ||||
|             return null; | ||||
|         } | ||||
|     } | ||||
|     if (fspath.sep === '\\') { | ||||
|         privateKeyFilePath = privateKeyFilePath.replace(/\\/g,'\\\\'); | ||||
|     } | ||||
|     return privateKeyFilePath; | ||||
| } | ||||
|  | ||||
| module.exports = { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user