mirror of
				https://github.com/appleboy/drone-ssh.git
				synced 2025-10-29 00:51:15 +08:00 
			
		
		
		
	fix: escaping special characters when passing env to ssh
This commit is contained in:
		
							parent
							
								
									7220c94832
								
							
						
					
					
						commit
						15bdee9ea5
					
				| @ -73,7 +73,7 @@ func (p Plugin) exec(host string, wg *sync.WaitGroup, errChannel chan error) { | ||||
| 		key = strings.ToUpper(key) | ||||
| 		val := os.Getenv(key) | ||||
| 		val = strings.Replace(val, " ", "", -1) | ||||
| 		env = append(env, key+"="+val) | ||||
| 		env = append(env, key+"='"+val+"'") | ||||
| 	} | ||||
| 
 | ||||
| 	p.Config.Script = append(env, p.Config.Script...) | ||||
|  | ||||
| @ -232,7 +232,7 @@ func TestSSHCommandExitCodeError(t *testing.T) { | ||||
| } | ||||
| 
 | ||||
| func TestSetENV(t *testing.T) { | ||||
| 	os.Setenv("FOO", "1") | ||||
| 	os.Setenv("FOO", "1)") | ||||
| 	plugin := Plugin{ | ||||
| 		Config: Config{ | ||||
| 			Host:           []string{"localhost"}, | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Damian Kaczmarek
						Damian Kaczmarek