Merge pull request #151 from future-architect/enable-to-scan-on-centos-non-root
Fix yum update --changelog stalled when non-root ssh user on CentOS #150
This commit is contained in:
		@@ -576,10 +576,7 @@ func (o *redhat) getAllChangelog(packInfoList models.PackageInfoList) (stdout st
 | 
			
		||||
		packageNames += fmt.Sprintf("%s ", packInfo.Name)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	command := ""
 | 
			
		||||
	if o.ServerInfo.User == "root" {
 | 
			
		||||
		command = "echo N | "
 | 
			
		||||
	}
 | 
			
		||||
	command := "echo N | "
 | 
			
		||||
	if 0 < len(config.Conf.HTTPProxy) {
 | 
			
		||||
		command += util.ProxyEnv()
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
@@ -299,6 +299,7 @@ func getSSHLogger(log ...*logrus.Entry) *logrus.Entry {
 | 
			
		||||
func decolateCmd(c conf.ServerInfo, cmd string, sudo bool) string {
 | 
			
		||||
	if sudo && c.User != "root" && !c.IsContainer() {
 | 
			
		||||
		cmd = fmt.Sprintf("sudo -S %s", cmd)
 | 
			
		||||
		cmd = strings.Replace(cmd, "|", "| sudo ", -1)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if c.Family != "FreeBSD" {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user