mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 01:34:27 +00:00 
			
		
		
		
	Delete Public SSH Key tmp file after calculating fingerprint (#1855)
* Delete public key tmp file after calculating fingerprint Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Move line Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Remove defer statement Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Readd defer statement and move remove Signed-off-by: Magnus Lindvall <magnus@dnmgns.com> * Delete space Signed-off-by: Magnus Lindvall <magnus@dnmgns.com>
This commit is contained in:
		
				
					committed by
					
						
						Lunny Xiao
					
				
			
			
				
	
			
			
			
						parent
						
							65cf6cc848
						
					
				
				
					commit
					ff7424179e
				
			@@ -376,6 +376,7 @@ func calcFingerprint(publicKeyContent string) (string, error) {
 | 
				
			|||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return "", err
 | 
							return "", err
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						defer os.Remove(tmpPath)
 | 
				
			||||||
	stdout, stderr, err := process.GetManager().Exec("AddPublicKey", "ssh-keygen", "-lf", tmpPath)
 | 
						stdout, stderr, err := process.GetManager().Exec("AddPublicKey", "ssh-keygen", "-lf", tmpPath)
 | 
				
			||||||
	if err != nil {
 | 
						if err != nil {
 | 
				
			||||||
		return "", fmt.Errorf("'ssh-keygen -lf %s' failed with error '%s': %s", tmpPath, err, stderr)
 | 
							return "", fmt.Errorf("'ssh-keygen -lf %s' failed with error '%s': %s", tmpPath, err, stderr)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user