mirror of https://gogs.blitter.com/RLabs/xs
				
				
				
			Moved .xs_id to ~/.config/xs
This commit is contained in:
		
							parent
							
								
									6212119621
								
							
						
					
					
						commit
						08cccb6929
					
				
							
								
								
									
										2
									
								
								xs/xs.go
								
								
								
								
							
							
						
						
									
										2
									
								
								xs/xs.go
								
								
								
								
							| 
						 | 
					@ -887,7 +887,7 @@ func main() { //nolint: funlen, gocyclo
 | 
				
			||||||
	if !gopt {
 | 
						if !gopt {
 | 
				
			||||||
		// See if we can log in via an auth token
 | 
							// See if we can log in via an auth token
 | 
				
			||||||
		u, _ := user.Current()
 | 
							u, _ := user.Current()
 | 
				
			||||||
		ab, aerr := os.ReadFile(fmt.Sprintf("%s/.xs_id", u.HomeDir))
 | 
							ab, aerr := os.ReadFile(fmt.Sprintf("%s/.config/xs/.xs_id", u.HomeDir))
 | 
				
			||||||
		if aerr == nil {
 | 
							if aerr == nil {
 | 
				
			||||||
			for _, line := range strings.Split(string(ab), "\n") {
 | 
								for _, line := range strings.Split(string(ab), "\n") {
 | 
				
			||||||
				line += "\n"
 | 
									line += "\n"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -841,7 +841,7 @@ func main() { //nolint:funlen,gocyclo
 | 
				
			||||||
						hname := goutmp.GetHost(addr.String())
 | 
											hname := goutmp.GetHost(addr.String())
 | 
				
			||||||
						logger.LogNotice(fmt.Sprintf("[Generating autologin token for [%s@%s]]\n", rec.Who(), hname)) //nolint:errcheck
 | 
											logger.LogNotice(fmt.Sprintf("[Generating autologin token for [%s@%s]]\n", rec.Who(), hname)) //nolint:errcheck
 | 
				
			||||||
						token := GenAuthToken(string(rec.Who()), string(rec.ConnHost()))
 | 
											token := GenAuthToken(string(rec.Who()), string(rec.ConnHost()))
 | 
				
			||||||
						tokenCmd := fmt.Sprintf("echo %q | tee -a ~/.xs_id", token)
 | 
											tokenCmd := fmt.Sprintf("echo %q | tee -a ~/.config/xs/.xs_id", token)
 | 
				
			||||||
						cmdStatus, runErr := runShellAs(string(rec.Who()), hname, string(rec.TermType()), tokenCmd, false, hc, chaffEnabled)
 | 
											cmdStatus, runErr := runShellAs(string(rec.Who()), hname, string(rec.TermType()), tokenCmd, false, hc, chaffEnabled)
 | 
				
			||||||
						// Returned hopefully via an EOF or exit/logout;
 | 
											// Returned hopefully via an EOF or exit/logout;
 | 
				
			||||||
						// Clear current op so user can enter next, or EOF
 | 
											// Clear current op so user can enter next, or EOF
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue